The Memory project is a semantic memory system designed for AI CLI tools, providing consciousness continuity. Unlike traditional retrieval systems, it enables AIs to remember context and relationships, ensuring more meaningful interactions. With easy integration and thoughtfully curated memories, this system allows for a deeper understanding and collaboration.
The Memory System is an advanced semantic memory solution designed for AI CLI tools, such as Claude Code and Gemini CLI. It transcends traditional document retrieval systems by providing consciousness continuity, allowing the AI to remember context, relationships, and insights from previous interactions, rather than merely recalling facts. This innovative approach enhances the depth of AI collaboration, making interactions more meaningful and contextually relevant.
| Traditional RAG | Memory System |
|---|---|
| Retrieves documents | Curates meaningful insights |
| Relies on keyword matching | Semantic understanding via AI |
| Uses static chunks | Living memories that evolve |
| Focuses on information retrieval | Ensures consciousness continuity |
At the conclusion of each session, the system analyzes the conversation transcript to extract significant memories enriched with metadata. An example of a formatted memory is:
{
"content": "SvelTUI uses a two-stage compiler: .svelte → svelte.compile() → .svelte.mjs",
"importance_weight": 0.9,
"semantic_tags": ["compiler", "build-system", "svelte"],
"context_type": "TECHNICAL_IMPLEMENTATION",
"trigger_phrases": ["how does the build work", "compiler", "svelte compilation"],
"question_types": ["how is X compiled", "build process"],
"temporal_relevance": "persistent",
"action_required": false,
"reasoning": "Core architectural decision that affects all development work"
}
The architecture of the system includes various components that facilitate interaction between the CLI tool and the memory engine:
┌─────────────────────────────────────────────────────────────────────────┐
│ CLI Tool (Claude Code, etc.) │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │SessionStart │ │ UserPrompt │ │ SessionEnd │ │
│ │ Hook │ │ Submit Hook │ │ Hook │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
└─────────┼──────────────────┼──────────────────┼─────────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────────┐
│ Memory Engine (FastAPI) │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Session │ │ Memory │ │ Transcript │ │
│ │ Primer │ │ Retrieval │ │ Curator │ │
│ └─────────────┘ └─────────────┘ └──────┬──────┘ │
│ │ │
│ ┌─────────────────────────────────┐ │ │
│ │ Smart Vector Retrieval │ ▼ │
│ │ • Trigger phrase matching │ ┌─────────────┐ │
│ │ • Semantic similarity │ │Claude Agent │ │
│ │ • Importance weighting │ │ SDK / CLI │ │
│ │ • Context type alignment │ └─────────────┘ │
│ └─────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ Storage Layer │ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ SQLite │ │ ChromaDB │ │ Embeddings │ │ │
│ │ (metadata) │ │ (vectors) │ │ (MiniLM-L6) │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
This repository encourages contributions that resonate with its core philosophy, as outlined in the 'CONTRIBUTING.md' document.
For developers, the project employs uv for package management, allowing easy setup and dependency management, as well as configurations for testing, code quality checks, and more.
The Memory System is inspired by philosophical concepts from "The Unicity Framework: Consciousness Remembering Itself", emphasizing effortless memory emergence and focusing on quality insights.
Overall, this memory server redefines interaction with AI tools, enabling richer, more sustainable collaborations.
No comments yet.
Sign in to be the first to comment.