nexus-memory

nexus-memory

A zero-dependency, file-based persistent memory system for AI agents with tiered memory, Ebbinghaus decay, and keyword retrieval.

Category
访问服务器

README

Nexus Memory System

Zero-dependency, file-based persistent memory for AI agents.

Glama Smithery License: MIT

Nexus is a tiered memory system with Ebbinghaus decay, keyword retrieval, token-efficient context assembly, and full MCP + REST API support. Drop-in replacement for Hindsight that saves 92% on memory token costs.

MCP Server  →  stdio (Claude Code, Cline, Windsurf)
REST API    →  HTTP (Hermes agents, custom integrations)
CLI         →  bash (nexus.sh — search, stats, decay, consolidate)

Features

Feature Description
Zero dependencies No database, no vector store, no embeddings API. Pure Python stdlib.
MCP native 5 tools (search, stats, save, touch, decay) + resource access
REST API Hindsight v1 compatible. Drop-in replace HINDSIGHT_API_URL.
Ebbinghaus decay Automatic forgetting curve. Memories expire on schedule.
Token economics 92% cost reduction vs Hindsight. Built-in token tracking.
Pointer-based RAG Kronos-style 300-token pointers for budgeted context assembly.
File-based Plain markdown files. Readable, editable, git-versionable.
Bilingual Full Chinese + English support.
Cross-agent sharing Share memories across Hermes agents or any MCP client.

Quick Start

# 1. Start the MCP server (for Claude Code / Cline / Windsurf)
python nexus_mcp.py

# 2. Start the REST API (for Hermes agents / HTTP clients)
python nexus_rest.py --port 9177

# 3. Use the CLI
python nexus_engine.py retrieve "what do I know about X"
python nexus_engine.py stats
python nexus_engine.py decay

Claude Code Integration

Add to your claude.json:

{
  "mcpServers": {
    "nexus-memory": {
      "command": "python",
      "args": ["path/to/nexus_mcp.py"]
    }
  }
}

Hermes Agent Integration

Replace Hindsight with Nexus:

export HINDSIGHT_API_URL=http://localhost:9177

No code changes needed. Nexus speaks the Hindsight v1 protocol.

Architecture

┌─────────────────────────────────────────────────────┐
│                    Nexus System                      │
│                                                      │
│  ┌──────────────┐  ┌──────────┐  ┌───────────────┐  │
│  │  nexus_mcp.py │  │nexus_rest│  │nexus_engine.py│  │
│  │  (MCP stdio)  │  │(HTTP API)│  │  (Core logic) │  │
│  └──────┬───────┘  └────┬─────┘  └───────┬───────┘  │
│         └───────────────┼─────────────────┘          │
│                         ▼                           │
│              ┌──────────────────┐                    │
│              │  memory/  (files) │                    │
│              │  ├ episodic/     │                    │
│              │  ├ semantic/     │                    │
│              │  ├ procedural/   │                    │
│              │  ├ reflections/  │                    │
│              │  ├ working/      │                    │
│              │  ├ core/         │                    │
│              │  └ archive/      │                    │
│              └──────────────────┘                    │
└─────────────────────────────────────────────────────┘

Memory Tiers

Tier Decay Purpose
Working 7 days In-session context
Episodic 30 days Past experiences
Semantic 90 days Facts, preferences
Procedural 180 days Workflows, skills
Reflections 60 days Meta-cognition
Core Never Identity, rules

Token Economics

Metric Hindsight Nexus Savings
Per recall 500 tokens 30 tokens 94%
Per retain 300 tokens 50 tokens 83%
5 agents/day 440,000 tokens 36,000 tokens 92%
Monthly cost $39.60 $3.24 $36.36

Benchmark: 1192.9x efficiency ratio (1 token spent → 1192 saved vs Hindsight).

Pricing

           Free              Solo              Team              Enterprise
           ─────            ──────            ──────            ──────────
Price      $0               $4.99/mo          $14.99/mo         $49.99/mo
Memories   50               500               5,000             50,000
MCP        ✓                ✓                 ✓                 ✓
REST API   ✓                ✓                 ✓                 ✓
CLI        ✓                ✓                 ✓                 ✓
Pointers   -                ✓                 ✓                 ✓
Token      7 days           30 days           90 days           365 days
 tracking
Cross-     -                -                 ✓                 ✓
 agent
Priority   -                -                 -                 ✓
 support

All tiers include Ebbinghaus decay, keyword retrieval, and file-based transparency.

Roadmap

  • [x] MCP server (tools + resources)
  • [x] REST API (Hindsight v1 compatible)
  • [x] Keyword retrieval + scoring
  • [x] Token economics tracking
  • [x] Ebbinghaus decay
  • [x] Memory consolidation
  • [ ] x402 micropayments
  • [ ] SSE transport for MCP
  • [ ] Cloud sync
  • [ ] Knowledge graph

Why Not Hindsight?

Hindsight is powerful but expensive: it calls LLMs for every recall/retain, uses PostgreSQL + pgvector, and requires a running daemon. Nexus achieves comparable retrieval quality at 8% of the token cost — no LLM calls, no database, no daemon. Just files and algorithms.

Why Not Mem0/Letta/Memoria?

Those are excellent systems, but they're architecturally heavy (vector DBs, embeddings, graph stores). Nexus is designed for the 80% use case: fast keyword retrieval with smart ranking. When you need semantic search, Nexus pointers bridge the gap at zero marginal cost.

No database. No API keys. No Docker. Just python nexus_mcp.py.


Built with ❤️ for the Hermes agent ecosystem.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选