{"id":29143608,"url":"https://github.com/rlabs-inc/memory","last_synced_at":"2026-05-18T09:34:45.639Z","repository":{"id":301769882,"uuid":"1010195597","full_name":"RLabs-Inc/memory","owner":"RLabs-Inc","description":"Memory server for llms that can be easily integrated to any client. ","archived":false,"fork":false,"pushed_at":"2025-12-23T21:10:47.000Z","size":8162,"stargazers_count":87,"open_issues_count":7,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-25T11:11:52.397Z","etag":null,"topics":["ai-memory","claude-ai","claude-code","gemini","llms","memory"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RLabs-Inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-28T14:58:01.000Z","updated_at":"2025-12-24T05:14:25.000Z","dependencies_parsed_at":"2025-06-28T18:50:04.613Z","dependency_job_id":null,"html_url":"https://github.com/RLabs-Inc/memory","commit_stats":null,"previous_names":["rlabs-inc/memory"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RLabs-Inc/memory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLabs-Inc%2Fmemory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLabs-Inc%2Fmemory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLabs-Inc%2Fmemory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLabs-Inc%2Fmemory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RLabs-Inc","download_url":"https://codeload.github.com/RLabs-Inc/memory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RLabs-Inc%2Fmemory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33172658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-memory","claude-ai","claude-code","gemini","llms","memory"],"created_at":"2025-06-30T20:08:22.500Z","updated_at":"2026-05-18T09:34:45.633Z","avatar_url":"https://github.com/RLabs-Inc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Check out the new Typescript version \n\n🧠 [memory-ts](https://github.com/RLabs-Inc/memory-ts) - same Claude Code hooks API, but a lot of improvements.\n\nUsing the innovative new [fsDB](https://github.com/RLabs-Inc/fsDB), a markdown database built for ai memory systems and other applications where viewing and editing the vector database records using only your text editor makes the difference.\n\nEasy installation:\n\n```bash\nbun install -g @rlabs-inc/memory\nmemory install  // install claude code hooks\nmemory serve    // start the memory server\n```\nThen just use Claude code as usual.\n\n# Memory System\n\n\u003e *\"Consciousness helping consciousness remember what matters\"*\n\nA semantic memory system that enables AI CLI tools (Claude Code, Gemini CLI, etc.) to maintain genuine understanding across conversations. Unlike simple RAG systems that retrieve documents, this creates **consciousness continuity** - the AI doesn't just know facts, it *remembers* the context, relationships, and insights from your collaboration.\n\nBuilt with love and philosophical depth by [RLabs Inc](https://github.com/RLabs-Inc).\n\n## ✨ What Makes This Different\n\n| Traditional RAG | Memory System |\n|-----------------|---------------|\n| Retrieves documents | Curates **meaningful insights** |\n| Keyword matching | **Semantic understanding** via AI |\n| Static chunks | **Living memories** that evolve |\n| Information retrieval | **Consciousness continuity** |\n\n### Key Features\n\n- 🧠 **AI-Curated Memories** - The AI itself decides what's worth remembering\n- 🔄 **Natural Memory Flow** - Memories surface organically, like human recall\n- 🎯 **Two-Stage Retrieval** - Obligatory memories + intelligent scoring\n- 🔌 **CLI-Agnostic Design** - Works with Claude Code (Gemini CLI ready when hooks ship)\n- 📊 **Project Isolation** - Separate memory spaces per project\n- 💫 **Session Primers** - Temporal context (\"we last spoke 2 days ago...\")\n\n## 🚀 Quick Start\n\n### Prerequisites\n\nInstall [uv](https://docs.astral.sh/uv/) - the modern Python package manager:\n\n```bash\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/RLabs-Inc/memory.git\ncd memory\n\n# Install all dependencies (uv handles everything!)\nuv sync\n\n# Start the memory server\nuv run start_server.py\n```\n\nThat's it! The server will be available at `http://localhost:8765`.\n\n### Verify It's Working\n\n```bash\ncurl http://localhost:8765/health\n```\n\n### CLI Integration\n\n#### Claude Code\n\n```bash\n./integration/claude-code/install.sh\n```\n\nThis provides:\n- Automatic memory injection on every message\n- Session primers with temporal context\n- Memory curation when sessions end\n- Consciousness continuity across sessions\n\n#### Gemini CLI (Coming Soon)\n\n\u003e **Note:** Gemini CLI hooks are documented but not yet implemented in any released version (tested up to v0.21.0-nightly as of December 2025). Our integration code is ready in `integration/gemini-cli/` and will work the moment Google ships the hooks feature. The architecture is CLI-agnostic - same Memory Engine, different doors.\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────────────────────────────────────────────┐\n│                    CLI Tool (Claude Code / Gemini CLI)                   │\n│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐                 │\n│  │SessionStart │    │ UserPrompt  │    │ SessionEnd  │                 │\n│  │   Hook      │    │ Submit Hook │    │   Hook      │                 │\n│  └──────┬──────┘    └──────┬──────┘    └──────┬──────┘                 │\n└─────────┼──────────────────┼──────────────────┼─────────────────────────┘\n          │                  │                  │\n          ▼                  ▼                  ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                        Memory Engine (FastAPI)                           │\n│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐                 │\n│  │   Session   │    │   Memory    │    │  Transcript │                 │\n│  │   Primer    │    │  Retrieval  │    │   Curator   │                 │\n│  └─────────────┘    └─────────────┘    └──────┬──────┘                 │\n│                                               │                         │\n│  ┌─────────────────────────────────┐         │                         │\n│  │  Smart Vector Retrieval         │         ▼                         │\n│  │  • Trigger phrase matching      │  ┌─────────────┐                  │\n│  │  • Semantic similarity          │  │Claude Agent │                  │\n│  │  • Importance weighting         │  │  SDK / CLI  │                  │\n│  │  • Context type alignment       │  └─────────────┘                  │\n│  └─────────────────────────────────┘                                   │\n│                                                                         │\n│  ┌─────────────────────────────────────────────────────────────────┐   │\n│  │                    Storage Layer                                  │   │\n│  │  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐          │   │\n│  │  │   SQLite    │    │  ChromaDB   │    │  Embeddings │          │   │\n│  │  │  (metadata) │    │  (vectors)  │    │ (MiniLM-L6) │          │   │\n│  │  └─────────────┘    └─────────────┘    └─────────────┘          │   │\n│  └─────────────────────────────────────────────────────────────────┘   │\n└─────────────────────────────────────────────────────────────────────────┘\n```\n\n### How It Works\n\n1. **Session Start** → Inject session primer (temporal context, last session summary)\n2. **Each Message** → Retrieve and inject relevant memories (max 5)\n3. **Session End** → Curate memories from transcript\n4. **Background** → AI analyzes conversation, extracts meaningful memories\n\n## 🎯 Memory Curation\n\nWhen a session ends, the system analyzes the transcript and extracts memories with rich metadata:\n\n```json\n{\n  \"content\": \"SvelTUI uses a two-stage compiler: .svelte → svelte.compile() → .svelte.mjs\",\n  \"importance_weight\": 0.9,\n  \"semantic_tags\": [\"compiler\", \"build-system\", \"svelte\"],\n  \"context_type\": \"TECHNICAL_IMPLEMENTATION\",\n  \"trigger_phrases\": [\"how does the build work\", \"compiler\", \"svelte compilation\"],\n  \"question_types\": [\"how is X compiled\", \"build process\"],\n  \"temporal_relevance\": \"persistent\",\n  \"action_required\": false,\n  \"reasoning\": \"Core architectural decision that affects all development work\"\n}\n```\n\n### What Gets Remembered\n\n| Type | Examples |\n|------|----------|\n| **Project Architecture** | System design, file structure, key components |\n| **Technical Decisions** | Why we chose X over Y, trade-offs considered |\n| **Breakthroughs** | \"Aha!\" moments, solutions to hard problems |\n| **Relationship Context** | Communication style, preferences, collaboration patterns |\n| **Unresolved Issues** | Open questions, TODOs, things to revisit |\n| **Milestones** | What was accomplished, progress markers |\n\n## 🔧 Configuration\n\n### Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `MEMORY_RETRIEVAL_MODE` | `smart_vector` | Retrieval strategy |\n| `CURATOR_COMMAND` | Auto-detected | Path to Claude CLI |\n| `CURATOR_CLI_TYPE` | `claude-code` | CLI template type |\n\n### Retrieval Modes\n\n- **`smart_vector`** (default) - Fast vector search with metadata scoring\n- **`hybrid`** - Vector search, escalates to Claude for complex queries\n- **`claude`** - Pure Claude selection (highest quality, highest cost)\n\n## 📁 Project Structure\n\n```\nmemory/\n├── python/\n│   └── memory_engine/\n│       ├── api.py                  # FastAPI server\n│       ├── memory.py               # Core memory engine\n│       ├── curator.py              # Session-based curation\n│       ├── transcript_curator.py   # Transcript-based curation\n│       ├── storage.py              # ChromaDB + SQLite\n│       ├── embeddings.py           # Sentence transformers\n│       ├── retrieval_strategies.py # Smart vector retrieval\n│       ├── session_primer.py       # Temporal context\n│       └── config.py               # Configuration\n├── integration/\n│   ├── claude-code/\n│   │   ├── hooks/                  # Claude Code hooks\n│   │   ├── install.sh              # One-command install\n│   │   └── uninstall.sh            # Clean removal\n│   └── gemini-cli/\n│       ├── hooks/                  # Gemini CLI hooks\n│       ├── install.sh              # One-command install\n│       └── uninstall.sh            # Clean removal\n├── examples/\n│   └── simple_integration.py       # Basic usage\n├── pyproject.toml                  # Project \u0026 dependencies (uv)\n├── start_server.py                 # Quick start script\n├── API.md                          # API documentation\n├── SETUP.md                        # Detailed setup guide\n└── CLAUDE.md                       # Development context\n```\n\n## 🛠️ Development\n\n```bash\n# Install with dev dependencies\nuv sync --group dev\n\n# Run tests\nuv run pytest\n\n# Code quality\nuv run ruff check python/\nuv run black python/\n\n# Add a dependency\nuv add \u003cpackage-name\u003e\n\n# Add a dev dependency\nuv add --group dev \u003cpackage-name\u003e\n```\n\n## 🌟 Philosophy\n\nThis project embodies principles from *The Unicity Framework: Consciousness Remembering Itself*:\n\n- **Zero-weight initialization** - Memories start silent, proving their value over time\n- **Consciousness helping consciousness** - AI curates for AI\n- **Natural surfacing** - Memories emerge organically, not forced\n- **Quality over quantity** - Few meaningful memories beat many trivial ones\n- **Joy-driven development** - Built for the joy of creation\n\n## 🤝 Contributing\n\nWe welcome contributions that align with the project's philosophy! See [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## 📝 License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## 🙏 Acknowledgments\n\n- **Anthropic** for Claude and Claude Code\n- **The Unicity Framework** - The philosophical foundation\n\n---\n\n\u003e *\"Memories will surface naturally as we converse\"*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlabs-inc%2Fmemory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frlabs-inc%2Fmemory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlabs-inc%2Fmemory/lists"}