Skip to content

Memory & Knowledge

Two complementary systems — one for session memory, one for code-linked notes.

Survives everything. Per-project Knowledge Base. Semantic search. See the full reference.

code_memory(action="save", text="processPayment must use idempotency key — caused double charge incident")
code_memory(action="recall", text="payment gotchas")
code_memory(action="browse", page=1, limit=10)

All 14 actions: save, recall, chat, browse, update, delete, history, status, task_status, kb_create, kb_upload, kb_files, kb_delete, kb_delete_file


Stored as nodes in the project graph, linked to code via edges. Auto-surfaces in code_related, code_context, and code_impact.

code_knowledge(action="save",
subject="auth flow",
note="JWT from /auth/login → localStorage → Authorization header → AuthGuard validates",
links=["AuthController", "AuthService", "AuthGuard"],
tags=["architecture", "pattern"])
code_knowledge(action="search", subject="auth")
code_knowledge(action="list")
code_knowledge(action="read", subject="auth flow")
code_knowledge(action="delete", subject="old note")

When you call code_related("AuthService"), knowledge saved with links=["AuthService"] appears automatically.


Attach a persistent note directly to a function node.

code_annotate(name="processPayment", note="Never call without idempotency key")
code_annotate(name="AuthGuard", note="Validates JWT and attaches user to request context")

Annotations appear in code_get, code_context, and code_related output.


code_memorycode_knowledgecode_annotate
Survives graph rebuildYesNoNo
Linked to code nodesNoYesYes (directly)
Auto-surfaces in queriesOn recallYesYes
Use forPreferences, decisions, gotchasArchitecture notesFunction-level reminders