Repository navigation
feat(assistant): LangGraph agent with rule-based recommendation (PR 3b) - #10
Merged
Merged
Conversation
…ecommendation field, rag behaviour unchanged
…omitting tools when empty
…eal SKU score, model_incomplete fallback in both modes, API model in usage
…the eval marker, make eval
…ke eval and roadmap status
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.
What
PR 3b of
docs/plan-assistant-genai.md: a LangGraph agent forPOST /assistant/ask, behindASSISTANT_MODE=agent.ragstays the default. It also adds the code-review fixes RB1–RB5 and an opt-in evals harness.Why
The agent can look products up with tools. When asked to choose, it calls
recommend_candidate, which reuses the 3a selector: a Claude rubric plus the pureselect(). The recommendation therefore comes from rules, not from the model's text. Decisions and acceptance criteria (B1–B15, RB1–RB6) are indocs/step-18-assistant-agent.md.Commits
16386f1b4d4339semantic_search,get_product_by_skuandrecommend_candidate. AfterAGENT_MAX_TOOL_CALLStool calls it answers in RAG mode. The contract gains an additive field,recommendation;ragbehaviour is unchanged.87611b1messages.createcall per turn, withomitwhen there are no toolscd69a010a0843fevalmarker, plusmake eval3c452e1recommendationfield, settings,make eval, roadmapRB1–RB5:
agentmode.find_by_skureturns the real cosine score, and the question is embedded once per run.max_tokensor refused now gets the deterministic fallback in both modes. The agent's run stops withmodel_incomplete, which is recorded in the DTO and the log, not the API.usage.modelis the model the API returned.Contract changes
AnswerResponse.recommendation: always present. It isnullinragmode, and inagentmode when the selector did not run. When it ran, it is{product_id, sku, score, reason};product_id,skuandscoreare non-null only whenreason == "chosen"(a validator enforces this).ragmode the only behaviour change is RB4. The OpenAPI description offallback_usedand the README say so.Proof
step-18).make lint: ruff clean, pylint 10.00/10, mypy clean.make test: 272 passed, 4 deselected (the eval tests).claude-haiku-5-5, still waiting for the go-ahead. Retrieval caps E1–E3 at 8/10: the acceptable SKU isn't in the top 10 for q06 or q10.Deferred
🤖 Generated with Claude Code