Repository navigation
LlamaIndex Integration
Archived: describes an older release that is no longer supported.
Use SuperLocalMemory as a local-first chat store backend for LlamaIndex applications. All data stays on your machine — zero cloud calls, zero API keys for the memory layer.
Prerequisites: SuperLocalMemory installed (npm install -g superlocalmemory or ./install.sh)
pip install llama-index-storage-chat-store-superlocalmemoryfrom llama_index.storage.chat_store.superlocalmemory import SuperLocalMemoryChatStore
from llama_index.core.memory import ChatMemoryBuffer
from llama_index.core.llms import ChatMessage, MessageRole
# Create chat store (backed by local SQLite)
chat_store = SuperLocalMemoryChatStore()
# Use with ChatMemoryBuffer
memory = ChatMemoryBuffer.from_defaults(
token_limit=3000,
chat_store=chat_store,
chat_store_key="user-123",
)from llama_index.core.chat_engine import SimpleChatEngine
from llama_index.core.memory import ChatMemoryBuffer
from llama_index.storage.chat_store.superlocalmemory import SuperLocalMemoryChatStore
chat_store = SuperLocalMemoryChatStore()
memory = ChatMemoryBuffer.from_defaults(
token_limit=3000,
chat_store=chat_store,
chat_store_key="project-frontend",
)
chat_engine = SimpleChatEngine(
memory=memory,
llm=your_llm,
prefix_messages=[],
)
response = chat_engine.chat("How do I center a div?")from llama_index.storage.chat_store.superlocalmemory import SuperLocalMemoryChatStore
from llama_index.core.llms import ChatMessage, MessageRole
store = SuperLocalMemoryChatStore()
# Add messages
store.add_message("session-1", ChatMessage(role=MessageRole.USER, content="Hello"))
store.add_message("session-1", ChatMessage(role=MessageRole.ASSISTANT, content="Hi there!"))
# Get messages
messages = store.get_messages("session-1")
# List all session keys
keys = store.get_keys() # ["session-1"]
# Delete operations
store.delete_last_message("session-1") # Remove last message
store.delete_message("session-1", 0) # Remove by index
store.delete_messages("session-1") # Remove all for key
# Replace all messages at once
store.set_messages("session-1", [
ChatMessage(role=MessageRole.USER, content="Fresh start"),
])| Parameter | Type | Default | Description |
|---|---|---|---|
db_path |
Optional[str] |
~/.claude-memory/memory.db |
Path to SQLite database |
Methods (all 7 BaseChatStore abstract methods):
| Method | Returns | Description |
|---|---|---|
set_messages(key, messages) |
None |
Replace all messages for a key |
get_messages(key) |
List[ChatMessage] |
Get messages ordered by creation time |
add_message(key, message) |
None |
Add a single message |
delete_messages(key) |
Optional[List[ChatMessage]] |
Delete all messages, return deleted |
delete_message(key, idx) |
Optional[ChatMessage] |
Delete by zero-based index |
delete_last_message(key) |
Optional[ChatMessage] |
Delete most recent message |
get_keys() |
List[str] |
List all session keys with data |
- Each message stored as a memory entry in SLM's SQLite database
- Session keys are hashed (
SHA-256) for tags to stay within SLM's 50-char tag limit - Full session key is preserved inside the serialized JSON for lossless round-tripping
- All
MessageRoletypes supported: USER, ASSISTANT, SYSTEM, TOOL - Importance set to 3 (lower than user memories) to avoid crowding search results
SuperLocalMemory: governed, local-first memory for AI agents. Home · Installation · Architecture · Privacy and Data Flow · CLI · MCP tools · FAQ
Part of Qualixar | Created by Varun Pratap Bhardwaj | GitHub · CHANGELOG
Platform boundary: Apple Silicon macOS, 64-bit Windows and 64-bit Linux. Linux covers x86_64 and ARM64. Intel Mac, 32-bit Windows and Windows on ARM are not supported.
SuperLocalMemory
Start here
How memory works
- Architecture
- How Remember Works
- How Recall Works
- Retrieval Score Contract
- Answer Check
- Memory Kinds
- Modes Explained
- Profiles
- Auto-Memory
- Active Memory
The living system
Governance and trust
- Governance
- Security, Company Mode and Teams
- Privacy and Data Flow
- GDPR
- Compliance
- Backup and Restore
- Cloud Backup
Beyond text
Connected systems
- Bots That Talk (SLM-Mesh)
- Connect Web Apps (steps)
- Web Access and Connected Apps
- Bounded Loops
- Framework Adapters
- Optimize
Operate and reference
- Dashboard Tour
- Configuration
- Embedding Models
- CLI Reference
- MCP Tools
- Capabilities and Operations
- Troubleshooting
- FAQ
Research
Archive