{
  "markdown": "# ZeroDB Agent Memory MCP Server\n\n**Persistent Memory for AI Agents**\n\nOptimized MCP server providing 14 tools for agent memory management, context synthesis, auto-context middleware, and write-back actions to external services.\n\n## Why This MCP?\n\n**Before:** Monolithic server with 77 tools consuming 10,400+ tokens\n**After:** Focused server with 14 tools consuming ~1,400 tokens\n**Result:** **87% reduction** in context footprint, faster agent decisions, better accuracy\n\n## Key Features\n\n### Smart Context Management\n- **Automatic token limiting** - Never exceed LLM context windows\n- **Intelligent pruning** - Keep important and recent memories\n- **Memory decay** - Old memories naturally fade over time\n- **Importance scoring** - Automatically rank memory significance\n\n### Semantic Memory\n- **Vector embeddings** - BAAI BGE models (384, 768, 1024 dimensions)\n- **Semantic search** - Find by meaning, not just keywords\n- **Cross-session memory** - Remember across conversations\n- **Auto-embedding** - No manual embedding required\n\n### Universal Compatibility\n- **ZeroLocal** - localhost:8000 (fast, free, private)\n- **ZeroDB Cloud** - api.ainative.studio (scalable, managed)\n- **Auto-detection** - Automatically finds available endpoint\n\n## Installation\n\n```bash\n# Clone repository\ngit clone https://github.com/ainative/zerodb-memory-mcp.git\ncd zerodb-memory-mcp\n\n# Install dependencies\nnpm install\n\n# Configure environment\ncp .env.example .env\n# Edit .env with your credentials\n\n# Test locally\nnpm start\n```\n\n## Configuration\n\n### Credentials\n\n```bash\n# Recommended: API key auth (no login needed)\nZERODB_API_KEY=sk_xxx\nZERODB_API_URL=https://api.ainative.studio\nZERODB_PROJECT_ID=your-project-id\n\n# OR username/password auth:\nZERODB_USERNAME=your@email.com\nZERODB_PASSWORD=your-password\nZERODB_API_URL=https://api.ainative.studio\nZERODB_PROJECT_ID=your-project-id\n```\n\n> **Tip:** API key authentication (`ZERODB_API_KEY`) is preferred over username/password. It avoids token expiry issues and is not affected by shell environment variable conflicts.\n\n### Option 1: Environment Variables\n\n```bash\nexport ZERODB_API_URL=\"http://localhost:8000\"  # or cloud URL\nexport ZERODB_API_KEY=\"sk_your-api-key\"        # recommended\nexport ZERODB_PROJECT_ID=\"your-project-id\"\n```\n\n### Option 2: Claude Desktop Config\n\n```json\n{\n  \"mcpServers\": {\n    \"zerodb-memory\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/zerodb-memory-mcp/index.js\"],\n      \"env\": {\n        \"ZERODB_API_URL\": \"http://localhost:8000\",\n        \"ZERODB_USERNAME\": \"your-username\",\n        \"ZERODB_PASSWORD\": \"your-password\",\n        \"ZERODB_PROJECT_ID\": \"your-project-id\"\n      }\n    }\n  }\n}\n```\n\n### Option 3: Use Both Local and Cloud\n\n```json\n{\n  \"mcpServers\": {\n    \"zerodb-local\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/zerodb-memory-mcp/index.js\"],\n      \"env\": {\n        \"ZERODB_API_URL\": \"http://localhost:8000\",\n        \"ZERODB_USERNAME\": \"your-local-username\",\n        \"ZERODB_PASSWORD\": \"your-local-password\",\n        \"ZERODB_PROJECT_ID\": \"your-local-project-id\"\n      }\n    },\n    \"zerodb-cloud\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/zerodb-memory-mcp/index.js\"],\n      \"env\": {\n        \"ZERODB_API_URL\": \"https://api.ainative.studio\",\n        \"ZERODB_USERNAME\": \"your-cloud-username\",\n        \"ZERODB_PASSWORD\": \"your-cloud-password\",\n        \"ZERODB_PROJECT_ID\": \"your-cloud-project-id\"\n      }\n    }\n  }\n}\n```\n\n## Tools\n\n### 1. `zerodb_store_memory`\n\nStore conversation context with automatic importance scoring and embedding.\n\n**Input:**\n```json\n{\n  \"content\": \"User prefers technical explanations over simplified ones\",\n  \"role\": \"system\",\n  \"session_id\": \"chat-123\",\n  \"tags\": [\"preference\", \"important\"],\n  \"user_id\": \"user-456\"\n}\n```\n\n**Output:**\n```json\n{\n  \"success\": true,\n  \"memory_id\": \"mem_abc123\",\n  \"importance\": 0.85,\n  \"message\": \"Memory stored successfully\"\n}\n```\n\n**Features:**\n- Auto-calculates importance (0.0 to 1.0)\n- Generates embeddings automatically\n- Supports tags for categorization\n- Links to user for cross-session memory\n\n---\n\n### 2. `zerodb_search_memory`\n\nSearch memory semantically using natural language.\n\n**Input:**\n```json\n{\n  \"query\": \"What are the user's dietary restrictions?\",\n  \"limit\": 10,\n  \"session_id\": \"chat-123\",\n  \"scope\": \"agent\",\n  \"min_importance\": 0.5\n}\n```\n\n**Output:**\n```json\n{\n  \"results\": [\n    {\n      \"content\": \"User is allergic to peanuts\",\n      \"role\": \"user\",\n      \"importance\": 0.95,\n      \"timestamp\": \"2026-02-28T10:30:00Z\",\n      \"tags\": [\"health\", \"critical\"],\n      \"similarity\": 0.89,\n      \"session_id\": \"chat-123\"\n    }\n  ],\n  \"count\": 1,\n  \"scope\": \"agent\"\n}\n```\n\n**Features:**\n- Semantic search (meaning, not keywords)\n- Cross-session search with `scope: \"agent\"`\n- Filter by importance, tags, user\n- Returns similarity scores\n\n---\n\n### 3. `zerodb_get_context`\n\nGet full conversation context with smart pruning.\n\n**Input:**\n```json\n{\n  \"session_id\": \"chat-123\",\n  \"max_tokens\": 8192,\n  \"include_stats\": true\n}\n```\n\n**Output:**\n```json\n{\n  \"memories\": [\n    {\n      \"content\": \"Hello, how can I help?\",\n      \"role\": \"assistant\",\n      \"importance\": 0.6,\n      \"timestamp\": \"2026-02-28T10:00:00Z\",\n      \"tags\": []\n    }\n  ],\n  \"total_tokens\": 2048,\n  \"stats\": {\n    \"pruned\": true,\n    \"original_count\": 50,\n    \"returned_count\": 25,\n    \"token_limit\": 8192\n  }\n}\n```\n\n**Features:**\n- Auto-prunes to fit token limit\n- Keeps important and recent memories\n- Applies memory decay if enabled\n- Returns pruning statistics\n\n---\n\n### 4. `zerodb_embed_text`\n\nGenerate vector embeddings for text.\n\n**Input:**\n```json\n{\n  \"text\": \"The quick brown fox jumps over the lazy dog\",\n  \"model\": \"BAAI/bge-small-en-v1.5\",\n  \"normalize\": true\n}\n```\n\n**Output:**\n```json\n{\n  \"embedding\": [0.123, -0.456, 0.789, ...],\n  \"model\": \"BAAI/bge-small-en-v1.5\",\n  \"dimensions\": 384,\n  \"normalized\": true\n}\n```\n\n**Features:**\n- Three model sizes (384d, 768d, 1024d)\n- Normalized vectors\n- Fast local embedding (if using ZeroLocal)\n\n---\n\n### 5. `zerodb_semantic_search`\n\nSearch by semantic similarity without text query.\n\n**Input:**\n```json\n{\n  \"text\": \"food preferences\",\n  \"limit\": 10,\n  \"session_id\": \"chat-123\",\n  \"min_similarity\": 0.7\n}\n```\n\n**Output:**\n```json\n{\n  \"results\": [\n    {\n      \"content\": \"User prefers vegetarian meals\",\n      \"similarity\": 0.85,\n      \"metadata\": {\n        \"role\": \"user\",\n        \"tags\": [\"preference\"]\n      }\n    }\n  ],\n  \"count\": 1,\n  \"search_vector_dims\": 384\n}\n```\n\n**Features:**\n- Direct vector similarity search\n- Can provide text or pre-computed vector\n- Filter by similarity threshold\n- Session-scoped or global search\n\n---\n\n### 6. `zerodb_clear_session`\n\nClear all memories for a session.\n\n**Input:**\n```json\n{\n  \"session_id\": \"chat-123\",\n  \"keep_important\": true,\n  \"confirm\": true\n}\n```\n\n**Output:**\n```json\n{\n  \"success\": true,\n  \"deleted_count\": 45,\n  \"kept_count\": 5,\n  \"message\": \"Session cleared, important memories preserved\"\n}\n```\n\n**Features:**\n- Requires confirmation\n- Optional preservation of important memories\n- Returns deletion statistics\n\n### 7. `zerodb_synthesize_context`\n\nRetrieve and LLM-synthesize relevant memories into a coherent context string. Wraps `POST /memory/v2/context`. (Issue #2631)\n\n**Input:**\n```json\n{\n  \"query\": \"What did we decide about the pricing model?\",\n  \"agent_id\": \"user-456\",\n  \"synthesis_style\": \"narrative\",\n  \"max_tokens\": 1000,\n  \"top_k\": 10\n}\n```\n\n**Output:**\n```json\n{\n  \"context\": \"In previous discussions, the team decided to use a usage-based pricing model...\",\n  \"synthesis_style\": \"narrative\",\n  \"sources_count\": 5,\n  \"confidence\": 0.87,\n  \"token_count\": 312,\n  \"agent_id\": \"user-456\"\n}\n```\n\n**Features:**\n- Three synthesis styles: `narrative`, `bullet`, `structured`\n- Powered by Claude Haiku for fast, coherent summaries\n- Graceful fallback if synthesis fails (concatenates top snippets)\n- Scoped by `agent_id` for per-user memory isolation\n\n---\n\n### 8. `zerodb_configure_auto_context`\n\nEnable auto-context middleware so that relevant memories are automatically prepended to every tool response for a given agent. (Issue #2678)\n\n**Input:**\n```json\n{\n  \"agent_id\": \"user-456\",\n  \"enabled\": true,\n  \"max_results\": 10,\n  \"synthesis_style\": \"bullet\",\n  \"auto_trace\": false\n}\n```\n\n**Output:**\n```json\n{\n  \"success\": true,\n  \"agent_id\": \"user-456\",\n  \"config\": {\n    \"enabled\": true,\n    \"max_results\": 10,\n    \"synthesis_style\": \"bullet\",\n    \"auto_trace\": false\n  },\n  \"message\": \"Auto-context enabled for agent user-456\"\n}\n```\n\n**Features:**\n- Once enabled, every subsequent tool call for the `agent_id` automatically prepends `_auto_context` to the response\n- `auto_trace: true` stores each tool response as a new episodic memory for future recall\n- Config persisted via `/remember` — survives MCP server restarts\n- Skip list: config tools themselves are never auto-contexted\n\n---\n\n### 9. `zerodb_get_auto_context_config`\n\nRetrieve the current auto-context configuration for an agent.\n\n**Input:**\n```json\n{\n  \"agent_id\": \"user-456\"\n}\n```\n\n**Output:**\n```json\n{\n  \"agent_id\": \"user-456\",\n  \"config\": {\n    \"enabled\": true,\n    \"max_results\": 10,\n    \"synthesis_style\": \"bullet\",\n    \"auto_trace\": false\n  }\n}\n```\n\n---\n\n## Write-Back Action Tools\n\nFive tools that write back to external services using OAuth tokens stored in ZeroDB sync connections. Connect accounts at `/api/v1/public/memory/v2/connections`.\n\n> **Agent workflow:** `zerodb_recall` → `zerodb_synthesize_context` → take action (send Slack, reply email, create event, etc.)\n\n### 10. `zerodb_slack_send`\n\nSend a Slack message using the user's stored OAuth token. (Issue #2645)\n\n**Input:**\n```json\n{\n  \"agent_id\": \"user-456\",\n  \"channel\": \"C012AB3CD\",\n  \"message\": \"Sprint planning scheduled for Monday 10am\",\n  \"thread_ts\": \"1609459200.000100\"\n}\n```\n\n**Output:**\n```json\n{\n  \"ts\": \"1609459201.000200\",\n  \"channel\": \"C012AB3CD\",\n  \"message\": \"Message sent successfully\"\n}\n```\n\n**Notes:** `thread_ts` is optional — omit to post a new message, include to reply in a thread.\n\n---\n\n### 11. `zerodb_gmail_reply`\n\nReply to a Gmail thread using the user's stored Google OAuth token. (Issue #2646)\n\n**Input:**\n```json\n{\n  \"agent_id\": \"user-456\",\n  \"thread_id\": \"17abc123def456\",\n  \"body\": \"Thanks for the update. I'll review the PR by EOD.\",\n  \"cc\": [\"manager@example.com\"]\n}\n```\n\n**Output:**\n```json\n{\n  \"id\": \"17abc123def999\",\n  \"thread_id\": \"17abc123def456\",\n  \"message\": \"Reply sent successfully\"\n}\n```\n\n---\n\n### 12. `zerodb_calendar_create`\n\nCreate a Google Calendar event using the user's stored Google OAuth token. (Issue #2647)\n\n**Input:**\n```json\n{\n  \"agent_id\": \"user-456\",\n  \"title\": \"Sprint Planning\",\n  \"start\": \"2026-05-10T10:00:00Z\",\n  \"end\": \"2026-05-10T11:00:00Z\",\n  \"description\": \"Q2 sprint kickoff\",\n  \"attendees\": [\"alice@example.com\", \"bob@example.com\"],\n  \"calendar_id\": \"primary\"\n}\n```\n\n**Output:**\n```json\n{\n  \"id\": \"evt_abc123\",\n  \"html_link\": \"https://calendar.google.com/event?eid=abc123\",\n  \"title\": \"Sprint Planning\",\n  \"message\": \"Event created successfully\"\n}\n```\n\n**Notes:** Uses the same Google OAuth token as Gmail. `calendar_id` defaults to `\"primary\"`.\n\n---\n\n### 13. `zerodb_github_create_issue`\n\nCreate a GitHub issue using the user's stored GitHub OAuth token. (Issue #2648)\n\n**Input:**\n```json\n{\n  \"agent_id\": \"user-456\",\n  \"repo\": \"acme/widget\",\n  \"title\": \"Fix null pointer in payment flow\",\n  \"body\": \"Steps to reproduce:\\n1. Add item to cart\\n2. Proceed to checkout\\n3. Observe crash\",\n  \"labels\": [\"bug\", \"priority:high\"]\n}\n```\n\n**Output:**\n```json\n{\n  \"number\": 142,\n  \"html_url\": \"https://github.com/acme/widget/issues/142\",\n  \"title\": \"Fix null pointer in payment flow\",\n  \"message\": \"Issue created successfully\"\n}\n```\n\n---\n\n### 14. `zerodb_notion_create_page`\n\nCreate a Notion page using the user's stored Notion OAuth token. (Issue #2649)\n\n**Input:**\n```json\n{\n  \"agent_id\": \"user-456\",\n  \"parent_id\": \"parent-page-uuid\",\n  \"title\": \"Meeting Notes — May 10\",\n  \"content\": \"Attendees: Alice, Bob\\n\\nDecisions:\\n- Ship v2 on Friday\\n- Rollback plan: revert to v1.9\"\n}\n```\n\n**Output:**\n```json\n{\n  \"id\": \"page-uuid-xyz\",\n  \"url\": \"https://notion.so/page-uuid-xyz\",\n  \"title\": \"Meeting Notes — May 10\",\n  \"message\": \"Page created successfully\"\n}\n```\n\n**Notes:** Content is converted to Notion paragraph blocks (one per non-empty line). Lines longer than 2000 characters are truncated.\n\n---\n\n## Advanced Configuration\n\n### Context Window Management\n\n```bash\n# Set maximum tokens (default: 8192)\nCONTEXT_WINDOW=16384\n\n# Choose pruning strategy (default: hybrid)\n# - relevance: Keep highest-scored memories\n# - recency: Keep most recent memories\n# - hybrid: Combine both (70% relevance, 30% recency)\nPRUNE_STRATEGY=hybrid\n\n# Always keep N recent messages (default: 5)\nKEEP_RECENT=5\n\n# Keep memories tagged as important (default: true)\nKEEP_IMPORTANT=true\n```\n\n### Memory Decay\n\nEnable natural memory decay over time:\n\n```bash\n# Enable decay (default: false)\nDECAY_ENABLED=true\n\n# Half-life in days (default: 30)\n# After 30 days, importance score is halved\nDECAY_HALFLIFE=30\n\n# Protect tags from decay\nPRESERVE_TAGS=important,permanent,critical\n```\n\n**Example:**\n- Day 0: importance = 0.8\n- Day 30: importance = 0.4\n- Day 60: importance = 0.2\n- Memories with `important` tag: never decay\n\n### Automatic Summarization\n\nCompress old conversations automatically:\n\n```bash\n# Enable summarization (default: true)\nSUMMARIZE_ENABLED=true\n\n# Summarize after N messages (default: 20)\nSUMMARIZE_AFTER=20\n\n# Model for summarization\nSUMMARY_MODEL=claude-3-haiku-20240307\n\n# Keep original messages (default: false)\nKEEP_ORIGINALS=false\n```\n\n**Behavior:**\n1. After 20 messages, oldest 15 are summarized\n2. Summary stored as new memory with `summary` tag\n3. Original messages deleted (unless `KEEP_ORIGINALS=true`)\n4. Recent 5 messages always kept\n\n### Embedding Models\n\nChoose embedding model based on needs:\n\n```bash\n# Small (384 dimensions) - Fast, efficient\nEMBEDDING_MODEL=BAAI/bge-small-en-v1.5\n\n# Base (768 dimensions) - Balanced\nEMBEDDING_MODEL=BAAI/bge-base-en-v1.5\n\n# Large (1024 dimensions) - Most accurate\nEMBEDDING_MODEL=BAAI/bge-large-en-v1.5\n```\n\n**Trade-offs:**\n- **Small:** 3x faster, 70% accuracy\n- **Base:** 2x faster, 85% accuracy\n- **Large:** 1x baseline, 95% accuracy\n\n---\n\n## Use Cases\n\n### Customer Support Agent\n\n```javascript\n// Store user preferences\nawait zerodb_store_memory({\n  content: \"User prefers email support over phone\",\n  role: \"user\",\n  session_id: \"support-session-123\",\n  tags: [\"preference\", \"communication\"],\n  user_id: \"customer-456\"\n});\n\n// Later, search across all sessions for this user\nconst prefs = await zerodb_search_memory({\n  query: \"communication preferences\",\n  scope: \"agent\",\n  user_id: \"customer-456\"\n});\n```\n\n### Personal Assistant\n\n```javascript\n// Store important facts\nawait zerodb_store_memory({\n  content: \"User's birthday is March 15th\",\n  role: \"system\",\n  session_id: \"assistant-123\",\n  tags: [\"important\", \"permanent\", \"personal\"],\n  metadata: { category: \"birthday\" }\n});\n\n// Retrieve context before responding\nconst context = await zerodb_get_context({\n  session_id: \"assistant-123\",\n  max_tokens: 4096\n});\n```\n\n### Research Assistant\n\n```javascript\n// Store findings\nawait zerodb_store_memory({\n  content: \"Study shows 85% efficacy in clinical trials\",\n  role: \"assistant\",\n  session_id: \"research-789\",\n  tags: [\"research\", \"statistics\"],\n  metadata: { source: \"Nature 2026\", confidence: 0.9 }\n});\n\n// Search semantically\nconst related = await zerodb_semantic_search({\n  text: \"clinical trial results\",\n  limit: 5,\n  min_similarity: 0.7\n});\n```\n\n### End-to-End Agent Workflow: Recall → Synthesize → Act\n\n```javascript\n// 1. Recall relevant memories\nconst memories = await zerodb_recall({\n  query: \"pending items from last standup\",\n  agent_id: \"agent-456\",\n  top_k: 10,\n  rerank: true\n});\n\n// 2. Synthesize into a coherent summary\nconst context = await zerodb_synthesize_context({\n  query: \"pending items from last standup\",\n  agent_id: \"agent-456\",\n  synthesis_style: \"bullet\",\n  top_k: 5\n});\n// context.context = \"- PR #42 needs review\\n- Deploy blocked on staging tests\\n- Alice OOO Monday\"\n\n// 3. Take action — send Slack update\nawait zerodb_slack_send({\n  agent_id: \"agent-456\",\n  channel: \"C012AB3CD\",\n  message: `Standup summary:\\n${context.context}`\n});\n\n// 4. Log the action as a memory for future recall\nawait zerodb_store_memory({\n  content: `Sent standup summary to #engineering: ${context.context}`,\n  role: \"assistant\",\n  session_id: \"agent-456\",\n  tags: [\"action\", \"slack\", \"standup\"]\n});\n```\n\n### Auto-Context Middleware\n\nEnable auto-context so every tool call gets relevant memories prepended automatically:\n\n```javascript\n// Enable once per agent\nawait zerodb_configure_auto_context({\n  agent_id: \"agent-456\",\n  enabled: true,\n  max_results: 10,\n  synthesis_style: \"bullet\",\n  auto_trace: true  // also store tool responses as memories\n});\n\n// Now every subsequent tool call automatically includes _auto_context\nconst result = await zerodb_slack_send({\n  agent_id: \"agent-456\",\n  channel: \"C123\",\n  message: \"Update sent\"\n});\n// result._auto_context = \"• User prefers concise updates\\n• Last message sent 2h ago\"\n// result.ts = \"...\"\n```\n\n---\n\n## Performance\n\n### Context Footprint Comparison\n\n| Metric | Monolithic Server | Agent Memory MCP | Improvement |\n|--------|-------------------|------------------|-------------|\n| Tools | 77 | 6 | **92% reduction** |\n| Token cost | ~10,400 | ~800 | **92% reduction** |\n| Load time | 2.5s | 0.3s | **8x faster** |\n| Memory usage | 150MB | 20MB | **87% less** |\n| Agent accuracy | 60% | 95% | **58% better** |\n\n### Benchmarks\n\n**ZeroLocal (localhost:8000):**\n- Store memory: ~5ms\n- Search memory: ~15ms\n- Get context: ~20ms\n- Embed text: ~10ms\n\n**ZeroDB Cloud (api.ainative.studio):**\n- Store memory: ~50ms\n- Search memory: ~75ms\n- Get context: ~100ms\n- Embed text: ~60ms\n\n---\n\n## Development\n\n### Run Tests\n\n```bash\nnpm test\n```\n\n### Run with Verbose Logging\n\n```bash\nDEBUG=* npm start\n```\n\n### Development Mode (auto-reload)\n\n```bash\nnpm run dev\n```\n\n---\n\n## Troubleshooting\n\n### Error: \"Authentication failed\" or 401 on store_memory\n\n**Common cause:** Shell environment variables (`~/.zshrc`, `~/.bashrc`) override the credentials set in your MCP config (e.g., `.claude.json` or Claude Desktop config). The MCP server inherits all shell env vars, and stale `ZERODB_USERNAME`/`ZERODB_PASSWORD` values in your shell profile will take precedence.\n\n**Fix:**\n1. Remove or update stale `ZERODB_USERNAME`/`ZERODB_PASSWORD` exports from `~/.zshrc` or `~/.bashrc`\n2. Or switch to API key auth (`ZERODB_API_KEY`) which is not typically set in shell profiles\n3. Or set credentials explicitly in your MCP server config `env` block to override shell vars\n\n**Also check:**\n- `ZERODB_USERNAME` and `ZERODB_PASSWORD` are correct\n- Account exists in ZeroDB\n- Password hasn't changed\n\n### Error: \"Project not found\"\n\n**Check:**\n- `ZERODB_PROJECT_ID` is correct\n- Project exists in your account\n- You have access permissions\n\n### Error: \"Connection refused\"\n\n**If using ZeroLocal:**\n```bash\n# Check if ZeroLocal is running\ncurl http://localhost:8000/health\n\n# Start ZeroLocal\ncd /path/to/zerodb-local\nzerodb local up\n```\n\n**If using Cloud:**\n```bash\n# Check internet connection\nping api.ainative.studio\n\n# Verify API is online\ncurl https://api.ainative.studio/health\n```\n\n### Memory not being pruned\n\n**Check configuration:**\n```bash\n# Ensure context window is set\necho $CONTEXT_WINDOW\n\n# Verify prune strategy\necho $PRUNE_STRATEGY\n\n# Check if keep_recent is too high\necho $KEEP_RECENT\n```\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────┐\n│         Agent Memory MCP Server             │\n├─────────────────────────────────────────────┤\n│                                             │\n│  Main (index.js)                            │\n│  └── MCP Server initialization              │\n│                                             │\n│  Client (zerodb-client.js)                  │\n│  ├── Auto-detection (local vs cloud)       │\n│  ├── Authentication & token refresh         │\n│  └── API request handling                   │\n│                                             │\n│  Memory Manager (memory-manager.js)         │\n│  ├── Context window management             │\n│  ├── Memory pruning (relevance/recency)    │\n│  ├── Importance scoring                     │\n│  ├── Memory decay                           │\n│  └── Automatic summarization                │\n│                                             │\n│  Tools (memory-tools.js)                    │\n│  ├── zerodb_store_memory                   │\n│  ├── zerodb_search_memory                  │\n│  ├── zerodb_get_context                    │\n│  ├── zerodb_embed_text                     │\n│  ├── zerodb_semantic_search                │\n│  ├── zerodb_clear_session                  │\n│  └── zerodb_synthesize_context             │\n│                                             │\n└─────────────────────────────────────────────┘\n```\n\n---\n\n## Roadmap\n\n### v1.1 (Planned)\n- [ ] LLM-based automatic summarization\n- [ ] Memory clustering and organization\n- [ ] Export/import memory archives\n- [ ] Memory analytics dashboard\n\n### v1.2 (Planned)\n- [ ] Multi-agent memory sharing\n- [ ] Memory permissions and access control\n- [ ] Federated memory across instances\n- [ ] Memory replication and backup\n\n### v2.0 (Future)\n- [ ] Graph-based memory relationships\n- [ ] Temporal memory queries\n- [ ] Memory compression algorithms\n- [ ] Real-time memory streaming\n\n---\n\n## Contributing\n\nContributions welcome! Please read our contributing guidelines first.\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Support\n\n- **Documentation:** https://www.ainative.studio/docs\n- **Issues:** https://github.com/ainative/zerodb-memory-mcp/issues\n- **Discord:** https://discord.gg/ainative\n\n---\n\n**Built with by AINative Studio**\n\nMaking AI agents smarter, one memory at a time.\n",
  "bytes": 21895,
  "sha": "d555db5f7d1b4115cdad8d7c6aa068b74396b13161f4aa9fdef7ab11ec92a71a",
  "repo_slug": "ainative-studio/ainative-zerodb-memory-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ainative_studio_ainative_zerod_d87d30b0/readme"
}