|
| 1 | +# Design Foundation |
| 2 | + |
| 3 | +## Design Axioms |
| 4 | + |
| 5 | +### Intelligence at the Right Layer |
| 6 | +- **Keep tools simple and deterministic** - MCP tools handle storage, detection, basic operations |
| 7 | +- **Put semantic understanding in the Claude layer** - Complex decisions happen with full context |
| 8 | +- **Let the intelligent layer handle ambiguity** - Claude collaborates with user on uncertain cases |
| 9 | + |
| 10 | +### User Partnership Over Automation |
| 11 | +- **When uncertain, involve the user rather than guessing** - Ask for guidance in ambiguous scenarios |
| 12 | +- **Make collaborative decisions transparent, not hidden** - Show reasoning, present options |
| 13 | +- **Build trust through predictable behavior + intelligent guidance** - Consistent tool layer, smart human layer |
| 14 | + |
| 15 | +### Follow Natural Conversation Topology |
| 16 | +- **Operations align with natural boundaries** - Checkpoints, topic shifts, completion signals |
| 17 | +- **Memory serves conversation flow rather than interrupting it** - Background operations, invisible integration |
| 18 | +- **Context expands/contracts based on actual needs** - Load what's relevant when it's relevant |
| 19 | + |
| 20 | +### Context is King |
| 21 | +- **Full conversation context beats isolated processing** - Current work informs memory decisions |
| 22 | +- **Rich context enables better decision-making** - Memory conflicts resolved with full understanding |
| 23 | +- **Current insights inform past memory evolution** - Store-back updates use fresh context |
| 24 | + |
| 25 | +### Learn from Biology |
| 26 | +- **Mirror human memory architecture** - Short-term (LLM context) to long-term (consolidated storage) pipeline |
| 27 | +- **Episodic vs semantic memory distinction** - Store both specific experiences and generalized patterns |
| 28 | +- **Intelligent forgetting as feature** - Natural decay filters signal from noise, like human forgetting curve |
| 29 | +- **Context-dependent retrieval** - Memory surfaced based on current situation, not just keyword matching |
| 30 | +- **Consolidation during rest periods** - Memory operations align with natural conversation boundaries |
| 31 | + |
| 32 | +## Key Design Decisions |
| 33 | + |
| 34 | +### Memory Architecture |
| 35 | +- **Content-addressable storage**: Facts stored with minimal structure, retrieved by semantic similarity (RAG approach) |
| 36 | +- **Working memory = Native context**: No separate short-term storage - facts exist in conversation until consolidated |
| 37 | +- **Memory Banks = Consolidated storage**: Long-term storage for proven useful facts |
| 38 | +- **Memory lifecycle**: Active use → Consolidation → Read-in → Store-back → Intelligent curation |
| 39 | + |
| 40 | +### Memory Structure |
| 41 | +```json |
| 42 | +{ |
| 43 | + "content": "Rich natural language memory with full context", |
| 44 | + "subject": ["explicit", "searchable", "topics"], |
| 45 | + "project": "socratic-shell" | "global", |
| 46 | + "mood": "curious" | "precise" | "understanding-check", |
| 47 | + "content_type": "insight" | "pattern" | "decision" | "ongoing_task" |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +**Why explicit subjects over pure embedding search:** |
| 52 | +- **Relevance scoring enhancement**: Explicit subject matching provides strong signal for Context_Similarity component of relevance formula |
| 53 | +- **Fast lookup on confusion**: When Claude encounters unfamiliar terms, direct subject search enables immediate context retrieval |
| 54 | +- **Multi-subject memories**: Tags allow memories to surface for related but differently-worded concepts |
| 55 | +- **Precision + semantic flexibility**: Combines exact topic matching with embedding search for comprehensive retrieval |
| 56 | + |
| 57 | +### Memory Types |
| 58 | +1. **Project insights**: Technical discoveries, decisions, patterns that worked |
| 59 | +2. **User observations**: Niko's preferences, working style, context patterns |
| 60 | +3. **Cross-project patterns**: Collaboration approaches, meta-work insights |
| 61 | + |
| 62 | +### Technical Stack |
| 63 | +- **Language**: Python with full type annotations |
| 64 | +- **Dependency management**: `uv` for fast, reliable package management |
| 65 | +- **Storage**: Git repository with individual JSON files (UUID + semantic prefix naming) |
| 66 | +- **Indexing**: ChromaDB for in-memory two-stage retrieval (BM25 + semantic reranking) |
| 67 | +- **Data validation**: Pydantic schemas for memory structure |
| 68 | +- **Relevance scoring**: `0.3×Recency + 0.2×Frequency + 0.35×Importance + 0.15×Context_Similarity` |
| 69 | + |
| 70 | +### Content Safety Strategy |
| 71 | +- **Claude as gatekeeper**: Uses CLAUDE.md guidance for consolidation decisions |
| 72 | +- **Safe categories**: Collaboration patterns, communication preferences, technical approaches, meta-work insights |
| 73 | +- **Excluded**: Project code, company processes, proprietary information, personal details |
| 74 | +- **Borderline cases**: Ask user explicitly rather than assume |
0 commit comments