Semantic memory
The project’s durable guidance.
Rules and lessons that can help again, such as the preferred test style or a design-system convention.
Use semantic color tokens from the theme.
You explain how your project works. SmartAssist keeps the useful lesson and the correction behind it, then finds relevant context for a later task.
Follow one correctionThe learning loop, made visible
Explore the steps, then separate the layers to see what each kind of memory contributes.
“Please use our theme tokens instead of hardcoded colors.”
Illustrative example. This page reads and stores no project memory.
Step 1 of 4
You give feedback in the conversation. The shared feedback workflow checks for a reusable project lesson and looks for existing guidance that overlaps.
“Please use our theme tokens instead of hardcoded colors.”
A repeated rule can reinforce an existing lesson. A new lesson can be created when the guidance is distinct.
Step 2 of 4
The reusable instruction becomes a project rule. Past corrections retain the concrete experience behind the guidance. They remain distinguishable when retrieved.
Rule: use theme tokens.
History: hardcoded colors needed correcting.
This is semantic memory and episodic memory. SQLite is the canonical store for the project’s memory.
Step 3 of 4
A later request, such as building a settings screen, gives retrieval a new query. SmartAssist finds matching guidance and uses per-lesson feedback to help rank the candidates.
“Build the settings screen for this project.”
Keyword-based retrieval works by default. Optional semantic retrieval helps with paraphrased requests.
Step 4 of 4
The task gets a small mix of relevant rules and past corrections. That prompt-time mix is working memory. Later feedback can influence future lesson ranking.
For this settings screen: use the theme’s color tokens, with the earlier correction as context.
Claude Code hooks inject context automatically. Other agents retrieve through their instructions and MCP tools.
Three names, three jobs
Two stored memory types contribute to one task’s context. Each has a different purpose.
The project’s durable guidance.
Rules and lessons that can help again, such as the preferred test style or a design-system convention.
Use semantic color tokens from the theme.
The experience behind the rule.
Concrete feedback events, corrections, and failures that give the guidance project-specific context.
A previous component used hardcoded colors and needed a correction.
A relevant mix for the task.
A small prompt-time assembly of useful rules and past corrections. It changes with the current request.
Theme guidance and its history, ready for the settings-screen task.
Two separate learning loops
SmartAssist uses Thompson sampling in two places. One ranks individual lessons; the other tracks reliability across areas of work.
Which specific guidance should show up first?
SmartAssist records which lessons were injected. Later feedback provides evidence for their future ranking, while allowing exploration of newer lessons.
Which areas of work need more attention?
A separate loop tracks categories such as testing, Git, and code changes. It powers reliability views, weak-category guidance, and boundary packs.
Feedback updates the memory system’s evidence and ranking. It does not retrain the underlying AI model.
Under the hood
The memory model, ranking, storage, and delivery work together, while keeping their different jobs intact.
Each project keeps its data in
.claude/smartassist/data/. The SQLite database holds
lessons, feedback events, scores, and the canonical search
projection.
The optional LanceDB vector cache is derived data. It is not a second source of truth.
Lexical retrieval is the default. Opt-in semantic retrieval adds a
local embedding service using
BAAI/bge-small-en-v1.5 and combines semantic
similarity with lexical matching.
If the semantic service is unavailable, retrieval falls back to the lexical path.
Five lifecycle hooks cover session start, prompt submission, tool
use, and session end. Prompt hooks inject context;
rag_search also lets the agent retrieve it on demand.
The hook and MCP retrieval paths preserve project rules, past corrections, and per-lesson ranking.
Codex uses MCP tools and global agent instructions, with setup and targeted validation in this repository. Gemini, ChatGPT, Amp, and OpenCode have adapters for the shared feedback workflow.
Claude Code has the deepest validation. The other adapters still need broader runtime validation.
Read the canonical documentation for implementation details, supported setup, and the architecture’s protected invariants.
Architecture in the READMEMemory model and learning-loop invariantsOptional semantic retrievalCanonical storage and the vector cacheStart with a real correction. Keep the guidance useful as the project changes.