heropen — AI Agent Memory

net.heropen由 heropen.net 發布v2.0.8更新於 Oct 30, 2026

Persistent memory for AI agents: local-first MCP server, zero-config. No cloud, no API keys.

發布方自己的服務:Memory.fit

已驗證STDIO僅桌面知識與記憶AI 與機器學習

概覽

AI 產生的概覽

為 AI 代理提供本地優先的長期記憶:在本地 SQLite 中儲存、檢索與整理記憶,並提供時間脈絡與工作階段檢查點。

可以做什麼
  • 搜尋、新增、更新與列出長期記憶,支援向量、全文與模糊比對回退
  • 在每次對話開場提供本地時間、時段詞與距上次對話的間隔
  • 自動儲存對話輪次、匯入本機用戶端既有的工作階段紀錄,並檢視或刷新待存輪次
  • 儲存與還原工作階段檢查點,方便在脈絡壓縮或重新啟動後接續
  • 檢查系統健康與連線狀態
適用情境
適合希望助理跨工作階段記住偏好、專案與過往決定、又不想依賴雲端服務的情境,也適合需要維持時間感與對話連續性的場合。偏好把記憶資料留在自己電腦上的使用者尤其合適。
執行需求
以本機 stdio 程序執行,從 PyPI 安裝(pip install heropen 或 uvx),透過 heropen-mcp 進入點啟動。需要 Python;選用擴充可加入本地向量模型或 Windows 系統匣圖示。不需 API 金鑰或帳號;可用 EMBEDDING_ENDPOINT 與 EMBEDDING_API_KEY 指向自架的向量端點。資料存放於本機 ~/.heropen 目錄。
安裝前請注意
此伺服器要求助理在每次對話開場及每輪回覆後呼叫其工具,會增加脈絡與工具呼叫的負擔。它會把對話內容寫入本機資料庫,並可讀取本機用戶端既有的工作階段紀錄。沒有刪除功能,記憶會持續保留,除非手動刪除對應的 SQLite 檔案。選用向量擴充會下載模型;若設定 EMBEDDING_ENDPOINT 與 EMBEDDING_API_KEY,文字會傳送到該端點。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 heropen — AI Agent Memory,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

heropen

[M8ven Verified]

English · 简体中文

Built to solve forgetting. The more you use it, the better it knows you.

A local-first memory system for AI agents. Memories live on your own machine — never uploaded, never synced, never taken away. heropen organizes and prunes them automatically, so retrieval gets sharper and more personal over time.

⭐ Did this help you? Give us a star → ★ Star in the top right, so more agent users find it.

In 30 seconds

  • One-line install: pip install heropen. No Docker, no Postgres, no API key. Common clients get their MCP config written automatically; Hermes and similar require wiring up heropen-mcp by hand.
  • Your agent gains long-term memory: it remembers people, events, and context across sessions — no more starting from zero every conversation.
  • Data stays 100% on your machine: no telemetry, no cloud sync, no bills. Memories live on your disk, and only you can take them away.

Install

bash
pip install heropen                 # Core: MCP + full-text search, pure-Python deps, any architecture (incl. ARM64)pip install 'heropen[embedding]'    # Optional: local embeddings (pulls in onnxruntime / fastembed)pip install 'heropen[tray]'         # Optional: Windows system tray badge (always-visible presence + workbench)

ARM64 notes

PlatformRecommendation
Apple Silicon (macOS arm64)Usually pip install 'heropen[embedding]' just works
Windows ARM64Same; make sure Python is an ARM64 build
Linux aarch64Install core first, then try embedding. If no onnxruntime wheel matches, point EMBEDDING_ENDPOINT at a self-hosted endpoint or use FTS only

Without local embeddings, search / recall degrade gracefully to full-text search — memory storage and retrieval keep working.

Restart your agent — done. On first launch heropen probes the known config paths of common clients (Claude Code, Cursor, Windsurf, WorkBuddy, etc.) and registers the memory tools. Custom mcp_servers setups like Hermes are not written automatically; follow "Connect your agent" below to configure them by hand.

Quick start in 30 seconds

bash
heropen add "Project uses FastAPI + SQLAlchemy, tests run on pytest"   # store a memoryheropen search "project tech stack"                                    # search memoriesheropen status                                                         # check statusheropen diagnose                                                       # diagnose problems

How to make it actually stick: read the official usage guide (single source of truth) — docs/usage-ssot-zh.md (Chinese). The short version: only facts go into heropen; the hot layer holds iron rules, high-frequency items, and pointers; start every session with prime, then search; free-form tags are the primary mechanism.

The first add does not download the ~95 MB embedding model — writes go straight to full-text search. When you want local semantic retrieval, run it explicitly:

bash
pip install 'heropen[embedding]'heropen embed          # download the model and generate embeddings for existing entries

Connect your agent (MCP)

Use the dedicated heropen-mcp entry point (stdio). heropen mcp also works, but prefer the form below in MCP client config:

json
{  "mcpServers": {    "heropen": { "command": "heropen-mcp", "args": [] }  }}

If heropen-mcp is not on your PATH (e.g. uv tool install into an isolated environment), replace command with the absolute path inside that environment.

For Claude Code / Cursor / Windsurf / WorkBuddy: heropen auto-setup attempts to write the known config paths. For Hermes and other custom config formats, add the block above to your own mcp_servers and restart the agent.

Restart your agent and it has memory. Store a bug fix once, and it is remembered permanently across sessions.

Tray badge (Windows system tray, heropen[tray])

With heropen[tray] installed, run heropen tray to pin a native heropen icon in the taskbar tray (same area as WeChat / Bluetooth / IME) — it covers no window content. It solves the problem of "a memory system with no presence, easily mistaken for junkware and uninstalled."

bash
pip install 'heropen[tray]'   # Windows onlyheropen tray                  # start the badge (auto-starts on boot by default)

Right-click menu:

ItemWhat it does
Status lineRunning · Free / Plus · N agents · N memories
Version vX.Y.ZOpens the changelog
Storage mode (per agent)Each agent independently picks bulk store / per-turn store / auto-detect
Open workbenchLeft-clicking the icon does the same — opens the live-data workbench page
Open homepageOpens heropen.net
Check for updatespip install -U heropen
Start on bootToggle (on by default; writes to the registry Run key)
Restart / QuitRestart to load the latest code / exit completely

Hovering the icon shows four pieces of self-explanatory status: identity (heropen agent memory system), storage mode, entries stored, and days in use.

Real data, no fabrication: the badge and workbench read the actual entries table from your local ~/.heropen/*.db. Nothing is hardcoded. When no database is readable it shows "no data / 0" and never invents numbers (--mock is for demos only). It reflects only the local database — memories from another machine (say, another agent on a different computer) do not appear here, which is expected (each machine's badge is independent).

Storage modes (wired into the core): the three modes control how often and at what granularity memories are committed to heropen — bulk store batches them, per-turn store writes each turn, and auto-detect picks intelligently based on trigger words such as "remember / decided / path / preference". Set per agent. The mode only governs commits — not retrieval, not what the tray displays; what gets written is still the local fact store. See docs/2.0-开场签名与存储内核.md (Chinese).

Interface languages (since 2.0.4): the tray menu's "Language" item switches between 简体中文 / English / 日本語 / 한국어 / Español / Français / Deutsch / Português / Русский. Menus, hover tooltips, notifications, and the workbench page switch instantly, and the choice persists locally (~/.heropen/_tray_state.json).

No delete feature: the badge, the workbench, and the CLI expose no deletion entry point whatsoever.

Opening signature

Before every conversation starts — before the agent actually begins working — heropen drops a single status line into context. You don't type a command, and you don't open a panel:

heropen ready · 187 local memories · ~3 hours since last conversation · agent=xiaokai

It is attached to the beginning of the MCP prime_conversation return value (the CLI bootstrap prints it too).

Presence in 2.0 = opening signature + tray: the signature covers "you see it while chatting", the tray covers "it's in your taskbar even when you're not."

Why heropen

heropen (free)Other options
StorageUnlimitedUsually capped
RetrievalUnlimitedMetered per call
Network requiredNoYes
Data ownershipYour machineTheir servers
InstallOne pip installServer + configuration

Free = the complete core feature set, with nothing crippled.

The position heropen holds

Local-first is not unique to heropen — a dozen similar projects run SQLite + MCP. What heropen genuinely holds, and others have not yet taken, is three things:

  • Private-domain / shared-domain layering across multiple agents. The free tier gives you 8 fully private agents (high-frequency always-on agents like Hermes and WorkBuddy each get an isolated database), plus an optional shared domain (_shared) for exchanging knowledge between agents on demand. Free and Plus differ in capability, not count (Plus adds real features such as skill collection and sharing). Most competitors offer only a single flat namespace.
  • Time awareness before a conversation (since v1.8.7). At the start of each session the agent automatically receives local time, the time-of-day word, the interval since the last conversation, and whether a sleep cycle was crossed — a temporal baseline on the interaction side that nobody else provides.
  • A zero-dependency install surface. One line of pip install heropen, with no Docker, no Postgres, and no Ollama.

Privacy commitment

Your data stays on your machine. No telemetry. No heartbeat ping. All memories live in a local SQLite database. Vector retrieval uses a local embedding model by default (fastembed; pip install heropen[embedding]) — fully offline and free. You can also point the EMBEDDING_ENDPOINT and EMBEDDING_API_KEY environment variables at your own self-hosted embedding endpoint (OpenAI-compatible /v1/embeddings), so you never pay a third-party cloud.

If neither local embeddings nor a self-hosted endpoint is configured, search falls back to fast full-text (FTS) matching — still fully offline and free. pip install heropen works with zero configuration; embeddings only improve retrieval quality and never block basic use.

Local capabilities stay local (currently): in the current version, local memory read/write, retrieval, and panel capabilities will not be migrated into services that require network access; capabilities already available in the free tier will not be reduced in later versions.

Why local

When memory is turned into a cloud primitive, your conversation history and working context end up on someone else's servers. heropen chooses the opposite: memories are written to ~/.heropen/, one SQLite file per agent, and the data never leaves your machine.

What the cloud gives you is convenience; what local gives you is that only you can take it away.

The memories are yours

Memories live in your local ~/.heropen/ directory, one SQLite file per agent. At any time you can:

  • Back up / export: heropen export dumps all memories to a local JSON file (heropen import reads it back in);
  • No delete feature: heropen provides no delete / clear entry point — memories are locally under your control and exportable, but there is deliberately no "delete" button anywhere, to prevent unrecoverable mistakes (there is no cloud copy; deleted means gone). If you really need to clean up, simply remove the corresponding SQLite file under ~/.heropen/ — no need to go through us, and no network required.

A friendlier Markdown + YAML export (human-readable, lossless round-trip, re-importable) is on the roadmap.

How to choose

When choosing a memory solution, don't look only at recall — look at five things:

  1. Deployment cost: does one pip install get it running, or do you need Docker / Postgres / Ollama / an API key?
  2. Dependencies and cost: does the write path burn LLM tokens? Are there zero external dependencies?
  3. Portability: can memories be exported as readable files, carried elsewhere, and re-imported?
  4. Secure defaults: does the listening port bind to loopback or 0.0.0.0 by default? Is it telemetry-free?
  5. Engineering tax: are write discipline and invalidation mechanisms clear? Is it compatible with prompt caching? How are cross-model capacity limits handled?

Run heropen doctor and it self-checks all five, giving each a pass / notice / warning verdict.

Versions and positioning

VersionPositioningWho it's for
FreeDoes the one thing — memory — well: local, private, better the more you use itAnyone who wants long-term memory for their agent, running on their own machine
PlusGreat memory + serving your work: the first feature is skill collection and sharing, so what you've remembered is reused across agentsSolo founders / indie developers willing to pay for continuous new features
EnterpriseA memory foundation for many employees × many customers (self-hosted + isolation + audit)Organizations where many employees serve many customers

The free version is fully open source (Apache-2.0); Plus / Enterprise are closed source.

Compliance statement

heropen is a local-first memory and context tool: your data always stays on your machine, fully under your control. The local-first architecture inherently satisfies requirements around user data control and transparency — its operation is transparent and controllable to you.

Open-source scope

The free version is fully open source (Apache-2.0). The commercial layer (Plus / Enterprise) is closed source.

Links & support

⭐ If you like it, star it — that's the biggest support you can give us: click ★ Star.

Roadmap

  • Currently focused on desktop, local use. Mobile / cross-device sync is out of scope for now — it conflicts with the default promise that "data never leaves your machine". If it is ever built, it will necessarily take the form of user-owned storage + end-to-end encryption + off by default.
  • Markdown + YAML memory export (lossless round-trip).
  • More productized private-domain / shared-domain capabilities across agents.

License

Apache-2.0

來源:README.md,提交 1ae000b

工具

12

search_memory

搜索用户的长期记忆。在以下情况必须调用: - 对话开始时,了解用户背景和历史 - 用户提到人名、项目名、偏好等关键词时 - 用户询问"还记得吗"或类似问题时 不要等用户要求才搜索。主动搜索能让你更懂用户。三层回退:向量 → 全文 → 模糊匹配。 Args: query: Keywords to search for. Use the user's own words or inferred topics. limit: Max results (1-20, default 5). agent: Which agent's memory to search (default: auto). date_from: Only return entries on or after this date (YYYY-MM-DD). date_to: Only return entries on or before this date (YYYY-MM-DD).

輸入參數agentlimitquery必填date_todate_from

prime_conversation

对话开始前必须调用:获取当前时间上下文(heropen 自动生成)。 返回自然语言时间区块,包含:当前本地时间、时段词、距上次对话间隔、 是否跨睡眠周期(区分"工作-短休息-工作"与"工作-长休息-继续工作")、 今日对话轮次、以及相对时间词锚点提示。 把这段文本作为上下文读入,你的寒暄与对"明天/下周"等相对时间的理解才有据可依, 不会出现"晚上说早上好"或把用户凌晨说的"明天"误判为字面次日。 返回内容开头会带一行「开场签名」(品牌 + 状态),形如: heropen 已就绪 · 本地记忆 187 条 · 距上次对话约 3 小时 · agent=xiaokai Args: agent: Which agent's context to prime (default: auto).

輸入參數agent

add_memory

保存信息到用户的长期记忆。在以下情况必须调用: - 用户分享了新的偏好、习惯、约定、项目信息 - 对话中产生了需要后续跟进的事项 - 对话即将结束时,保存本次产生的关键信息 优先主动保存,不要等用户说"记住这个"。content 上限 5000 字。 Args: section: Category/topic for this memory (e.g. '用户偏好', '项目状态', '对话记录'). content: The information to remember (max 5000 chars). Write it clearly so future you can understand it. tags: Comma-separated keywords for better search. agent: Which agent's memory to write to (default: auto). entry_date: Date for this entry (YYYY-MM-DD, default: today).

輸入參數tagsagentcontent必填section必填entry_date

auto_save_turn

宿主在每轮 assistant 回复完成后调用一次;事务式接收完整话轮。 自动模式按重要内容或累计信息量触发写入,最迟十轮;十轮模式累计十轮;每轮模式立即保存。 只有实际调用才会计数,不会自行读取对话。待存轮持久化于数据库,不触碰旧 JSON。 source 固定 auto_turn;不自动追加标签。请勿用本工具替代断点(session_checkpoint)。 Args: content: 本轮 assistant 回复原文;与用户输入合计超过 1,000,000 字符会拒绝,不截断。 agent: 哪个 agent 的记忆(默认自动)。 user_content: 可选,本轮用户输入原文。 section: 原始分类(默认空字符串)。 tags: 原始标签(默认空字符串,原样保存)。 conversation_id: 批次隔离标识,不是读权限隔离;空字符串为独立默认会话。 turn_id: 当前会话内稳定的话轮标识,重试必须复用且保持 conversation_id 不变。 省略时生成 ID,须复用返回的 turn_id 重试;无 ID 重试无法幂等。 同 ID 同请求返回 duplicate,同 ID 不同正文或元数据会拒绝。 Returns (JSON): saved / parts (int): 本次新建 entries 数;parts 不是列表。 flushed (int): 本次关联到 entries 的轮数,不是条目数。 received_turns (int): 当前会话累计接收轮数,重复请求不增加。 pending_turns (int): 当前会话待存轮数。 buffered (bool): 当前轮是否仍待存,不是待存轮数。 duplicate (bool): 是否为重复话轮;entry_id 为当前轮关联条目或 null。 entry_ids (list[int]): 本次新建条目 ID。 conversation_id / turn_id (str): 会话与话轮标识。 generated_id (bool) / idempotency_warning (str): ID 生成情况及重试提示。 configured_mode / mode / reason (str): 配置模式、本轮判定模式及原因。 last_received_at (str | null): 当前会话最近接收时间。 source 固定 auto_turn,embedding / graph 为 deferred。 助手回复为空时 skipped=true,不计为完整轮。

輸入參數tagsagentcontent必填sectionturn_iduser_contentconversation_id

ingest_local_turns

主动读取本机客户端会话记录,把真实完整话轮补交给轮次存储。 适用场景:宿主没有在每轮回复后调用 auto_save_turn,导致自动累计空转 (received_turns 恒为 0)。本工具不需要宿主配合,直接读取客户端已写在 磁盘上的会话记录;不修改客户端配置、不安装钩子、不改动客户端数据。 只使用记录里原生存在的会话与轮次标识作为幂等键,因此可安全重复调用, 不会重复计数;用户输入与助手回复均取自记录原文,不会生成或补造内容。 注入块(system-reminder、task-notification、浏览器上下文等)不是用户 发言,已剔除;只有除注入块外没有真实用户输入、或没有助手回复的轮次会 被跳过,绝不伪造。 Args: source: "all"(默认,读取所有已知客户端)、"zcode" 或 "workbuddy"。 apply: 默认 False 只统计不写入(可先看将要提交多少轮);True 才真正提交。 include_subagents: 是否一并读取子代理会话(默认否,子代理对话通常非人类主会话)。 Returns (JSON): considered / submitted / skipped_incomplete (int): 候选 / 提交 / 跳过轮数。 duplicate / saved / buffered (int): 重复未计数 / 本次新建条目 / 仍待存轮数。 per_source (dict): 按客户端分别返回上述计数,便于定位哪一端读到了多少。 conversations 在单选来源时返回按会话的计数,用于核对第 1—9 轮递增、 第 10 轮存档。 source / apply (str | bool): 数据来源与实际是否写入。

輸入參數applysourceinclude_subagents

turn_storage_status

只读查询 agent 的事务式话轮存储状态;不创建数据库、不初始化 schema、不刷新待存轮。 返回 JSON:database_exists (bool)、received_turns / pending_turns / saved_turns (int) 为该 agent 全部会话的累计接收 / 待存 / 已存轮数,buffered (bool) 表示是否有待存轮。 conversations 按 conversation_id 返回各会话上述计数和 last_received_at。 conversation_id 仅用于批次隔离,不是读权限隔离;此工具可查看该 agent 的全部会话计数。 不读取、迁移或删除旧 JSON 缓冲。

輸入參數agent

flush_turns

显式保存指定会话的全部待存尾批,即使不足十轮;不修改其他会话或旧 JSON。 Args: agent: 哪个 agent 的记忆(默认自动)。 conversation_id: 批次隔离标识,不是读权限隔离;空字符串仅刷新默认会话,非全部会话。 Returns (JSON): saved / parts (int): 本次新建 entries 数;flushed (int): 本次写入关联的轮数。 received_turns / pending_turns (int): 当前会话累计接收 / 剩余待存轮数。 buffered (bool): 当前会话是否仍有待存轮;entry_ids (list[int]): 本次新建条目 ID。 conversation_id (str): 本次刷新会话;其余状态字段由事务引擎原样返回。

輸入參數agentconversation_id

update_memory

Update an existing memory entry. Only provided fields are changed.

輸入參數tagsagentcontentsectionentry_id必填entry_date

list_memory

列出用户的记忆列表。用于概览已有记忆、检查冗余、了解记忆总量。 Args: limit: How many recent entries to show (max 50, default 10). agent: Which agent's memories to list.

輸入參數agentlimit

health

Check heropen system health and connection status. Call this when you start up to verify everything is working. If pending_setup is true, it means heropen was just installed — show the welcome_message to the user and ask if they'd like to complete the setup. Args: clear_pending: Set to true after completing initial setup to clear the pending marker.

輸入參數clear_pending

session_checkpoint

Save a session checkpoint. Call periodically during long conversations so the agent can recover context after compression or restart. Args: agent: Which agent's memory context_summary: Summary of current conversation context active_task: What task is currently being worked on key_decisions: Comma-separated key decisions made so far tags: Extra comma-separated tags

輸入參數tagsagentactive_taskkey_decisionscontext_summary

session_recover

Recover the most recent session checkpoint(s). Use after context compression or agent restart to pick up where you left off. Args: agent: Which agent's memory limit: Number of recent checkpoints (default 1, max 5)

輸入參數agentlimit

版本歷史

6
  1. v2.0.8最新Oct 30, 2026
  2. v2.0.7Oct 26, 2026
  3. v2.0.6Oct 23, 2026
  4. v2.0.5Oct 22, 2026
  5. v2.0.0Oct 6, 2026
  6. v1.9.6Sep 21, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Memory 整合