Context7
Up-to-date docs for AI agents
제작자가 쓴 설명(영어 원문)
Persistent memory for AI agents — semantic + recency search, ONNX embeddings, Docker Compose.
이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.
이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
필요한 것
어떤 앱을 쓰세요?
위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.
Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요
{
"mcpServers": {
"memex": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/ayushagrawal288/memex:v0.1.0"
]
}
}
}터미널에서 이 명령어를 실행하세요
claude mcp add memex -- docker run -i --rm ghcr.io/ayushagrawal288/memex:v0.1.0프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요
{
"mcpServers": {
"memex": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/ayushagrawal288/memex:v0.1.0"
]
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
프로젝트의 .vscode/mcp.json에 붙여 넣으세요
{
"servers": {
"memex": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/ayushagrawal288/memex:v0.1.0"
]
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.
선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.
이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 7일 점검
레지스트리 이름이 GitHub 계정 ayushagrawal288 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(0.1.0)은 5개월 전 레지스트리에 올라왔어요.
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Docker도 있어야 해요.
같은 카테고리에는: Context7, Codebase Memory, Exa
같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.
카드 보는 법:★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
A production-grade persistent memory service for AI agents. Agents forget everything between sessions by default — memex fixes that. It stores, retrieves, and ranks conversation memory using semantic search with recency decay, so agents surface what's relevant *and* recent, not just what's semantically closest.
POST /v1/memories → store a memory, embed it, persist to Postgres
POST /v1/memories/search → retrieve top-k memories ranked by similarity + recency DELETE /v1/memories/{id} → forget a specific memory GET /v1/memories/count → how many memories does this agent/user have GET /health → liveness + DB connectivity check GET /metrics → Prometheus metrics
caller (agent / app)
│ ▼ FastAPI (async) │ ┌────┴────┐ │ │ embeddings asyncpg pool (min=5, max=20) (fastembed │ ONNX, ▼ local) PostgreSQL 16 pgvector extension ivfflat index (cosine)
Write path: content → fastembed ONNX inference (local, ~12 ms CPU, BAAI/bge-small-en-v1.5) → INSERT with 384-dim vector → return memory ID.
Read path: query → embed → pgvector cosine search (top_k × 3 candidates) → re-rank with recency decay in Python → return top_k results with scores.
Pure vector similarity returns the most semantically similar memories, not the most useful ones. A fact from 90 days ago that's a 0.95 similarity match is often less useful than a 0.80 match from yesterday.
Score formula:
score = α × cosine_similarity + (1 − α) × exp(−λ × age_days)
Where λ = ln(2) / half_life_days (default: 30 days, so a 30-day-old memory has 50% recency weight).
α is configurable per request (default 0.7). Task-focused agents use higher α (semantic dominates). Conversational agents use lower α (recency matters more).
The pgvector query returns top_k × 3 candidates sorted by pure similarity. Python re-ranks with the decay formula and slices to top_k. This prevents recency decay from starving high-similarity older memories — they're still in the candidate pool.
At 10× scale (>1M memories per agent): push the scoring into a Postgres function using pg_proc to eliminate the Python re-ranking round-trip.
SQLAlchemy adds ORM overhead on every query. The hot retrieval path — embed, query, re-rank — needs to be tight. asyncpg gives direct control over pool min/max (same instinct as tuning HikariCP in Java). pgvector queries require raw SQL for the <=> operator anyway.
Pool defaults: min=5, max=20. Right-size for a single-instance deployment. Override via DB_MAX_POOL_SIZE env var.
Sliding window counter via upsert. One fewer dependency. Correct under concurrent requests (transactional upsert). At 10× scale with distributed deployments: replace with Redis INCR + EXPIRE — atomic operations, no lock contention.
ivfflat has lower build cost and lower memory footprint — the right tradeoff at small-to-medium scale (<1M vectors). lists=100 works well up to ~1M rows. At 10× scale: switch to HNSW (m=16, ef_construction=64) for better recall at the cost of higher memory and build time.
Prerequisites: Docker and Docker Compose. No API keys required — the entire stack runs locally.
git clone https://github.com/ayushagrawal288/memex
cd memex docker compose up
The API is live at http://localhost:8000. Interactive docs at http://localhost:8000/docs.
curl -X POST http://localhost:8000/v1/memories \
-H "Content-Type: application/json" \ -d '{ "agent_id": "my-agent", "user_id": "user-123", "content": "User prefers concise responses and dislikes verbose explanations.", "memory_type": "semantic", "importance": 1.2 }'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "agent_id": "my-agent", "user_id": "user-123", "content": "User prefers concise responses and dislikes verbose explanations.", "importance": 1.2, "memory_type": "semantic", "created_at": "2026-05-26T10:30:00Z", "score": null }
curl -X POST http://localhost:8000/v1/memories/search \
-H "Content-Type: application/json" \ -d '{ "agent_id": "my-agent", "user_id": "user-123", "query": "how does this user like to communicate", "top_k": 5, "alpha": 0.7 }'
{
"results": [ { "id": "3fa85f64-...", "content": "User prefers concise responses and dislikes verbose explanations.", "memory_type": "semantic", "created_at": "2026-05-26T10:30:00Z", "score": 0.8921 } ], "query": "how does this user like to communicate", "total": 1 }
| Type | Use for |
|---|---|
episodic | Specific events, past conversations |
semantic | Facts, preferences, general knowledge |
procedural | Workflows, how-to instructions |
Run on a MacBook M-series, Docker Desktop, single Postgres instance:
locust -f scripts/load_test.py --host=http://localhost:8000 \
--headless -u 50 -r 10 -t 60s
Realistic load (50 users, 100–300 ms think time — models actual agent traffic):
| Endpoint | RPS | p50 (ms) | p95 (ms) | p99 (ms) | Error rate |
|---|---|---|---|---|---|
| POST /v1/memories (write) | 27 | 160 | 270 | 330 | 0% |
| POST /v1/memories/search | 83 | 110 | 200 | 250 | 0% |
| Aggregated | 113 | 120 | 230 | 300 | 0% |
Saturation test (500 users, minimal think time — finds the throughput ceiling):
| Endpoint | RPS (plateau) | p50 (ms) | p99 (ms) | Error rate |
|---|---|---|---|---|
| POST /v1/memories (write) | 28 | 3,900 | 6,100 | 0% |
| POST /v1/memories/search | 91 | 3,600 | 5,800 | 0% |
| Aggregated | ~120 | 3,700 | 5,900 | 0% |
Run on MacBook M-series, Docker Desktop (4 CPUs), 4 uvicorn workers, 16 threads/worker.
Embeddings: local ONNX (
BAAI/bge-small-en-v1.5) — zero external API calls, zero cost.
Why the ceiling is ~120 RPS: Every write and every search requires one ONNX inference (~10–15 ms on CPU). With 4 Docker CPUs: 4 cores / 12 ms ≈ 333 embeddings/s theoretical max. After Python overhead, DB queries, and asyncio scheduling: ~120 RPS actual.
Path to higher throughput:
| Approach | Expected gain | Complexity |
|---|---|---|
| Embedding cache (Redis, key = SHA256 of text) | 2–3× (40–60% hit rate on repeated agent queries) | Low |
| Horizontal scaling (N replicas behind a load balancer) | N× linear | Medium |
| GPU inference (swap ONNX runtime → CUDA) | 10–50× | Medium |
| Voyage-3 API (offload to Anthropic's inference fleet) | Scales to thousands of RPS, limited by API quota | Low code change |
memex/
├── app/ │ ├── main.py # REST API — FastAPI, lifespan, router registration │ ├── mcp_server.py # MCP server — single-worker FastAPI on port 8001 │ ├── core/ │ │ └── config.py # All settings, loaded from env │ ├── db/ │ │ └── pool.py # asyncpg pool, migrations │ ├── models/ │ │ └── schemas.py # Pydantic request/response models │ ├── services/ │ │ ├── embeddings.py # fastembed ONNX inference (local, zero API calls) │ │ ├── local_summarizer.py # Extractive summariser — Jaccard dedup + TF scoring │ │ ├── memory.py # Core write/search/scoring logic │ │ ├── metrics.py # Prometheus metric definitions │ │ ├── summarizer.py # Background summarisation job │ │ └── rate_limit.py # Sliding window rate limiter │ └── api/routes/ │ ├── memories.py # Memory endpoints │ ├── health.py # Health + readiness │ └── mcp_tools.py # MCP tool definitions (store, search, delete, count) ├── scripts/ │ └── load_test.py # Locust load test ├── docker-compose.yml ├── Dockerfile └── requirements.txt
docker compose up starts Prometheus and Grafana alongside the API:
| Service | URL | Credentials |
|---|---|---|
| REST API docs | http://localhost:8000/docs | — |
| MCP server | http://localhost:8001/mcp/ | — |
| Prometheus | http://localhost:9090 | — |
| Grafana | http://localhost:3000 | admin / admin |
The Grafana dashboard is provisioned automatically. Panels:
prometheus-fastapi-instrumentatorembed / embed_batch)Custom metrics are in app/services/metrics.py and exposed on /metrics alongside the standard FastAPI instrumentator metrics.
memex exposes itself as an MCP server so any MCP-aware agent (Claude Desktop, Claude Code, custom agents) can store and retrieve memories without custom HTTP integration.
Transport: Streamable HTTP (MCP 2024-11-05 spec). Single-worker process on port 8001 — session state is in-process, so a separate service avoids sticky-session complexity while keeping the REST API's multi-worker throughput.
Tools:
| Tool | Description |
|---|---|
store_memory | Embed + persist a memory (type, importance configurable) |
search_memories | Semantic + recency ranked retrieval with configurable alpha |
delete_memory | Forget a specific memory by UUID |
count_memories | How many memories an agent/user pair has |
Add to ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": { "memex": { "type": "streamable-http", "url": "http://localhost:8001/mcp/" } } }
claude mcp add --transport http memex http://localhost:8001/mcp/
The MCP Streamable HTTP transport is session-stateful — initialize, tools/list, and tools/call must all reach the same server process. The REST API runs 4 uvicorn workers with round-robin routing; routing different MCP requests to different workers breaks session state.
Running a dedicated single-worker MCP service on port 8001 avoids sticky-session infrastructure (nginx ip_hash, Redis session store) while keeping the REST API fully multi-worker.
Runs as a background asyncio task on a configurable interval (default: every 5 minutes). Finds any (agent_id, user_id) pair where episodic memory count exceeds a threshold, condenses the oldest batch into a single semantic memory, then deletes the originals. Fully local — no LLM API calls.
**How it summari
앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요