djasdh / interest-memory

已收录

Low-footprint memory backend for AI agents — single binary, ~50MB RAM, verify-augmented accuracy

main模型工具会话 查看源代码

安装

npx -y @deepseek-ai/dsh plugin --profile web add github:djasdh/interest-memory

此安装命令根据 GitHub 仓库地址生成,是未经验证的安装起点。

README

维护者编写的文档快照。

在 GitHub 查看 ↗
提交版本 7eae0cd同步于 2026年8月18日

English | 中文

interest-memory

interest-memory — Long-term memory for AI agents

One ~50MB process instead of a Postgres + Redis + vector DB stack.

Agents forget everything between sessions. Not the model's fault — they lack a real memory layer. interest-memory is a standalone memory backend: at the end of a session it extracts interest points from the transcript, verifies and cleans them, and writes them into a local knowledge base; at the start of the next session it recalls and injects relevant context. The entire footprint: one 18MB binary + one SQLite file. The unit of memory is the interest point: semantically similar ones are merged automatically, and each one is written into the knowledge base as a wiki page by an LLM-driven agent loop — the knowledge base converges with use instead of bloating.

Selling pointDetail
Lightone ~18MB binary + one SQLite file is the whole footprint; ~17MB idle, <75MB peak (measured), runs on a Raspberry Pi
Simpleone binary + one config file is a complete service; one-command curl install, no external DB, no cloud dependency (LLM/embedding can point at local Ollama/vLLM for fully offline use)
Extract at session endautomatically extracts interest points → verifies → writes to the local knowledge base
Recall at session startrecalls relevant memories → injects into context (concise entries only, full content on demand, minimal context pollution)
Multi-agent sharedone service for many agents (Hermes / OpenCode / Claude Code / Codex etc.), with isolated, fully-shared, or selective sharing
Full auditevery structural change is written to change_log, replayable
Interest-point convergencesemantically similar interest points are auto-merged or related instead of stacked — memory converges with use instead of bloating
Archive & evolvestale entries are marked superseded/archived (not deleted) with a replacement chain to the successor; GetByID reveals what superseded what — old knowledge is preserved without misleading
Semantic edgesthe LLM classifies 5 edge kinds while writing wiki pages: related / contradicts / sequel / references / has_page; structural changes propagate within 3 hops (cascade archive, replacement substitution, contradiction closure, content sync)
Graph walkhits are entry points into a memory graph, not isolated chunks: every result carries outlinks + backlinks (id/title/kind/weight), and search?id= jumps to a node and expands again — traverse point → neighborhood → network, beyond one-shot RAG
Evidence-backedevery entry carries evidence (web URL / turn / query); subjective preferences are never stored as facts; contradictions are closed in a loop

Quick start

One-command install (curl)

curl -fsSL https://raw.githubusercontent.com/djasdh/interest-memory/main/scripts/install.sh | bash

Auto-fetches the source → checks/installs dependencies → guides setup → optional systemd.

Configure the LLM (let your agent fetch and run it)

curl -fsSL https://raw.githubusercontent.com/djasdh/interest-memory/main/scripts/install_llm.py | python3 - --provider <provider>
# --help lists all providers; hand to your agent: it reads --help (its operating instructions) and configures itself

Pre-built binary (optional): Release v0.1.0 (linux / mac / windows)

Resource usage (measured)

MetricValue
Binary size~18 MB (cgo static sqlite-vec)
Idle memory~17 MB RSS (measured)
Pipeline peak<75 MB RSS
Initial footprint~20 MB (binary + empty DB)
Growth~38 MB after a week of use; mostly raw session transcripts (~71%)

session_transcripts keeps full raw text — trim externally to bound disk growth; fork.max_concurrency / verify.max_concurrency cap peak memory.

Integration

Multiple agent frameworks are supported out of the box, sharing one env set (INTEREST_BASE_URL / INTEREST_AGENT / INTEREST_TIMEOUT); a down service never blocks a session:

AgentForm
HermesMemoryProvider plugin ($HERMES_HOME/plugins/interest/)
opencodelocal plugin (~/.config/opencode/plugin/memory.ts)
openclawnative plugin (<configDir>/extensions/interest-memory/)
piTS extension (~/.pi/agent/extensions/interest-memory/)
Claude Codeofficial plugin + MCP (claude --plugin-dir bridge/claudecode)
Codexofficial plugin / hooks + MCP (~/.codex/hooks.json)
Reasonixofficial plugin + MCP (reasonix plugin install bridge/reasonix --link)
DeepSeek HarnessCordis plugin (dsh plugin --profile web add @djasdh/interest-memory-dsh-bridge, source bridge/dsh/)

Every bridge offers the same capabilities: session-start recall injection, session-end transcript push, and memory_search / memory_logs consumer tools. See bridge/README.md.

Architecture

internal/store/      SQLite (interest points/wiki pages/edges/claims/transcripts/change_log)
internal/vec/        sqlite-vec vector index (FTS fallback)
internal/llm/        OpenAI-compatible Chat/Embedding
internal/fork/       sliding-window split + parallel candidate extraction
internal/verify/     3-stage verification (check/claims/contradictions)
internal/wiki/       per-point agent-loop writer + related-page reconciliation
internal/recall/     recall injection + structured queries
bridge/hermes/       Hermes MemoryProvider plugin

Docs

  • REST APIPOST /api/v1/{agent}/sessions, GET /api/v1/{agent}/recall, search / logs / stats / jobs (table below)
  • Config — fully commented config.example.yaml (llm / embedding / fork / verify / wiki / recall / namespaces / interestmemory.kanban_exclude)
  • DevelopmentCGO_ENABLED=1 go test -race ./...; plugin tests node --test bridge/...; e2e bash scripts/e2e.sh

API quick reference

MethodPathDescription
POST/api/v1/{agent}/sessionssession-end transcript push → 202 job_id; optional kanban_board / kanban_board_name (board identity — when it hits kanban_exclude the push returns 202 + skipped and is never stored)
GET/api/v1/{agent}/recall?query=&after=&before=&days=recall injection (optional time filters)
GET/api/v1/{agent}/search?query= or ?id=&top_k=consumer query: full content + outlinks/backlinks; ?id= jumps to a node for graph walk
GET/api/v1/{agent}/logs?limit=&offset=change log (desc, paged)
GET/api/v1/{agent}/interest-pointslist interest points
GET/api/v1/{agent}/wiki/pages[?type=]list wiki pages
POST/api/v1/{agent}/forkmanually trigger forking
GET/api/v1/{agent}/jobs/{id}job status
GET/api/v1/{agent}/statsstats
GET/api/v1/{agent}/graphfull graph for visualization: nodes (interest points + wiki pages, medium fields) + edges (all kinds), id-collision prefixed
GET/api/v1/{agent}/graph.htmlembedded 3D viewer: dual-plane community layout, kind/status filters, node/link/plane-z sliders, search, click detail
GET/api/healthhealth check

Namespaces

Each agent ({agent} path segment / INTEREST_AGENT) has an isolated namespace; cross-namespace reads are configured via namespaces:

namespaces:
  mode: isolated   # isolated (default) | all | custom
  visible_to:      # custom only: one-way visibility declarations
    codex: [opencode, pi]

Shared results are annotated with origin ([from: <agent>] on recall lines, result.agent in search/get).

Kanban board exclusion

Kanban worker sessions push their full transcripts into memory. To keep certain boards (internal projects, transient orchestration cards, …) out of the memory base, list them in interestmemory.kanban_exclude — they are dropped at the ingest boundary: not stored, not embedded, not token-accounted.

interestmemory:
  kanban_exclude: ["default", "t_90c0c7ab"]   # exclude by board name or ID
AspectDetail
Default[] (empty array). Unconfigured or explicit [] behaves exactly like before: no board is excluded
What matchesThe board slug/ID (e.g. default) or its display name — either hit excludes
Matching rulesCase-insensitive (Defaultdefault); entries and board identity are both whitespace-trimmed; blank entries are ignored
Where it takes effectAt the POST /sessions boundary, before storage and before the worker queue — an excluded push returns 202 + {"skipped":"kanban_board_excluded"}, persists nothing and enqueues nothing, so embedding / fork extraction / token stats can never run for it
How it is wiredThe Hermes bridge attaches the board identity (HERMES_KANBAN_BOARD + display name) to worker pushes automatically, no extra setup; manual pushes can include kanban_board / kanban_board_name in the body

Dependencies

my-agent-core, mattn/go-sqlite3 (cgo static), sqlite-vec, goldmark-obsidian (wikilinks). All MIT-compatible.

License

MIT — Contributions are welcome whether written by a human or an AI — quality is what counts.

项目文件与信号

以下项目是目录快照中检测到的公开仓库信号。

插件清单已检测
安全策略已检测
贡献指南已检测
文档已检测

仓库信息

开发语言
Go
许可证
MIT
最新发布
v0.2.3
最后更新
2026年8月18日 16:08

谨慎安装

请检查源代码、权限、生命周期脚本、依赖与网络访问;不受信任的插件应先在隔离环境中测试。