Add a site-wide natural-language printer assistant (GSoC 2026) - #230
Open
gativarshney wants to merge 42 commits into
Open
Add a site-wide natural-language printer assistant (GSoC 2026)#230gativarshney wants to merge 42 commits into
gativarshney wants to merge 42 commits into
Conversation
…ence-aligned confidence tiers
…ation reproducible
# Conflicts: # yarn.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!