mem0-lite
mem0-lite
코딩 에이전트를 위한 자체 호스팅 메모리 (MCP 기반). Docker 불필요. Mem0 플랫폼 불필요. REST 데몬 불필요.
MCP는 mem0ai Memory()를 래핑하며, 벡터는 ~/.mem0/qdrant에 디스크에 저장됩니다. 도구 호출은 프로세스 내에서 이루어집니다. 사이드카는 Qdrant를 열린 상태로 유지합니다. 동일한 디렉터리에서 두 번째 MCP가 실행되면 lite.lock / lite.want를 통해 조정되며, 추가 데몬은 필요하지 않습니다.
왜 필요한가
공식 Mem0은 로컬 MCP 설정에 적합하지 않은 세 가지 옵션을 제공합니다:
공식 경로 | 여기서의 문제점 |
플랫폼 MCP ( | 메모리가 기계를 떠나며 비용이 발생합니다. |
OSS REST 서버 | Docker + Postgres; 무겁고 유지보수가 어려우며, 비Linux 기계에서 배터리를 소모합니다. |
| 클라이언트 전용, 서버 미포함 |
mem0-lite는 OSS mem0 라이브러리를 MCP 서비스로 노출하는 경량 로컬 Python 앱입니다.
Related MCP server: int
제공 기능
MCP 도구 —
add_memory,search_memories,get_memory_by_id,list_memories,update_memory,delete_memory,delete_all_memories(호출 방법은 도구 문서 참조)로컬 저장소 — 디스크 기반 Qdrant (
on_disk=True),/tmp아님, 동시성 조정 지원사용 시기 — 간결한 AGENTS.md 포인터
MCP 등록 — uv 실행 스니펫
저장하는 내용
벡터 DB, 히스토리, 설정, 접근 로그, lite.lock, lite.want가 ~/.mem0에 저장됩니다.
설치
uv, Python 3.11+, OPENAI_API_KEY (또는 Ollama — 아키텍처 참조) 필요.
이 저장소를 클론합니다.
MCP 서버를 호스트에 등록합니다 (아래 스니펫). 호스트 설정 또는 환경 변수에
OPENAI_API_KEY를 설정하세요. 커밋하지 마세요.AGENTS.md 포인터를 붙여넣습니다.
환경 변수
MCP는 프로세스 환경에서 다음 변수를 읽습니다. 시스템 환경에서 변수가 설정되어 있고 MCP가 샌드박스에서 실행 중이 아니라면, 호스트가 이를 전달하므로 env 블록에 중복하여 설정할 필요가 없습니다. 해당 env 블록의 값은 시스템 환경보다 우선합니다.
OPENAI_API_KEY— 필수 (Ollama 사용 시 제외, 아래 참조)MEM0_DIR— 데이터 디렉터리 (기본값~/.mem0)MEM0_LITE_USER_ID— 기본 사용자 범위 (기본값$USER)MEM0_LITE_AGENT_ID— 선택적 에이전트 범위MEM0_LITE_LOCK_TIMEOUT— 저장소 잠금 대기 시간 (초 단위, 기본값30)MEM0_LITE_LLM_PROVIDER— 예:ollama(기본값: mem0ai를 통한 OpenAI)MEM0_LITE_LLM_MODEL— LLM 모델 이름 (Ollama 사용 시 기본값llama3.2)MEM0_LITE_EMBEDDER_PROVIDER— 예:openai또는ollamaMEM0_LITE_EMBEDDER_MODEL— 임베더 모델 (Ollama 사용 시 기본값nomic-embed-text)
전체 기본값: 아키텍처. 옵트인 등급: 피드백 모드 (MEM0_LITE_FEEDBACK_MODE, 기본값 꺼짐).
MCP 등록
MCP 호스트의 설정에 병합하세요. Cursor: ~/.cursor/mcp.json 또는 프로젝트 .cursor/mcp.json. 디렉터리 경로를 바꾸세요.
{
"mcpServers": {
"mem0-lite": {
"command": "uv",
"args": ["run", "--directory", "/ABS/PATH/TO/mem0-lite", "mem0-lite", "mcp"],
"env": { "OPENAI_API_KEY": "sk-..." }
}
}
}AGENTS.md
AGENTS.md (또는 사용자 규칙)에 붙여넣으세요. 도구 호출 방법은 MCP 스키마에 있습니다. 이것은 언제 사용할지에 대한 내용입니다.
## Memory
MCP `mem0-lite` is registered. Search at task start, context switch, or when the user references past work. After the reply, write only if a new agent would benefit in days/weeks (future utility, novelty, factual, no secrets). Do not announce recall. Prefer `update_memory`. Most turns write nothing.메트릭
모든 도구 호출은 ~/.mem0/access-log.jsonl에 한 줄을 추가합니다 (도구, 에이전트, 연결 재사용, 잠금 대기, 지속 시간). 요약:
uv run python scripts/access-report.py피드백 모드
메모리 저장소의 효과를 추적합니다.
켜져 있으면 도구 응답에 ts 필드가 포함되며, 이를 사용하여 rate_memory_call 도구로 응답을 평가할 수 있습니다.
켜져 있을 때 (MEM0_LITE_FEEDBACK_MODE=1):
검색 응답에
ts포함에이전트는 유용한 적중, 누락, 노이즈 후에
rate_memory_call(call_ts, helpful, reason)을 호출할 수 있음평가는
~/.mem0/feedback.jsonl에 추가됨scripts/access-report.py는 평가를 접근 로그ts와 결합하여 적용 범위, 유용률, 피드백 지연 시간(ts − call_ts)을 보고함
MCP 호스트 env 블록에서 활성화하세요 (기본 등록 스니펫에 넣지 마세요):
"env": {
"OPENAI_API_KEY": "sk-...",
"MEM0_LITE_FEEDBACK_MODE": "1"
}활성화한 경우, AGENTS.md에 추가하세요.
After a retrieval call, if you used a hit, clearly missed a fact, or got noise, call rate_memory_call with that response's ts.reason은 다음 중 하나입니다: used | empty_ok | miss | noise | stale | bad_query. 비어 있고 예상된 결과는 건너뛰세요.
문서
페이지 | 내용 |
프로세스 모델, 도구, 데이터 레이아웃 | |
플랫폼, Docker REST, SDK 인프로세스, 이 저장소 | |
파일, SQLite, 벡터 DB, 호스팅 메모리 | |
왜 MCP인가, 왜 | |
Git에 키 포함, |
이 저장소가 아닌 것
두 번째 Mem0 서버 구현
플랫폼 호환 HTTP API
mem0-cli의 대체그래프 메모리 (실제로는 플랫폼 전용)
이 저장소는 MIT 라이선스입니다. mem0ai는 Apache-2.0 라이선스를 유지합니다. 이 래퍼는 로컬에서 사용할 수 있습니다.
Available Tools
8 toolsadd_memoryA
Store a memory. Prefer infer=false with a self-contained third-person fact.
memory_type: decision | convention | anti_pattern | user_preference | task_learning | environmental | identity | rule | project
infer=true lets mem0 extract facts from raw conversation; skip for explicit facts.
Never store secrets. Skip small talk, tool dumps, and one-shot commands.
Inputs: text (required), infer, user_id, agent_id, +2 more. Returns: result
delete_all_memoriesC
Delete all memories in scope. Requires confirm=true.
Inputs: confirm, user_id, agent_id. Returns: result
delete_memoryC
Delete one memory by id.
Inputs: memory_id (required). Returns: result
get_memory_by_idA
Fetch one memory by id. When MEM0_LITE_FEEDBACK_MODE is enabled, rate via rate_memory_call(call_ts).
Inputs: memory_id (required). Returns: result
list_memoriesC
List memories in scope. Not a substitute for search_memories. When MEM0_LITE_FEEDBACK_MODE is enabled, responses include ts; rate useful/miss/noise via rate_memory_call.
Inputs: top_k, user_id, agent_id, memory_type. Returns: result
rate_memory_callA
Rate a prior retrieval by call_ts (from response ts when MEM0_LITE_FEEDBACK_MODE is enabled).
Call when you used a hit, clearly missed a fact, or got irrelevant noise. Skip empty-and-expected results.
reason: used | empty_ok | miss | noise | stale | bad_query
Inputs: reason (required), call_ts (required), helpful (required), note. Returns: result
search_memoriesA
Semantic search. Rewrite the query to 3-6 keywords matching stored third-person facts.
Do not pass the user's raw message. Drop pronouns and question words.
When useful, run 2-4 parallel searches with memory_type: decision, convention, anti_pattern, or omit for catch-all.
When MEM0_LITE_FEEDBACK_MODE is enabled, responses include ts; rate useful/miss/noise via rate_memory_call.
Inputs: query (required), top_k, user_id, agent_id, +1 more. Returns: result
update_memoryA
Replace memory text in place. Prefer this over delete+add when a fact changed.
Inputs: text (required), memory_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: add, update, search, get by ID, list, delete single, delete all, and rate. Potential confusion between search_memories and list_memories is addressed in descriptions, ensuring no ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., update_memory, search_memories, delete_all_memories). The naming is predictable and uniform across the set.
With 8 tools, the server is well-scoped for a memory management system. The count covers essential operations without being excessive or insufficient.
The tool surface provides complete coverage for memory CRUD (add, get, update, delete) plus search, listing, bulk deletion, and a feedback rating mechanism. No obvious gaps for the declared purpose.
Maintenance
Related MCP Connectors
Hosted MCP memory for coding agents: persistent across sessions, editable markdown, team sharing.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides persistent memory for AI coding agents via MCP, enabling agents to store and semantically recall facts, events, and lessons across sessions, all running locally without cloud dependencies.Apache 2.0
- FlicenseNot gradedqualityCmaintenanceSelf-hosted AI memory system for coding assistants, providing project-scoped memory storage and retrieval via MCP tools (add, search, list, delete) to recall prior learnings without re-running discovery.1-
- AlicenseNot gradedqualityBmaintenanceProvides persistent memory for AI coding agents, enabling them to save, search (hybrid vector/BM25/concept graph), list sessions, and forget memories via MCP tools.11 npmApache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to store, search, and recall persistent project and cross-project memories locally over MCP, keeping architectural decisions, conventions, and error patterns available across sessions. Also optionally exposes a task server for autonomous task execution driven by that same memory store.-