How to install and set up LLMem. Back to README
The Go binary provides the full CLI, dream cycle, and extraction.
git clone https://github.com/MichielDean/LLMem.git
cd LLMem
make build
make install # copies binary to ~/.local/bin/llmemOr install the CLI manually:
go build -o ~/.local/bin/llmem ./cmd/llmemllmem init # interactive — detects providers
llmem init --non-interactive # use defaults, no promptsAfter building the CLI, install the agent integration layer:
cd LLMem && npm installThis runs the postinstall script which:
- Copies all skill directories to
~/.agents/skills/ - Auto-detects your agent platform (OpenCode, Claude Code, or Copilot CLI)
- Deploys the correct plugin to the right location
Force a specific platform:
node install.js --platform opencode # OpenCode only
node install.js --platform claude-code # Claude Code / Copilot CLI only
node install.js --platform both # OpenCode + Claude Code / Copilot CLI
node install.js --platform none # Skills only, no pluginsOpenCode: The plugin is auto-deployed to ~/.config/opencode/plugins/llmem.js. Optionally add to your opencode.json:
{ "plugin": ["llmem"] }Claude Code / Copilot CLI: The plugin is auto-deployed to ~/.claude/plugins/llmem/. Enable it:
claude plugin install ~/.claude/plugins/llmem
# Or test without installing:
claude --plugin-dir ~/.claude/plugins/llmem| Goal | What to install |
|---|---|
Use the llmem CLI only |
make build && make install |
| Use LLMem with OpenCode | CLI + npm install (deploys skills + OpenCode plugin) |
| Use LLMem with Claude Code / Copilot CLI | CLI + npm install (deploys skills + agent plugin) |
| Just the skill files (no CLI, no plugin) | Copy skills/ to ~/.agents/skills/ manually |
- Go 1.26.1+ (for building the CLI)
- Node.js 20+ (for plugin installation only)
- Ollama running locally for extraction, embedding, and dreaming — or set
OPENAI_API_KEY/ANTHROPIC_API_KEYfor cloud providers — or use FTS5-only mode without any provider
The Python package is still available but the Go binary is recommended for CLI use. The Python package provides the same CLI plus a Python library for programmatic access.
git clone https://github.com/MichielDean/LLMem.git
cd LLMem
pip install .With optional extras:
# Vector similarity search (sqlite-vec)
pip install ".[vec]"
# Local embedding without any server (sentence-transformers)
pip install ".[local]"
# Both + dev dependencies
pip install ".[vec,local,dev]"Initialize and verify:
llmem init
llmem statsUse LLMem as a Go library in your own projects:
go get github.com/MichielDean/LLMemimport (
"github.com/MichielDean/LLMem/internal/store"
"github.com/MichielDean/LLMem/internal/embed"
"github.com/MichielDean/LLMem/internal/retriever"
"github.com/MichielDean/LLMem/internal/metrics"
"github.com/MichielDean/LLMem/internal/urlvalidate"
)
ms, err := store.NewMemoryStore(store.StoreConfig{
DBPath: "", // defaults to ~/.config/llmem/memory.db
VecDimensions: 0, // defaults to 768
DisableVec: false, // set true to skip vec0 virtual table
RegisteredTypes: nil, // defaults to 7 standard types
})
if err != nil {
log.Fatal(err)
}
defer ms.Close()
// Embedding engine (Ollama client with LRU cache)
eng, err := embed.NewEmbeddingEngine(embed.EmbeddingConfig{})
// Hybrid search retriever (FTS5 + semantic with RRF fusion)
r, err := retriever.NewRetriever(retriever.RetrieverConfig{Store: ms, Embedder: eng})
// Embedding quality metrics
m, err := metrics.ComputeMetrics(embeddings, labels, 0)
// SSRF-protected URL validation
safe := urlvalidate.IsSafeURL(urlStr, false)make test
# or
go test ./...| Feature | Python | Go |
|---|---|---|
| SQLite driver | Built-in sqlite3 |
modernc.org/sqlite (pure Go, no CGo) |
| Vector search | sqlite-vec Python package |
vec0 virtual table (pure Go via modernc) |
| Migrations | Manual numbered SQL files | pressly/goose with embedded SQL files |
| CLI | Full-featured (24 commands) | Core commands (17 commands) |
| Embeddings/Providers | Ollama, OpenAI, Anthropic, local | Ollama (/api/generate and /api/embeddings) |
| Reranking | RRF + multi-signal | FTS5-only (hybrid coming) |
| Session hooks | Full lifecycle | Full lifecycle (Go implementation) |
| Dream cycle | Full (light, deep, REM) | Full (light, deep, REM) |
The Go MemoryStore shares the exact same database schema as Python. You can use them interchangeably — a database created by Python is readable by Go, and vice versa.