Quickstart
Five minutes from pip install to your first working memory layer. No API keys required if you use the local defaults.
1. Install
That pulls the core library plus FAISS for the vector index. The base install ships without FAISS since v1.4.1, so you need the extra (the quotes keep zsh from expanding the brackets). For local embeddings (no API key needed), add the sentence-transformers extra:
For the Claude Code MCP server and skill integration:
2. First add and search
Six lines. One import. No YAML, no setup wizard, no cloud account.
WideMemory() boots the default pipeline: GPT-4o-mini for fact extraction and conflict resolution, text-embedding-3-small for embeddings, FAISS for the vector index, SQLite for metadata and history. Override any of these via MemoryConfig.
The defaults use OpenAI. If you want to run fully local with zero API keys, configure the Ollama provider for the LLM and sentence-transformers for embeddings. See Configuration.
3. Conflict resolution is automatic
Add a contradicting fact and the resolver handles it in a single LLM call. No manual dedup logic, no stale entries.
4. Pin what must not be forgotten
For facts that should never decay (allergies, API keys, critical safety constraints), use pin():
Pinned memories start at high importance and resist the decay function. See the YMYL section for the automatic classification that also pins health, financial, and legal facts.
5. Confidence-aware retrieval
Every search() call returns a confidence level so your agent knows whether it has an answer or is guessing.
Four levels: high, moderate, low, none. Set uncertainty_mode on MemoryConfig to control how the system behaves when confidence is low: strict (refuse), helpful (hedge with context), or creative (offer to guess).
6. Context manager for cleanup
Use a with block to guarantee SQLite connections close cleanly. Matters in long-running services and tests.
Next
Configure providers, retrieval modes, and the scoring function: /docs/configuration.
Deploy to production: /docs/self-hosting.
See how widemem scores against Mem0, Zep, and LangMem on the LoCoMo benchmark: /benchmarks.