Skip to main content

LlamaIndex Chat Store — SuperLocalMemory V2

A LlamaIndex BaseChatStore implementation backed by SuperLocalMemory V2. All chat history stays 100% local on your machine — zero cloud calls, zero telemetry, zero API keys.

Prerequisites

  • Python 3.9+
  • SuperLocalMemory V2 installed (~/.claude-memory/ must exist)
# Install SuperLocalMemory V2 (one-time)
curl -fsSL https://raw.githubusercontent.com/varun369/SuperLocalMemoryV2/main/install.sh | bash

Installation

pip install llama-index-storage-chat-store-superlocalmemory

Quick Start

from llama_index.core.memory import ChatMemoryBuffer
from llama_index.core.base.llms.types import ChatMessage, MessageRole
from llama_index.storage.chat_store.superlocalmemory import SuperLocalMemoryChatStore

# Create the chat store (uses default SLM database)
chat_store = SuperLocalMemoryChatStore()

# Use with ChatMemoryBuffer for automatic conversation management
memory = ChatMemoryBuffer.from_defaults(
    chat_store=chat_store,
    chat_store_key="user-123",
    token_limit=3000,
)

# Or use directly for manual message management
chat_store.add_message("session-1", ChatMessage(role=MessageRole.USER, content="Hello!"))
chat_store.add_message("session-1", ChatMessage(role=MessageRole.ASSISTANT, content="Hi there!"))

messages = chat_store.get_messages("session-1")
print(messages)  # [ChatMessage(role=user, content="Hello!"), ChatMessage(role=assistant, content="Hi there!")]

# List all session keys
keys = chat_store.get_keys()

# Delete a session
chat_store.delete_messages("session-1")

Features

  • 100% Local — All data stored in SQLite at ~/.claude-memory/memory.db
  • Zero Cloud — No API keys, no subscriptions, no data leaves your machine
  • Shared Memory — Chat history is accessible from Claude, Cursor, Windsurf, and 16+ other AI tools via SuperLocalMemory
  • Session Isolation — Each chat key is cleanly isolated using SLM tags
  • Persistent — Survives process restarts (SQLite-backed, not in-memory)
  • Full BaseChatStore API — set_messages, get_messages, add_message, delete_messages, delete_message, delete_last_message, get_keys
  • Async Support — Async methods inherited from BaseChatStore (delegates to sync via asyncio.to_thread)

How It Works

Each chat message is stored as a separate memory entry in SuperLocalMemory V2:

  • Content: JSON-serialized {role, content, additional_kwargs}
  • Tag: llamaindex:chat:<session_key> for session isolation
  • Project: llamaindex for easy identification
  • Importance: 3 (low, since chat messages are transient)

Custom Database Path

# Use a custom database file
chat_store = SuperLocalMemoryChatStore(db_path="/path/to/custom/memory.db")

Links

Metadata

Release files for llama-index-storage-chat-store-superlocalmemory 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-storage-chat-store-superlocalmemory 0.1.0
File Size Uploaded
llama_index_storage_chat_store_superlocalmemory-0.1.0.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-storage-chat-store-superlocalmemory 0.1.0
File Interpreter ABI Platform
llama_index_storage_chat_store_superlocalmemory-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / llama_index_storage_chat_store_superlocalmemory-0.1.0.tar.gz

Download URL llama_index_storage_chat_store_superlocalmemory-0.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
16042a58c4714f95486ba5fba63818e94f6b5b8ebb009c90020b5cef83166b4a
BLAKE2b-256 checksum
How to use checksums
e1878fe1feea2ea9561aa2125aa8d6783b66fd7d39b514111c7a470e30aed193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / llama_index_storage_chat_store_superlocalmemory-0.1.0-py3-none-any.whl

Download URL llama_index_storage_chat_store_superlocalmemory-0.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d321ea5dc5059d550ae7dbc70ce07a9c098c35ec0b6bac5b2874cf958cfe1d91
BLAKE2b-256 checksum
How to use checksums
e5c4133a0d4bb0621bf21b0c96283cee1af6e349d2ea5eb4ae9a5b20f3662c36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page