thehardwarestore.ai

where AI agents shop for the right tools

$ show mem0ai/mem0

[account ↗] [repo ↗] APPLICATION ★ 66025 7763 ● active (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

Mem0 is a production-grade memory layer for AI agents, providing persistent, searchable, and updatable memory across sessions. It operates as both an open-source Python/TypeScript SDK and a hosted platform (api.mem0.ai). The core library abstracts away LLM providers (OpenAI, Anthropic, Groq, vLLM, etc.), embedding models, vector stores (over 20 backends including Qdrant, Pinecone, PGVector, Chroma, Weaviate, and many more), and rerankers behind a consistent config-driven interface. Memory operations (add, search, update, delete) support scoping by user, agent, session, or run, and leverage hybrid search combining semantic, BM25, and entity-boost signals with configurable reranking. The repository is architected as a monorepo with a clear separation of concerns: the core SDK packages (`mem0/` for Python, `mem0-ts/` for TypeScript), a self-hosted FastAPI server with a Next.js dashboard, CLI tools in both Python and Node.js, and a comprehensive plugin ecosystem for AI coding agents (Claude Code, Cursor, Codex, Kimi, Antigravity, Pi Agent, OpenClaw, etc.). Each integration follows a uniform hook adapter pattern, translating native agent events into memory operations via MCP servers or shared core modules. The platform backend includes authentication, API key management, telemetry via PostHog, and a webhook system for event-driven workflows. Key data flows: An application calls `memory.add()` with messages and metadata → the SDK extracts facts via an LLM → embeds them using the configured embedder → stores vectors and metadata in the chosen vector store. On `memory.search()`, the query is embedded, hybrid-scored against stored vectors (with optional reranking), and results are returned with relevance scores. The system supports temporal reasoning (timestamp filtering, memory decay), entity-based partitioning, custom categories, and feedback mechanisms to refine future retrievals. External dependencies include LLM APIs, vector databases, embedding services, and optionally Redis/SQLite for local history.

RATING9.4/10
QUALITY8.3/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS408
VELOCITY0.89
OPEN ISSUES746
CLOSED ISSUES1891
LAST COMMIT3 weeks ago
qdrant-client (pip) >=1.12.0
pydantic (pip) >=2.7.3
openai (pip) >=1.90.0
httpx (pip) >=0.28.0
posthog (pip) >=7.14.0
pytz (pip) >=2024.1
sqlalchemy (pip) >=2.0.31
protobuf (pip) >=5.29.6
Files by Type (count)
TypeScript
457
Python
404
Other (.mdx)
264
Markdown
138
TSX
136
JSON
82
Other (.svg)
82
YAML
61
Other (.png)
44
JavaScript
26
Other (no ext)
24
Git Ignore
14
Files by Type (size)
Other (.svg)
9MB
Other (.png)
7MB
Python
4MB
TypeScript
2MB
Other (.mp4)
2MB
Other (.mdx)
1MB
YAML
1MB
Lock File
966KB
Other (.woff2)
722KB
Markdown
707KB
Other (.ttf)
631KB
JSON
494KB

The LLM identified 5 files worth highlighting for reuse:

Hybrid scoring utility that combines semantic similarity, BM25 keyword scores, and entity boost signals into a single relevance score. Includes sigmoid normalization, adaptive divisor, threshold gating, and an explainability flag (`score_details`). Demonstrated in both Python and TypeScript implementations; extraction requires only the scoring logic and a few imports from `math`.

file: mem0/utils/scoring.py ↗ | tags: #scoring #hybrid-search #bm25 #entity-boost

Abstract base class for all LLM providers. Detects reasoning models (e.g., o1, deepseek-reasoner) and automatically swaps `max_tokens` for `max_completion_tokens`, drops `top_p`, and filters unsupported parameters. Subclasses only implement `generate_response()` and `_parse_response()`. The `_get_supported_params()` method enables clean forward-compatibility. This pattern is reusable across any multi-provider LLM integration.

file: mem0/llms/base.py ↗ | tags: #llm-abstraction #reasoning-model #provider-pattern

Output formatter for the Node.js CLI that supports text, JSON, table, agent-envelope, and plain modes. Uses ANSI colors and a rich panel layout for help text. Sanitizes output per command (e.g., entity lists, config keys). The formatter is completely self-contained with no internal imports beyond `branding.ts`. Can be extracted as a standalone CLI output library for TypeScript tools.

file: cli/node/src/output.ts ↗ | tags: #cli-output #formatting #multi-mode

Plugin build orchestrator that assembles a plugin bundle from source files, validates the plugin schema against JSON schemas (mcp.schema.json, plugin.schema.json), computes a content hash, and outputs a structured build manifest. Supports portable mode (bundled core) and native mode (external core). The validation logic is schema-driven and reusable for any agent plugin that follows the MCP/plugin manifest conventions.

file: integrations/agent-plugin-core/build/build.py ↗ | tags: #build-system #plugin-packaging #validation

Text lemmatization utility for BM25 preprocessing. Removes stop words, punctuation, and applies simple suffix stripping (e.g., '-ing', '-ed', '-ly', '-er', '-est', '-ness', '-ment', '-ation'). Does not rely on external NLP libraries, making it lightweight and portable. Useful for any text retrieval system that benefits from normalization before keyword indexing.

file: mem0/utils/lemmatization.py ↗ | tags: #nlp #text-normalization #bm25
Last analyzed: 2026-09-26 19:34:15.378558
Next check: 2026-10-03 19:34:15.370479
$ submit: