← Back to Leaderboard
Ayb-zhai

yb-zhai/agent-memory

Local JSONL agent memory with four-way recall, MCP, and optional semantic search

View on GitHub ↗
RAG & Data ToolQuickstart ↓
Engineering Health (Methodology)
A+ · 90/100
Maintenance Activity
● Updated today
Latest Release
v2.8.1
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption15/25
Release Cadence20/20
License Clarity20/20
MCPSelf-HostedLocal AI
Total Stars
★ 81
24h Growth
+4
7d Growth
+19
Forks
16

GitHub Star History

Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.

yb-zhai/agent-memory Star History (2026-11-20 - 2026-12-04) DAILY STAR HISTORY (15-DAY D1 TELEMETRY) +80 in 14d · avg +6/day 85 43 0 2026-11-20: ★ 12026-11-21: ★ 192026-11-22: ★ 402026-11-23: ★ 442026-11-24: ★ 512026-11-25: ★ 572026-11-26: ★ 622026-11-27: ★ 632026-11-28: ★ 662026-11-29: ★ 672026-11-30: ★ 702026-12-01: ★ 722026-12-02: ★ 762026-12-03: ★ 812026-12-04: ★ 81 ★ 81 11-20 11-27 12-04

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Nebula Memory is an embeddable agent memory engine, not a general-purpose database. Its core, exposed by memory/index.mjs, runs on Node.js without external runtime dependencies and persists text in local JSONL. Recall combines four signals: TF-IDF lexical matching, activation with time decay, graph propagation, and user profiles. The thin index stores metadata, term frequencies, and byte offsets, so the engine can defer reading full text until it needs it.

The standalone server.js and DeepSeek Harness (DSH) plugin expose the panel and can query an optional Hindsight HTTP backend alongside local recall. Reciprocal rank fusion (RRF) merges the two ranked lists. On those surfaces, local recall stays enabled and continues to serve queries if Hindsight becomes unavailable. The standalone MCP package exposes the local engine without the panel or Hindsight.

Key Capabilities & Differentiators

Writes redact recognized secrets and personal identifiers before term counting and split text beyond the 2,000-character item limit into linked chunks that can be grouped by docId. Memories pinned with importance=1.0 avoid time decay. Rule-based contradiction handling marks older claims as superseded on recognized polarity reversals and excludes them from default recall without deleting them. Background maintenance can prune edges, archive low-value chatter, and compact storage without model calls.

The 3D panel shows memory links and recall traces, updates via SSE, and lets users inspect ranking contributions. MCP also provides explain_recall. Optional pinyin indexing adds full-pinyin, initial-letter, and fuzzy pronunciation matches for Chinese text. On a compacted corpus of 23.8k nodes and 41.4k edges, the project benchmark measured about 13 ms median local recall and 31 ms median MCP end-to-end latency; the timings apply to that snapshot, not every corpus.

Trade-offs & Limitations

The local engine trades semantic reach for a simple offline deployment: graph and profile signals can improve retrieval, but weak lexical overlap can still defeat queries. Hindsight targets paraphrases and older history at the cost of another service, PostgreSQL, and an LLM backend. In the scale test, median recall rose to 319 ms at 100,000 entries and 1.75 s at 500,000; candidate scoring was the bottleneck. Test against a representative corpus before relying on the smaller-bank latency figures.

Plaintext JSONL is easy to inspect and back up, but the local store is a single-writer design without transactions, tenant isolation, or cross-device conflict resolution. watchExternalWrites lets other local processes pick up fresh rows; it does not coordinate writers. LangChain Memory fits a Python-first application more naturally, while a managed offering such as Mem0 or Zep is worth evaluating when cross-device access and team controls matter. For sensitive deployments, restrict file access and review what leaves the machine through Hindsight or prompts sent to a remote model.

Hardware & Deployment Guide

Start with Node.js and a writable data directory. Embed NebulaMemory for an application-controlled integration, run node server.js for the HTTP service and panel on port 8898, or use npx nebula-memory-mcp for a compatible client. DSH desktop users can install the full plugin with dsh plugin --profile desktop add github:yb-zhai/agent-memory; the profile must match the active installation. The engine can run offline once installed. The MCP package and DSH plugin have separate release lines.

For hybrid recall, provision Hindsight with PostgreSQL and an LLM backend, set hindsightUrl and a hindsightKey if needed, and check /healthz for local or hybrid mode. The plugin probes backend readiness every 30 seconds and falls back to local recall if checks fail. v2.7.1 bounded deduplication candidates and made snapshot writes tolerant of certain concurrent failures; v2.8.0 introduced optional pinyin search, and v2.8.1 reduced its persisted index footprint.

Local ranking: TF-IDF, activation, graph propagation, and profile signals run without an LLM or vector database.
Storage and startup: index.thin.json keeps metadata, term frequencies, and byte offsets so full text can be loaded on demand.
Recall inspection: The panel offers live SSE updates and score breakdowns; MCP exposes explain_recall.
Memory lifecycle: Writes support pattern-based redaction and linked text chunks; superseded facts remain available for historical recall.
Chinese search: Optional pinyinIndex supports full pinyin, initials, and fuzzy pronunciation matches.
Hybrid retrieval: Reciprocal rank fusion combines local and Hindsight candidates, with local recall retained on backend failure.
Best For

Personal assistants and single-machine agent workflows that need cross-session text memory, offline recall, and a way to inspect why results ranked.

Skip If

You need a transactional shared store, concurrent writers, cross-device sync, native multimodal indexing, or strong paraphrase recall without operating a semantic backend.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

MCPSelf-HostedLocal AI
npm run check:downstream          # 列出每个下游与上游的文件差异
npm run check:downstream:strict   # 有漂移就 exit 1(发版前务必跑)

Comparison vs. Top RAG, Data & Memory Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
agent-memory ★81+19JavaScriptMITLocal JSONL agent memory with four-way recall, MCP, and optional semantic search
OpenViking43.2k+283PythonAGPL-3.0A directory-scoped RAG database for inspectable agent knowledge and memory
firecrawl216.7k+4.8kTypeScriptAGPL-3.0Local and hosted web ingestion that turns sites into RAG-ready Markdown
markitdown199.7k+950PythonMITPython library and CLI that turn mixed-format documents into Markdown for RAG in

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/yb-zhai/agent-memory.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

yb-zhai/agent-memory Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about agent-memory

Which entry point should I use, and can multiple clients share memory?

Use NebulaMemory from memory/index.mjs when your Node.js application should own the write and recall lifecycle. Use npx nebula-memory-mcp for a compatible MCP client that only needs local recall tools. Choose node server.js or the DSH plugin if you need the panel or optional Hindsight integration. Multiple clients on one machine can point NEBULA_DATA_DIR at the same directory, but each process has its own in-memory view. Enable watchExternalWrites for visibility into new writes without restarting; it does not make concurrent writers safe.

Does local recall need a GPU, and how should I size the deployment?

The local path needs Node.js and disk space, not a GPU, model runtime, or database. Size RAM and latency against your own corpus: one scale test measured roughly 7.4 KB of memory per node and 319 ms median recall at 100,000 entries. Hindsight adds PostgreSQL and an LLM backend; any GPU or VRAM requirement depends on the model you choose to run yourself.

Can I self-host Nebula Memory in a commercial product?

Yes. The MIT license permits commercial use and self-hosting, subject to retaining the copyright and license notices when redistributing copies or substantial portions. That permission does not establish data compliance: JSONL is plaintext, pattern-based redaction is not a substitute for secret management, and an optional Hindsight backend can change where data is processed.

When is Nebula a better fit than LangChain Memory, Mem0, or Zep?

Choose Nebula for a standalone, inspectable memory layer that runs offline without a database. LangChain Memory is a more natural fit when the application already lives in the Python/LangChain ecosystem. Evaluate managed offerings such as Mem0 or Zep if cross-device access or team administration drives the decision. Hindsight can add shared semantic retrieval, but it does not synchronize the local JSONL stores.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining yb-zhai/agent-memory? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature yb-zhai/agent-memory on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare