code_knowledge
code_knowledge is the project-local note system. Notes are stored as graph nodes and linked to the code symbols they describe, so they automatically surface in code_related, code_context, and code_impact when you query those symbols.
Actions
Section titled “Actions”| Action | Description |
|---|---|
save | Save a note linked to code symbols |
read | Read a specific note by subject |
search | Search notes by subject, text, or tag |
list | List all notes grouped by tag |
delete | Remove a note by subject |
Saving a note
Section titled “Saving a note”code_knowledge( action="save", subject="auth flow", note="JWT from /auth/login → stored in localStorage → sent via Authorization header → validated by AuthGuard", links=["AuthController", "AuthService", "AuthGuard"], tags=["architecture", "pattern"])Searching notes
Section titled “Searching notes”code_knowledge(action="search", subject="auth")code_knowledge(action="list")code_knowledge(action="read", subject="auth flow")Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
action | string | One of: save, read, search, list, delete |
subject | string | Note title / search query |
note | string | Note body (for save) |
links | string[] | Symbol names to link this note to |
tags | string[] | Tags for grouping (e.g. "architecture", "gotcha", "decision") |
Auto-surfacing
Section titled “Auto-surfacing”Notes linked to a symbol appear automatically when that symbol is queried:
code_related(name="AuthService")→ --- Knowledge ---→ [auth flow] JWT from /auth/login → stored in localStorage...When to save
Section titled “When to save”- After tracing a non-obvious flow through multiple files
- When discovering a gotcha:
tags=["gotcha"] - After making an architectural decision:
tags=["decision"] - When a pattern repeats:
tags=["pattern"]
Difference from code_memory
Section titled “Difference from code_memory”code_knowledge | code_memory | |
|---|---|---|
| Storage | Project graph (local) | MemOS cloud (persistent) |
| Linked to code nodes | Yes — auto-surfaces | No |
| Cross-project | No | Yes, per-project KB |
| Use for | Code relationships, patterns | Preferences, decisions, session notes |