Repository navigation
YANJ-446: add concise MCP and CLI recall output - #221
Open
mameikagou wants to merge 1 commit into
Open
mameikagou wants to merge 1 commit into
mameikagou wants to merge 1 commit into
Conversation
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.
Recall currently serializes full candidate nodes even when the context token budget is small. The CLI also includes embeddings because its JSON output does not use the MCP vector filter.
This change makes MCP recall return
context(text,tokens_used,budget) and concisehits(id,observed_at,score,status,text). Compact output defaults to 8 hits; optionalkis passed to the core engine.verbose: truereturns the existing full response structure and preserves the engine's candidate count whenkis omitted. Recall vectors require explicitinclude_vectors: truewith verbose output.CLI
--briefselects the same concise structure, withok,mode, andquery. The CLI keeps its detailed fields by default because existing scripts consumeitemsandcontext_packet;--fullselects that explicitly, and--include-vectorsrestores embeddings. The existing--compactwhitespace option keeps its meaning. Both transports share hit formatting and vector filtering. Historical brief output limits chronological hits and builds context with the existing budgeted context builder; verbose historical output keeps the complete timeline.Measured on a self-hosted database before and after rebuilding the container, using strict mode and
token_budget=300(UTF-8 JSON payload bytes, excluding the MCP transport envelope):token_budgetbounds context text;kbounds hit count. Hit text is preserved, so neither is a total byte limit. Existing MCP consumers of full nodes/traces should addverbose: true.Validation:
typecheck,recall:check,build,branding:check,integration:check, andbench:cipassed. Added real SQLite/CLI and SDK MCP tests for all four modes, default/explicit limits, context preservation, observation dates, empty results, scope rejection, and vector opt-in. Also ran recall checks with the global MCP vector default enabled, verified the clean main-based branch, and exercised the rebuilt HTTP MCP server through initialize and tools/call.