{"id":"571340e3-ccd5-4de5-9ae9-1d8d7ee5f9f7","slug":"nexusyn-engine","kind":"mcp","name":"engine","summary":"Open-source long-term, time-aware memory engine for AI agents (MCP + hybrid search + bi-temporal recall)","owner":"nexusyn","repoUrl":"https://github.com/nexusyn/engine","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":4,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-09-03T20:48:25.000Z","addedAt":"2026-10-14T05:30:44.934Z","logoUrl":"https://avatars.githubusercontent.com/u/290065797?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["memory-knowledge","search","data-analytics"],"tags":["agent","agents","ai","golang","graphrag","long-term-memory","pgvector","rag"],"runtime":"go","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-17T08:39:50.447Z","sample":false,"url":"https://conduits.dev/tools/nexusyn-engine","language":"Go","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"<div align=\"center\">\n\n# Nexusyn Engine\n\n### Long-Term, Time-Aware Memory Engine for AI Agents\n\n**Stop building agents that forget. Give your LLMs persistent, grounded memory across sessions.**\n\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Go Version](https://img.shields.io/badge/Go-1.27-00ADD8.svg?logo=go&logoColor=white)](go.mod)\n[![Database](https://img.shields.io/badge/Postgres-18_%2B_pgvector-336791.svg?logo=postgresql&logoColor=white)](migrations/)\n[![Protocol](https://img.shields.io/badge/MCP-Native_HTTP-8A2BE2.svg)](https://modelcontextprotocol.io)\n[![LongMemEval-S](https://img.shields.io/badge/LongMemEval--S-81.1%25-10B981.svg)](https://nexusyn.ai/#benchmark)\n[![LoCoMo](https://img.shields.io/badge/LoCoMo-74.3%25-10B981.svg)](https://nexusyn.ai/#benchmark)\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\n<p align=\"center\">\n  <img src=\"docs/assets/demo.gif\" alt=\"Nexusyn Terminal Demo\" width=\"760\" />\n</p>\n\n</div>\n\n---\n\n## The Problem: Why Vector Databases Alone Aren't \"Memory\"\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\n---\n\n## The Solution: How Nexusyn Works\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---\n\n## Comparison\n\n| Capability | Raw Vector DB | Simple Buffer / Window | **Nexusyn Engine** |\n|---|:---:|:---:|:---:|\n| **Semantic Vector Search** | ✅ | ❌ | ✅ |\n| **BM25 Keyword Search** | ⚠️ (Requires hybrid setup) | ❌ | ✅ |\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)** | ⚠️ (Manual filters) | ❌ | ✅ (Engine-enforced) |\n| **Token Cost Efficiency** | ⚠️ (Dumps all chunks) | ❌ (Huge prompts) | ✅ (Synthesized / Grounded) |\n\n---\n\n## Benchmarks\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## Architecture\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\n---\n\n## Quickstart (Docker Compose)\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```bash\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\n---\n\n## First-Class MCP Integration\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\n### 1. Claude Code\nConnect Nexusyn to Claude Code with a single CLI command:\n\n```bash\nclaude mcp add nexusyn --transport http \\\n  \"http://localhost:8044/v1/mcp\" \\\n  --header \"Authorization: Bearer <YOUR_API_TOKEN>\"\n```\n\n### 2. Cursor (`~/.cursor/mcp.json`)\nAdd Nexusyn to your Cursor global or project configuration:\n\n```json\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\n### 3. Windsurf (`~/.codeium/windsurf/mcp_config.json`)\n```json\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### Available MCP Tools\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\n---\n\n## REST API Usage\n\nTwo endpoints cover 90% of all integration needs:\n\n### 1. Store a Memory (`POST /v1/ingest`)\n\n```bash\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```json\n{\n  \"job_id\": 482,\n  \"status\": \"queued\"\n}\n```\n\n### 2. Query Grounded Memory (`POST /v1/query`)\n\n```bash\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```json\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\n---\n\n## Pluggable Providers\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---\n\n## Self-Hosted vs. Nexusyn Cloud\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\n## Development & Testing\n\n```bash\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---\n\n## Community & Security\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](SECURITY.md) and report privately to **security@nexusyn.ai**.\n* **Website:** [https://nexusyn.ai](https://nexusyn.ai)\n* **Documentation:** [https://nexusyn.ai/docs](https://nexusyn.ai/docs)\n\n---\n\n## License & Trademark\n\n* **Source Code:** Released under the [Apache License, Version 2.0](LICENSE).\n* **Trademark:** \"Nexusyn\" and associated marks are trademarks of RedFoxCode.\n"}