{"slug": "nexusyn-long-term-memory-engine-for-ai-agents-go-diskann-mcp", "title": "Nexusyn – Long-term memory engine for AI agents (Go, DiskANN, MCP)", "summary": "Nexusyn launched a long-term memory engine for AI agents that scores 81.1% (284/350) on LongMemEval-S and 74.3% (1,476/1,986) on LoCoMo, according to the company's published benchmarks. The Go-based engine combines bi-temporal fact versioning, hybrid retrieval using Reciprocal Rank Fusion over pgvector HNSW and BM25, cross-encoder reranking, and a native Model Context Protocol server at /v1/mcp that connects to Claude Code, Cursor, and Windsurf. Nexusyn says the system returns grounded, source-cited answers and enforces multi-tenant isolation through PostgreSQL row-level security, addressing outdated-fact retrieval and context-window bloat in vector-only agent memory.", "body_md": "**Stop building agents that forget. Give your LLMs persistent, grounded memory across sessions.**\n\n[Quickstart](#quickstart-docker-compose) • [MCP Integration](#first-class-mcp-integration) • [Architecture](#architecture) • [Benchmarks](#benchmarks) • [Cloud vs Self-Hosted](#self-hosted-vs-nexusyn-cloud) • [Documentation](https://nexusyn.ai/docs)\n\nMost AI agent frameworks implement memory by taking the last conversation turn, calculating an embedding, and storing it in a vector database.\n\nWhen the agent queries this \"memory\", it runs a simple nearest-neighbor search. This breaks down in production:\n\n1. **Vectors don't understand time:** If a user says*\"I live in Berlin\"* in January and*\"I moved to Madrid\"* in August, both vectors have identical semantic similarity to*\"Where do I live?\"* . A pure vector search frequently returns the outdated fact.\n2. **Context window bloat:** Dumping raw matching chunks into the prompt forces the LLM to resolve contradictions, inflating token costs and increasing hallucination rates.\n3. **No entity understanding:** Vector similarity misses relational facts that don't share keywords (e.g. connecting a bug report to the architecture decision that caused it).\n\nNexusyn is a dedicated data plane engine designed specifically for **agentic long-term memory**:\n\n- 🕓 **Bi-Temporal Versioning:** Every fact is stamped with transaction time and valid time (`valid_from` /`valid_to` ). New statements supersede older ones automatically without deleting history.\n- 🔀 **Hybrid Retrieval (RRF):** Fuses dense vector similarity (`pgvector` HNSW) + BM25 full-text search + entity graph expansion + recency & date-anchor boosts using Reciprocal Rank Fusion.\n- 🎯 **Reranking:** High-precision cross-encoder re-scoring of candidate chunks before generation.\n- 🛡️ **Grounded Synthesis:** Returns a synthesized, ready-to-use answer that cites verifiable source chunks — so the agent receives answers, not just raw text fragments.\n- ⚡ **MCP-Native:** First-class Model Context Protocol server (`/v1/mcp` ) running over streamable HTTP. Connects directly to**Claude Code** ,**Cursor** ,**Windsurf** , or custom agent frameworks with zero glue code.\n- 🏢 **Multi-Tenant with Row-Level Security (RLS):** True isolation at the PostgreSQL layer. A tenant can never see or search another tenant's memories.\n- ⚙️ **Async Pipeline (River):** Heavy background workloads (chunking, batch embedding, entity extraction, and wiki compilation) run asynchronously on a Postgres-backed queue.\n\n| Capability | Raw Vector DB | Simple Buffer / Window | **Nexusyn Engine** | \n|---|---|---|---|\n| **Semantic Vector Search** | ✅ | ❌ | ✅ | \n| **BM25 Keyword Search** |  | ❌ | ✅ | \n| **Bi-Temporal Fact Superseding** | ❌ | ❌ | ✅ | \n| **Entity Knowledge Graph (GraphRAG)** | ❌ | ❌ | ✅ | \n| **Grounded Answers with Sources** | ❌ (Raw chunks only) | ❌ | ✅ | \n| **Native MCP Server** | ❌ | ❌ | ✅ ( `/v1/mcp` ) | \n| **Database Multi-Tenancy (RLS)** |  | ❌ | ✅ (Engine-enforced) | \n| **Token Cost Efficiency** |  | ❌ (Huge prompts) | ✅ (Synthesized / Grounded) | \n\nNexusyn is evaluated against standard public benchmarks for agent long-term memory under reproducible conditions:\n\n| Benchmark | Nexusyn Score | Metric Focus | \n|---|---|---|\n| **LongMemEval-S** | **81.1%** (284/350) | Multi-session recall, temporal updates, and preference tracking across long horizons | \n| **LoCoMo** | **74.3%** (1,476/1,986) | Complex multi-turn conversational reasoning, aggregation, and contradiction resolution | \n\n```\n                    ┌─────────────────────────┐\n                    │       AI Agent / IDE    │\n                    │ (Claude Code, Cursor, …)│\n                    └────────────┬────────────┘\n                        HTTP     │   MCP (/v1/mcp)\n                                 ▼\n┌────────────────────────────────────────────────────────────────────────┐\n│                             NEXUSYN ENGINE                             │\n│                                                                        │\n│   POST /v1/ingest                                POST /v1/query        │\n│         │                                              │               │\n│         ▼                                              ▼               │\n│   [ Deduplication ]                             [ Sub-query Gen ]      │\n│         │                                              │               │\n│   [ Chunker ]                                   [ Hybrid Retrieval ]   │\n│         │                                       ├── Vector (HNSW)      │\n│         ▼                                       ├── BM25 Full-Text     │\n│   [ River Queue (Async) ]                       ├── Entity Graph       │\n│   ├── Batch Embeddings                          └── Date Anchor Boost  │\n│   ├── Entity & Relation Extraction                     │               │\n│   └── Wiki / Profile Compilation                       ▼               │\n│         │                                       [ RRF Fusion ]         │\n│         ▼                                              │               │\n│   [ PostgreSQL 18 (pgvector) ]                  [ Cross-Encoder Rerank]│\n│   Row-Level Security (Multi-Tenant)                    │               │\n│                                                        ▼               │\n│                                                 [ Grounded Answer ]    │\n│                                                 (Synthesized + Sources)│\n└────────────────────────────────────────────────────────────────────────┘\n```\n\nGet the complete stack running locally (PostgreSQL 17+ with `pgvector`, the Nexusyn HTTP/MCP API on `:8044`, and the River background worker) in under 60 seconds:\n\n```\n# 1. Clone the repository\ngit clone https://github.com/nexusyn/engine.git\ncd engine\n\n# 2. Configure environment\ncp .env.example .env\n\n# Edit .env with your preferred model provider API keys\n# (OpenAI, Anthropic, Gemini, Ollama, Jina, etc.)\n\n# 3. Spin up the containers\ndocker compose up -d\n\n# 4. Verify health\ncurl http://localhost:8044/health\n# {\"status\":\"ok\",\"time\":\"...\"}\n```\n\nNexusyn runs an HTTP Model Context Protocol (MCP) server at `/v1/mcp`. Any MCP-compliant client gets persistent long-term memory tools out of the box.\n\nConnect Nexusyn to Claude Code with a single CLI command:\n\n```\nclaude mcp add nexusyn --transport http \\\n  \"http://localhost:8044/v1/mcp\" \\\n  --header \"Authorization: Bearer <YOUR_API_TOKEN>\"\n```\n\nAdd Nexusyn to your Cursor global or project configuration:\n\n```\n{\n  \"mcpServers\": {\n    \"nexusyn\": {\n      \"url\": \"http://localhost:8044/v1/mcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer <YOUR_API_TOKEN>\"\n      }\n    }\n  }\n}\n{\n  \"mcpServers\": {\n    \"nexusyn\": {\n      \"serverUrl\": \"http://localhost:8044/v1/mcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer <YOUR_API_TOKEN>\"\n      }\n    }\n  }\n}\n```\n\n- `add_memory` — Record a decision, convention, lesson, or fact tagged by`project` and`agent` .\n- `search_memory` — Query memories using hybrid search, returning grounded answers with sources.\n- `get_guideline` — Retrieve organization/project-wide mandatory standards.\n- `update_memory` /`delete_memory` — In-place curation and correction of existing records.\n\nTwo endpoints cover 90% of all integration needs:\n\n```\ncurl -X POST http://localhost:8044/v1/ingest \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"title\": \"Auth Architecture\",\n    \"content\": \"We migrated from session cookies to stateless JWT with Ed25519 token signing on 2026-08-15.\",\n    \"agent\": \"cursor\",\n    \"project\": \"mobile-app\"\n  }'\n```\n\nResponse:\n\n```\n{\n  \"job_id\": 482,\n  \"status\": \"queued\"\n}\ncurl -X POST http://localhost:8044/v1/query \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"question\": \"What token signing algorithm do we use for authentication?\",\n    \"project\": \"mobile-app\"\n  }'\n```\n\nResponse:\n\n```\n{\n  \"question\": \"What token signing algorithm do we use for authentication?\",\n  \"answer\": \"The authentication system uses stateless JWTs signed with the Ed25519 algorithm, migrated on August 15, 2026.\",\n  \"sources\": [\n    {\n      \"id\": \"chk_9a8b7c\",\n      \"title\": \"Auth Architecture\",\n      \"content\": \"We migrated from session cookies to stateless JWT with Ed25519 token signing on 2026-08-15.\",\n      \"score\": 0.942\n    }\n  ],\n  \"usage\": {\n    \"model\": \"gpt-4o-mini\",\n    \"prompt_tokens\": 312,\n    \"completion_tokens\": 38\n  }\n}\n```\n\n**Streaming:** Real-time token streaming with Server-Sent Events (SSE) is available at `POST /v1/query/stream`.\n\nNexusyn uses an adapter architecture. Bring your own models for generation, embeddings, and reranking:\n\n| Component | Supported Adapters | \n|---|---|\n| **Generation / Answers** | OpenAI, Anthropic Claude, Google Gemini, MiniMax, Ollama (local), OpenRouter, Voyage | \n| **Fact & Entity Extraction** | OpenAI, Anthropic Claude, MiniMax, Gemini, Ollama | \n| **Embeddings** | OpenAI ( `text-embedding-3-*` ), Jina (`jina-embeddings-v5` ), Voyage AI, Ollama | \n| **Reranking** | Jina Reranker v3, Cohere Rerank, Local Cross-Encoder | \n\n| Feature | Open-Source Engine | Nexusyn Cloud | \n|---|---|---|\n| **License** | Apache 2.0 | Hosted SaaS | \n| **Deployment** | Self-hosted (Docker, Kubernetes, VPS) | Fully Managed | \n| **API & MCP Server** | ✅ Full feature set | ✅ Global edge latency | \n| **Model Providers** | Bring Your Own Keys (BYOK) | Pre-configured & Optimized | \n| **Web UI & Dashboard** | Local CLI / API | Modern Web Console | \n| **3D Graph Visualization** | ❌ | ✅ Interactive 3D Explorer | \n| **Team Management & Billing** | ❌ | ✅ Organization & Workspace controls | \n| **Maintenance & Scaling** | Self-managed | 99.9% Uptime SLA & Auto-backups | \n| **Pricing** | **Free forever** | **[Free tier available](https://nexusyn.ai)** | \n\n```\n# Build binary\ngo build -v ./...\n\n# Run unit tests\ngo test -v ./internal/core/... ./internal/auth/... ./internal/dateutil/...\n\n# Run security checks\ngitleaks detect --source . --no-git\ngovulncheck ./...\n```\n\n- **Bug Reports & Feature Requests:** Please open an issue on[GitHub Issues](https://github.com/nexusyn/engine/issues) .\n- **Security Vulnerabilities:** Review our[Security Policy](https://github.com/nexusyn/engine/blob/main/SECURITY.md) and report privately to**[security@nexusyn.ai](mailto:security@nexusyn.ai)** .\n- **Website:**[https://nexusyn.ai](https://nexusyn.ai)\n- **Documentation:**[https://nexusyn.ai/docs](https://nexusyn.ai/docs)\n\n- **Source Code:** Released under the[Apache License, Version 2.0](https://github.com/nexusyn/engine/blob/main/LICENSE) .\n- **Trademark:** \"Nexusyn\" and associated marks are trademarks of RedFoxCode.", "url": "https://wpnews.pro/news/nexusyn-long-term-memory-engine-for-ai-agents-go-diskann-mcp", "canonical_source": "https://github.com/nexusyn/engine", "published_at": "2026-10-02 17:15:03+00:00", "updated_at": "2026-10-02 17:36:33.960661+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-infrastructure", "large-language-models", "ai-tools"], "entities": ["Nexusyn", "Claude Code", "Cursor", "Windsurf", "Model Context Protocol", "pgvector", "PostgreSQL", "River"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/nexusyn-long-term-memory-engine-for-ai-agents-go-diskann-mcp", "markdown": "https://wpnews.pro/news/nexusyn-long-term-memory-engine-for-ai-agents-go-diskann-mcp.md", "text": "https://wpnews.pro/news/nexusyn-long-term-memory-engine-for-ai-agents-go-diskann-mcp.txt", "jsonld": "https://wpnews.pro/news/nexusyn-long-term-memory-engine-for-ai-agents-go-diskann-mcp.jsonld"}}