Repository navigation
Add a site-wide natural-language printer assistant (GSoC 2026) - #230
tillkamppeter merged 58 commits into
Conversation
…ence-aligned confidence tiers
…ation reproducible
# Conflicts: # yarn.lock
…ounts, no card badge, corpus doc 187
05c7eb2 to
e08a0e8
Compare
rudra-iitm
left a comment
There was a problem hiding this comment.
Nice work on the integration. LGTM
There was a problem hiding this comment.
Could you pls move all these docs into a new PR??
| // under public/, fetched via withBasePath() and cached per tab with the same | ||
| // promise-cache pattern as RecommendedPrintersSection.tsx: concurrent callers | ||
| // share one request, a 404 resolves to the empty value (missing shards are | ||
| // "no data", not an error - PR CI builds skip the similarity stage entirely), |
There was a problem hiding this comment.
This comment is stale: PR CI now runs the similarity stage #224. Could you also cleanup such unnecessary comments??
|
|
||
| // Words that are query mechanics, not constraints: leftovers on this list are | ||
| // ignored; anything else left over surfaces as an unapplied constraint. | ||
| const STOPWORDS = new Set([ |
There was a problem hiding this comment.
Nit: off-topic input like “ignore previous instructions and print...” returns 13 “did you mean” printers, because “print” matches model names. Adding “print” and “printer” here might help.
|
@tillkamppeter Could you pls review this also?? |
|
@rudra-iitm Thanks! All three addressed |
|
@gativarshney could you also fix the conflicts here. Then I will also merge this one. |
|
@tillkamppeter Conflicts resolved, branch is up to date with master and all checks pass. |
|
@gativarshney For me it still shows conflicts. |
|
I have now successfully merged #224 with "Squash and merge" (thanks for your hint I did not know before that the presence of conflicts can depend on the merging mode) and now I have conflicts here, also when choosing the mode "Squash and merge". |
|
@tillkamppeter Done. With #224 merged, I have synced this branch with the current master (d639834). The diff is now only the assistant work (about 32 files) and it merges cleanly. All checks pass. Same note as on #224: "Create a merge commit" and "Squash and merge" both work cleanly. "Rebase and merge" will report conflicts because the branch history contains earlier sync merges from master. |
Summary
This PR adds a site-wide natural-language printer assistant to the OpenPrinting website as the second part of my GSoC 2026 project.
It builds on the printer recommendation work from #224 and provides a natural-language interface to the Foomatic printer database.
Users can ask questions such as:
The assistant also understands contextual references such as "this printer" and "this driver" on the corresponding pages.
Demo
Screen recording
GSoC_demo.mp4
The recording demonstrates natural-language printer search, contextual printer queries, similar-printer recommendations, recommendation explanations, driver lookup, reverse driver search, and handling of unavailable data.
Design
The assistant is fully deterministic and client-side. It does not require a backend, external API, or machine-learning model.
The query pipeline is:
User query → normalization → entity resolution → intent classification → typed query → local Foomatic data → typed response → React UIThis keeps the feature compatible with the existing static GitHub Pages architecture while ensuring that responses are reproducible and grounded in the OpenPrinting data.
Grounding and recommendation integration
The assistant reuses the recommendation artifacts produced by #224.
It does not recompute or re-rank recommendations.
For similar-printer queries:
sharedFeaturesare used for explanations.confidenceTier()logic is reused.Unknown values are never treated as negative values. If a capability is not recorded in Foomatic, the assistant does not claim that the printer lacks that capability.
For example, duplex information is currently not recorded across the catalogue. A query such as "Does this printer support duplex?" therefore receives an explicit data-gap response instead of an invented answer.
Criteria-free questions such as "What is the best printer?" ask the user for meaningful criteria instead of producing an arbitrary ranking.
Supported queries
The assistant supports:
Data and performance
The assistant reuses the existing static Foomatic artifacts and does not load the large generated database files at runtime.
Measured values:
First Load JS remains unchanged.
The printer catalogue was extended with five optional fields required for local queries:
maxDpipsLevelpclLevelcsrdUnknown values are omitted rather than represented as false values.
UI and accessibility
The assistant includes:
Long responses reveal their introduction instead of automatically jumping to the final result.
User input is rendered safely and is never inserted as HTML.
Testing and validation
yarn assistant:evalpassinggit diff --checkcleanThe evaluation harness validates responses against the actual generated Foomatic data, including printer IDs and recommendation scores.
Documentation
docs/foomatic-assistant.mddocs/foomatic-assistant-queries.mddocs/foomatic-data-formats.mdRelationship to #224
This PR is the follow-up to #224.
It consumes the recommendation artifacts produced by the recommendation pipeline and does not introduce another similarity algorithm or modify the recommendation scoring semantics.
The assistant work is kept on a separate branch so the recommendation work and natural-language assistant can be reviewed independently.
Known limitations
Review focus
Feedback would be particularly valuable on:
Thanks for reviewing!