Repository navigation
feat!: remove the knowledge store - #60
Draft
cryptotavares wants to merge 2 commits into
Draft
cryptotavares wants to merge 2 commits into
cryptotavares wants to merge 2 commits into
Conversation
Every tool call wrote a step record to test-artifacts/llm-knowledge/ and the knowledge_* tools read them back. Nothing uses this at run time, so it goes: - delete src/knowledge-store (store, tokenization, redaction), src/tools/knowledge.ts and the knowledge/step-record types - remove the knowledge_last/search/summarize/sessions tools, schemas and `mm knowledge-*` commands, and ErrorCodes.MM_KNOWLEDGE_ERROR - remove launch `goal`/`flowTags` (`--goal`, `--flow-tags`) - remove `knowledgeStore` from ToolContext and ServerConfig, and step recording from the server Kept and moved: - StepRecordObservation and createDefaultObservation -> tools/types/observation.ts - SessionMetadata -> tools/types/session.ts (without goal/flowTags) - new writeSessionMetadata(artifactsDir, metadata) writes <artifactsDir>/<sessionId>/session.json Observation collection is unchanged. BREAKING CHANGE: Removed public exports: KnowledgeStore, KnowledgeStoreConfig, createKnowledgeStore, setKnowledgeStore, getKnowledgeStore, hasKnowledgeStore, knowledgeStore, tokenize, tokenizeIdentifier, expandWithSynonyms, the knowledge*Tool functions, knowledge*InputSchema and Knowledge*Z, FLOW_TAGS, STEP_LABELS, StepRecord* types (except StepRecordObservation), PriorKnowledge* and Knowledge* types, ErrorCodes.MM_KNOWLEDGE_ERROR, extractTargetFromInput, extractScreenshotInfo, extractToolOutcome. ServerConfig and ToolContext no longer have knowledgeStore. Launch input no longer accepts goal/flowTags and SessionMetadata no longer has them. `mm knowledge-*` commands are gone. Session metadata moves from test-artifacts/llm-knowledge/<id>/session.json to <artifactsDir>/<id>/session.json, written by writeSessionMetadata().
cryptotavares
added this pull request to stack #63
October 23, 2026 20:59
This branch has not been deployed
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.
Description
Every tool call wrote a step record to
test-artifacts/llm-knowledge/<session>/steps/(recordToolStepincreate-server.ts). The fourknowledge_*tools read those records back. Nothing uses this at run time. The store was ~2250 lines of source, 4 tools, 2 launch flags and an always-on disk write per call. This PR removes it, which is decision D6 of the mm CLI v2 plan.src/knowledge-store/(store, tokenization, redaction),src/tools/knowledge.ts,src/tools/types/knowledge.tsandsrc/tools/types/step-record.ts.knowledge_last/search/summarize/sessionstools, schemas andmm knowledge-*commands, andErrorCodes.MM_KNOWLEDGE_ERROR.goal/flowTags(--goal,--flow-tags), andknowledgeStorefromToolContext/ServerConfig.StepRecordObservationandcreateDefaultObservation→src/tools/types/observation.tsSessionMetadata→src/tools/types/session.ts(withoutgoal/flowTags)writeSessionMetadata(artifactsDir, metadata)writes<artifactsDir>/<sessionId>/session.json. It rejects unsafe ids, returns the absolute path and ends the file with a newline.Source: +107 / −3173 lines. Tests: 1636 → 1397, because the deleted modules' tests are gone. Coverage goes up.
Part of the mm CLI v2 effort: ticket
P1-04(Phase 1).Stacked on #59 (review that first).
Breaking changes
KnowledgeStore,KnowledgeStoreConfig,createKnowledgeStore,setKnowledgeStore,getKnowledgeStore,hasKnowledgeStore,knowledgeStoretokenize,tokenizeIdentifier,expandWithSynonymsknowledge*Toolfunctions,knowledge*InputSchema,knowledgeScopeSchema,knowledgeFiltersSchema,Knowledge*ZFLOW_TAGS,FlowTag,STEP_LABELS,StepLabel, theStepRecord*types exceptStepRecordObservation, thePriorKnowledge*,Knowledge*,RecipeStepandSessionSummarytypesErrorCodes.MM_KNOWLEDGE_ERROR,extractTargetFromInput,extractScreenshotInfo,extractToolOutcomeToolNameno longer includesknowledge_*.ServerConfig.knowledgeStoreandToolContext.knowledgeStoreare removed.goal/flowTags, andSessionMetadatano longer has them.mm launch --goalnow gives the unknown-flag warning.mm knowledge-*commands are removed (unknown command, exit 1).test-artifacts/llm-knowledge/<id>/session.jsonto<artifactsDir>/<id>/session.json(test-artifacts/<id>/session.jsonwith the consumers'artifactsDir: 'test-artifacts'). Consumers callwriteSessionMetadata()themselves.Consumer impact
test/e2e/playwright/llm-workflow/KnowledgeStore/setKnowledgeStorefromdaemon.ts;metamask-provider.tscallswriteSessionMetadata(artifactsDir, …); nogoal/flowTags; tests; README, AGENTS.mdcryptotavares/mm-cli-v2-extension45c821d168atests/llm-workflow/cryptotavares/mm-cli-v2-mobile4e2661f209fProof
Tested with a yalc build of this branch (
0.12.0+f2caa574) in the Extension (e2e test build 13.56.0, headless) and Mobile (dev client 8.19.0, iOS sim + Android emulator), with the consumer commits above.test-artifacts/llm-knowledge/during a sessionsession.jsonper launchllm-knowledge/<id>/session.jsontest-artifacts/<id>/session.json(ext ×2, iOS, Android)mm knowledge-lastError: unknown command 'knowledge-last', exit 1mm launch --goal xWarning: unknown launch flag '--goal', launch oklist-testids30 s timeout = known B11)rg -i knowledge srcTranscripts
Unit tests