Persistent semantic memory for Claude Code sessions using LibSQL with vector search.
# Clone the repo
git clone https://github.com/linehaul-ai/libsql-memory.git
cd libsql-memory
# Run Claude Code with the plugin
claude --plugin-dir .That's it! The plugin will automatically:
- Start the MCP server with memory tools
- Load automation hooks for context retrieval
- Enable
/memory-statusand/memory-clearcommands
Nomic embedding server (text-embedding-qwen3-embedding-8b) running at http://192.168.128.10:1234 (default)
Or use local embeddings (no external dependencies):
export LIBSQL_MEMORY_EMBEDDING_PROVIDER=local
claude --plugin-dir /path/to/libsql-memoryOr use OpenAI:
export LIBSQL_MEMORY_EMBEDDING_PROVIDER=openai
export OPENAI_API_KEY=your-key
claude --plugin-dir /path/to/libsql-memoryCopy to your project as a local plugin:
# Copy entire plugin directory
cp -r /path/to/libsql-memory /your/project/libsql-memory
# Then run Claude with the plugin directory
cd /your/project && claude --plugin-dir ./libsql-memoryOr install globally:
claude plugins add https://github.com/linehaul-ai/libsql-memory.gitProvides memory tools:
memory_store- Store a memory with content and namespacememory_retrieve- Get a specific memory by IDmemory_search- Semantic search across memoriesmemory_list- List memories in a namespacememory_delete- Delete a memorymemory_stats- Get storage statistics
| Hook | Purpose |
|---|---|
| SessionStart | Loads project context and preferences at session start |
| UserPromptSubmit | Searches memory for context relevant to user queries |
| PreToolUse (Write/Edit) | Retrieves file-specific patterns before code changes |
| PostToolUse (Write/Edit) | Stores architectural decisions and patterns after changes |
| Stop | Saves session summaries and important learnings |
/memory-status- View memory statistics and recent entries/memory-clear [namespace]- Clear memories from a namespace
- memory-usage - Best practices for when and how to use memory effectively
| Variable | Default | Description |
|---|---|---|
LIBSQL_MEMORY_EMBEDDING_PROVIDER |
nomic |
Embedding provider: nomic, openai, local |
LIBSQL_MEMORY_EMBEDDING_ENDPOINT |
http://192.168.128.10:1234/v1/embeddings |
Nomic server endpoint |
OPENAI_API_KEY |
- | Required if using OpenAI provider |
Stored at .claude/memory.db relative to where Claude Code runs.
Pre-built binaries are included for:
- macOS (Apple Silicon / arm64)
For other platforms, build from source:
cd src/plugin
make buildcd src/plugin
make build # Build for current platform
make test # Run tests
make verify # Run all checks- MCP server not starting: Check binary exists in
bin/directory - Embedding errors: Ensure Nomic server is running or switch to
localprovider - Database errors: Ensure
.claude/directory exists and is writable - Platform not supported: Build from source using
make build
MIT