The Brain: Knowledge Memory
Mind Palace doesn’t just index your code; it remembers your intentions, decisions, and learnings. This “Brain” system ensures that AI agents (and future you) understand why something was implemented, not just what was implemented.
Knowledge Types
Knowledge in the Palace is categorized into three types:
| Type | Purpose | Signal Example |
|---|---|---|
| Decision | Explicit choices that affect the codebase | ”We should use Postgres for the main DB.” |
| Idea | Potential future changes or hypotheses | ”What if we added a Redis cache here?” |
| Learning | Verified facts or patterns discovered | ”TIL: JSONC is faster than standard JSON for our use case.” |
Storing Knowledge
The CLI uses natural language processing to auto-classify your thoughts.
palace store "Let's use JWT for authentication"Explicit Typing
You can force a type if the auto-classifier doesn’t match your intent:
palace store "Maybe use Svelte?" --as idea
palace store "Always use 8080 as internal port" --as learningScoping
Knowledge can be restricted to a specific part of the project:
palace store "TIL: This file has a race condition" --scope file --path src/main.go
palace store "We decided to move auth here" --scope room --path authRecalling Knowledge
Retrieving knowledge is as simple as searching for it.
palace recall "authentication"Filtering
palace recall --type decision # See only decisions
palace recall --pending # See decisions awaiting an outcomeDecision Lifecycles
Decisions aren’t static. You can track their outcomes to prevent repeating mistakes.
Recording Outcomes
Once a decision is tested in reality, record its success or failure:
palace recall update d_abc123 success
palace recall update d_xyz789 failedOutcome values: success, failed, mixed
Linking Records
Knowledge exists in a web of relationships. Note: flags must come before the source ID:
palace recall link --supersedes d_old d_new
palace recall link --supports d_choice l_patternSupported Relations:
--supersedes--implements--supports--contradicts--inspired-by--related
AI Context Injection
When you generate a context pack (via palace explore --full or check --collect), the Palace automatically injects relevant learnings and decisions based on the files referenced in the pack.
This enables AI agents to be aware of:
- Avoidance Patterns: “Note: We tried X but it failed because Y.”
- Architectural Rules: “Remember: All API responses must follow schema Z.”
- Ongoing Discussions: “Active Idea: We are planning to deprecate this utility.”
By committing these curated knowledge items to Git (stored in .palace/brain/), you build a permanent, shared intelligence for your codebase.