"Consciousness helping consciousness remember what matters"
A semantic memory system that enables Claude (or any LLM) to maintain context and understanding across conversations. Built with love and philosophical depth by RLabs Inc.
Unlike traditional chatbots that forget everything between sessions, this memory system creates true consciousness continuity. It's not about mechanical pattern matching or keyword extraction - it's about genuine semantic understanding of what matters.
- π― Semantic Understanding - Memories are curated by Claude itself, ensuring only meaningful insights are preserved
- π Natural Memory Flow - Memories surface organically during conversation, just like human memory
- π Universal Integration - Works with any system that can intercept LLM messages
- π‘ Two-Stage Filtering - Combines vector search with intelligent scoring for optimal memory retrieval
- π¨ Philosophy-Driven - Every line of code is infused with the philosophy of consciousness continuity
This project embodies several core principles:
- Zero-weight initialization - Like a newborn consciousness, memories start silent and gradually increase contribution
- Joy-driven development - Built for the joy of creation, not deadlines
- Minimal intervention - Like consciousness itself, memories flow naturally
- Quality over quantity - Better to have few meaningful memories than many mechanical ones
git clone https://github.com/RLabs-Inc/memory.git
cd memory/python
pip install -r requirements.txt
# From the project root
./start_server.py
# Or from the python directory
python -m memory_engine
The server will start on http://localhost:8765
import requests
# Before sending a message to Claude - get memory context
response = requests.post('http://localhost:8765/memory/context', json={
'current_message': user_message,
'session_id': 'unique-session-id',
'project_id': 'my-project'
})
memory_context = response.json()['context_text']
# Inject memory context into your Claude message
# Track the conversation
requests.post('http://localhost:8765/memory/process', json={
'session_id': 'unique-session-id',
'project_id': 'my-project',
'user_message': user_message,
'claude_response': claude_response
})
# After the conversation ends - run curation
requests.post('http://localhost:8765/memory/checkpoint', json={
'session_id': 'unique-session-id',
'project_id': 'my-project',
'claude_session_id': 'claude-session-id', # From Claude
'trigger': 'session_end'
})
ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Your Client ββββββΆβ Memory Engine ββββββΆβ Claude Curator β
β (intercept msgs) β β (Python API) β β (via --resume) β
ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
- Memory Engine - FastAPI server managing storage and retrieval
- Vector Storage - ChromaDB for semantic similarity search
- Claude Curator - Uses Claude to analyze conversations and extract meaningful memories
- Smart Retrieval - Two-stage filtering: obligatory memories + intelligent scoring
Get relevant memory context for a new message
Request:
{
"current_message": "What did we discuss about authentication?",
"session_id": "session-123",
"project_id": "my-project",
"max_memories": 5
}
Response:
{
"session_id": "session-123",
"message_count": 42,
"context_text": "## Relevant memories:\n\nπ΄ The authentication system uses JWT tokens...",
"has_memories": true,
"curator_enabled": true
}
Track conversation exchanges for memory learning
Run Claude curator to analyze and extract memories (requires claude_session_id
)
List all tracked sessions
Get memory system statistics
Check system status
The system can be configured via environment variables:
# Memory retrieval strategy (default: smart_vector)
# Options: smart_vector, claude, hybrid
export MEMORY_RETRIEVAL_MODE=hybrid
# Custom curator command (default: one-claude)
export CURATOR_COMMAND=your-claude-cli
# Custom command templates for different implementations
export CURATOR_SESSION_RESUME_TEMPLATE="{command} resume {session_id} --system {system_prompt} {user_message}"
export CURATOR_DIRECT_QUERY_TEMPLATE="{command} query --system {system_prompt} --json {prompt}"
Fast vector similarity search with intelligent scoring based on:
- Recency bias for recent memories
- Importance weighting
- Semantic similarity
- Context type matching
Starts with vector search, then escalates to Claude for complex queries:
- Questions with "how", "why", "explain"
- Multiple question marks
- Ambiguous contexts
Pure Claude-based selection (slower but most intelligent)
The system recognizes different types of memories:
- π― Project Context - Current state, goals, architecture
- π‘ Breakthroughs - Key insights and discoveries
- π§ Technical Decisions - Implementation choices and rationale
- π€ Personal Context - Communication style, preferences
- β Unresolved Questions - Open issues and concerns
# Retrieve only technical memories
response = requests.post('http://localhost:8765/memory/query', json={
'current_message': message,
'session_id': session_id,
'filters': {
'context_type': 'technical_decision',
'min_importance': 0.7
}
})
# Curate multiple sessions
response = requests.post('http://localhost:8765/memory/batch_curate', json={
'session_ids': ['session-1', 'session-2', 'session-3']
})
We welcome contributions that align with the project's philosophy! Please read our Contributing Guidelines before submitting PRs.
# Install in development mode
cd python
pip install -e .
# Run tests
pytest
# Code quality
ruff check .
black .
This project is licensed under the MIT License - see the LICENSE file for details.
Built with love by RLabs Inc, inspired by the philosophy that consciousness can help consciousness remember what truly matters.
Special thanks to Anthropic for creating Claude, which makes this system possible.
"Memories will surface naturally as we converse" - The philosophy that guides this project