Repository avatar
AI Tools
v0.3.14
active

neocore

io.github.VincentPorquet777/neocore

One local memory shared by Claude Code, Codex, Cursor and Hermes. Zero model calls at recall.

Documentation

NeoCore

test License Python VincentPorquet777/neocore MCP server

One local memory for Claude Code, Codex, Cursor, Gemini CLI and Hermes. Zero LLM calls on recall.

Demo: on Monday you tell Claude Code to keep a database dump until Friday. On Tuesday you ask Cursor whether you can delete it; NeoCore's search returns Monday's line word for word, dated and marked as coming from Claude Code, in 22 ms with zero model calls, and Cursor answers: not yet.

pipx install "neocore-memory[embed]" && neocore setup

Tell one agent something on Monday; any of the others can quote it back on Tuesday, word for word, with the date and the tool it came from. Everything lives in one SQLite file on your own machine: no account, no API key, no cloud. neocore setup finds the AI tools you have and wires them all up (details).

NeoCore
LoCoMo (10 conversations, 1,540 questions)87.5% (gpt-4.1-mini reader)
LongMemEval-S (500 questions)89.6% (gpt-4.1-mini reader, gpt-4o judge)
Governance: leaks under maximal pressure0 leaks in 1,540 questions (an ungoverned store leaked on all 1,540)
Model calls per recall0: p50 22 ms, offline

All numbers come from this repository's code (evals/), run through the public package; the only models are the benchmark's reader and judge. See Evals for the setup and the honest caveats.

Why not just a CLAUDE.md? Keep it: a CLAUDE.md or AGENTS.md is the right place for the rules you write down by hand. But every agent reads all of it, every time, and it only knows what you remembered to write. NeoCore keeps what was actually said, across every agent and machine, and brings back only the few lines this prompt needs.

What it is

Long-term memory for AI assistants that recalls only what the moment needs, and never what it shouldn't.

NeoCore gives every AI harness you use one memory: Claude Code, Codex, Hermes, Gemini CLI, Cursor, GitHub Copilot CLI and opencode read and write the same memory of everything you told them, on all your machines. Tell Codex something at your desk; Hermes knows it on Telegram tonight. It can also be dropped into any assistant as a Python library. Recall makes zero LLM calls: it is local, takes milliseconds and costs nothing (the optional NeoSift filter is a small local model on your graphics card, no API either). Every recalled line is quoted verbatim and dated, with a receipt pointing to its source. Governance (who may see what, what was revoked, what was corrected) is enforced at recall time, not left to the model.

Why another memory?

The context window is small and your history is large. Most memory layers either stuff the window with everything that matches, or call an LLM on every turn to decide what to remember and recall. NeoCore starts from a different idea. Think of how a person remembers: you don't scan your whole life to answer a question. You recall the few things this moment is about. You trust that what you recall is still true, and you know what you were told in confidence.

  • Relevant, not just similar. Hybrid recall (BM25 + local embeddings, fused) is spent on a byte budget in order of relevance. An optional relevance filter keeps only what helps with this prompt. A chat is never sent again what it already holds.
  • Newest wins. A nightly "sleep" pass groups related facts and retires the stale ones ("the API runs v1.17" gives way to "the API runs v1.18"). A retired fact never arrives without what replaced it.
  • Learns from mistakes. When something went wrong, a "Lesson:" is formed and shown first next time ("never deploy the worker while a job is running").
  • Governed by construction. Scopes, revocation, audited erasure, edited messages (only the latest revision counts) and abandoned conversation branches are all filters applied before ranking. A fact is recalled only while every message it came from may be.
  • Exact and traceable. Excerpts are verbatim slices of what was said. Their offsets point into the stored message. Relative dates are resolved (last Friday [= 19 May 2023]) and clearly marked as NeoCore's note, not speech.
  • One memory, every harness. What you decided with Claude Code on Monday is there for Codex and Hermes on Tuesday, and the other way round. Every item says which AI and project it came from.
  • Knows you from the first message. A new chat starts with a short briefing built from your facts: who you are, how you like to work, what you are working on.

Quick start: Claude Code and Codex

pipx install "neocore-memory[embed]"
neocore setup

neocore setup does four things:

  • downloads the bge-small embedder (~65 MB; for memories in other languages, --multilingual);
  • adds a prompt hook and a stop hook to ~/.claude/settings.json (merged, backup kept);
  • adds an MCP server and the same hooks to ~/.codex/config.toml (inside marked lines);
  • writes ~/.neocore/config.json;
  • sets up any other AI tool it finds on the machine.

Codex will ask you to trust the new hooks the first time they run. neocore uninstall removes the hooks and keeps your memory. neocore doctor checks the install. Run neocore setup --dry-run to see the plan first.

Memories in another language

The default embedder reads English. If you write to your assistant in French, Arabic, Chinese or any of about 100 other languages, use the multilingual one (multilingual-e5-small, ~135 MB):

neocore setup --multilingual          # on a new install
neocore embedder multilingual         # later; `neocore embedder english` switches back

On the same 20 memories written and asked in five languages, the right memory came back within a 900-byte recall:

LanguageEnglish embedderMultilingual embedder
English20/2020/20
French16/2017/20
Spanish16/2017/20
Arabic2/2018/20
Chinese9/2020/20

Keep the English one if you write in English: on the 470 LongMemEval-S questions, all the evidence reached the recalled context for 72.3% with the multilingual embedder against 74.0% with the English one (some of it: 88.7% against 91.5%).

Switching drops the old model's vectors; the next syncs embed your memory again, a batch at a time, and recall stays word-matched for what is not embedded yet (--now embeds it all at once). NeoSift reads English, so prompts in other languages skip it and get unfiltered recall. Which prompts count as English is a quick check, not a language detector: letters outside ASCII and common words of about ten other languages. On 2,767 real English prompts it took one (a pasted terminal log) for another language; a short prompt in a language it has no words for can still be read as English and filtered.

Or as a plugin

The same hooks and memory tools also come as a Claude Code plugin and a Codex plugin. Install the package first (the plugins run the neocore command), then set up the memory folder without touching your settings files:

pipx install "neocore-memory[embed]"
neocore setup --no-claude --no-codex

Claude Code:

/plugin marketplace add VincentPorquet777/neocore
/plugin install neocore@neocore

Codex:

codex plugin marketplace add VincentPorquet777/neocore
codex plugin add neocore@neocore

Pick one way per tool. If neocore setup already added its hooks, the plugin's hooks stay quiet, so each prompt still gets its memory once.

Two more packages, for directories that don't accept hooks or a local server:

  • integrations/openai: a skills-only plugin for the ChatGPT and Codex plugin directory (desktop only). Its get-started skill installs NeoCore with your go, then the memory tools and hooks above take over.
  • Dockerfile: the memory server alone (MCP over stdio), for MCP directories and container clients. Memory lives in /data.

PRIVACY.md says exactly what is stored and what leaves your machine; TERMS.md has the terms of use.

After setup:

  • Every prompt gets the memory that matters, as hook context, in well under a second. A warm local daemon serves it. A chat's first prompt also gets your briefing.
  • Memory tools for the AI to look further on purpose: neocore_search, neocore_open, neocore_timeline, neocore_facts, neocore_profile and neocore_remember. Use kind=turns on neocore_search for the original wording of a decision. The default lists facts first.
  • Every finished reply starts a background sync. It reads new turns from Claude Code and Codex transcripts (prompts and final replies only; tool output is skipped and obvious secrets are redacted) and indexes them.
  • In the background, your own Codex or Claude Code sign-in forms dated facts, runs sleep and writes lessons (see neocore.llm). No API key is needed. Nothing is sent anywhere else.
  • Relevance filter (NeoSift): on a machine with a graphics card, setup installs NeoSift, NeoCore's own small model that keeps only the memories that help with this prompt. It is free and local. Without a graphics card, set OPENROUTER_API_KEY before neocore setup to use a small hosted decision model instead (~$0.0007 per prompt), or recall injects its top matches within the budget.
  • Help improve NeoSift (opt-in): setup asks once whether to share prompts and recalled memories to train NeoSift. It is off unless you say yes. See what is shared.

Useful commands:

neocore recall "how did we deploy the worker last time"
neocore status            # counts and configuration
neocore stats --days 7    # live relevance, latency, errors, and prompt cost (below)
neocore forget claude-code:<session-id>   # erase a conversation for good (audited)
neocore forget claude-code:<session-id> --dry-run   # what it would delete; changes nothing
neocore sift status       # NeoSift: installed, graphics card, in use
neocore share status      # opt-in sharing: on/off, rows waiting and sent

Recall makes no model call, but the answering model still reads what it adds, and where that text sits decides whether the host's prompt cache survives. NeoCore attaches it to the newest message, after the stable system prompt, so the cached prefix is untouched. neocore stats shows the real price under prompt_cost: per host, the memory that actually reached a chat (estimated tokens) next to the fresh input, cache reads and cache writes Claude Code and Codex recorded for their model calls in the same days. It reads only their usage counts, never the conversation text.

Rules check: your standing rules, at the moment of action

Recall finds what a prompt is about. A rule such as "never force-push" has to hold when nobody mentions it, so the rules check looks at what the AI is about to do instead: a tool call about to run, or the reply about to end its turn. It makes no model calls; each check is a few regular expressions with a 2-second limit, and any error lets the AI carry on.

# hold a matching shell command once, with your words, so the AI checks it against the rule
neocore rules add no-force-push --statement "Never force-push; open a pull request instead." \
  --tool @shell --input 'git\s+push\b.*--force'
# send a reply back once if it breaks the rule
neocore rules add ticket --statement "End every reply with the ticket number, like [T-123]." \
  --require '\[T-\d+\]\s*$'
# list it at every session start
neocore rules add spelling --statement "Use British spelling." --standing

neocore rules list        # every rule and whether it is live
neocore rules check --tool Bash --input "git push --force origin main"   # dry run
neocore rules stats       # how often each rule fired, and what the AI did next
neocore rules off         # pause it (no settings change); `neocore rules on` to resume
  • Hold once (--tool/--input): the first matching tool call in a turn is stopped with the rule and your words; if it still fits the rule, the AI runs it again and it goes through. --mode note lets it run with the rule as a reminder instead (Claude Code). Tool families: @shell, @write, @agent, @browser_builtin, @browser_chrome.
  • Send back once (--forbid, --require, --max-words, --max-items, with --when and --unless): at most once per turn of yours, never in a loop.
  • No rules, no hooks. neocore setup adds the rules hooks only while you have rules, and only the events they need; neocore rules add, remove and build keep them in line on every host NeoCore is set up on. neocore uninstall removes them with the others.

Rules live in ~/.neocore/rules/rules.source.json; edit it by hand and run neocore rules build. Only records build stamped ever fire. A rule can quote you from a transcript (--words "..." --source FILE --line N, or owner_source in the file); the build refuses it unless your words are on that line word for word. Every firing is logged locally in ~/.neocore/rules/log.jsonl.

Learnt rules: the corrections you keep making

You should not have to write every rule yourself. When you correct an AI ("write names in full, no abbreviations"), it reports the correction with the neocore_feedback memory tool, in the same turn and with no extra model call. Everything after that is counting and dates:

  • Learnt once two different conversations make the same correction. From then on the rule rides with the briefing at the start of every chat, on every AI sharing the memory.
  • Confirmed when an AI reports it applied, or you correct it again in another conversation. That second correction is also counted as "broken 1x", and the briefing lists the most broken rules first, because a rule that keeps being broken needs the most attention.
  • Retired when nothing touches it (45 days while learning, 180 once confirmed), when you say the opposite in two conversations, when it is reported out of date, or when you reject it. neocore prefs pin ID keeps a rule from expiring.
neocore prefs list          # rules in force (--all: retired ones, and corrections still counting)
neocore prefs add "client emails" "Use British spelling in client emails."
neocore prefs pin pref-1a2b3c4d5e
neocore prefs reject pref-1a2b3c4d5e
neocore prefs log           # every change, oldest first

Learnt rules live in ~/.neocore/preferences.json, with every change in preferences.log.jsonl. On a shared memory server each rule stays in the memory its corrections came from.

Change log and undo

Every change to what the memory knows is listed in ~/.neocore/changes.jsonl: each background pass that formed facts, slept, wrote lessons or refreshed the briefing (with the facts it added and the files it changed), each note an AI was asked to remember, each forget, and each undo.

neocore changes           # newest last, learnt-rule changes included
neocore undo --list       # passes that can be taken back
neocore undo RUN          # delete the facts that pass added and restore the files it changed

Undo never touches what you said (the turns themselves); neocore forget deletes those for good. The undo runs are kept: forget takes out of them only what would bring the forgotten text back (facts an undo would put back, a forgotten message to restore, briefings and learnt-rule quotes resting on it), and every other undo still works. An undo waits for a forget that is running (and a forget for an undo). It puts back no briefing resting on a message or fact no longer live, and no verdict or date on a fact gone for good; a fact a correction withdrew keeps its verdict and dates, so undoing that correction brings it back with them. Passes are undone newest first when they changed the same files. The copies cost no disk space until a file changes (hard links), and the last 30 passes are kept.

Hygiene and corrections

neocore hygiene                          # report only, no model call
neocore hygiene --apply                  # merge same-wording duplicates (one undoable change)
neocore correct FACT_ID                  # what rests on this fact
neocore correct FACT_ID --to "The memory server listens on 8795." --apply
neocore correct MESSAGE_ID --apply       # withdraw a wrong message and the facts formed from it

Fact and message ids are the ones neocore_search and neocore_open show your AIs.

  • hygiene lists facts with the same wording that are not merged yet, facts on the same subject that give different values (a port, a version, an amount) where nothing yet says which is current, and learnt rules on overlapping topics. Only duplicates are ever changed.
  • correct first shows the blast radius: the facts formed from the same messages, the lessons among them, and whether the briefing uses any of them. With --apply a fact correction is stored as a note plus a new fact, and the wrong fact is marked replaced by it (recall shows the correction beside it). A withdrawn message takes its facts out of recall at once.
  • Both go through the change log: neocore undo takes a correction back, a withdrawn message and its facts included, without a model call.

Measured on a real memory of 17,323 facts that the background pass (sleep) already tidies: the report took 2 s and flagged nothing. Against the 1,563 pairs sleep's model had judged replaced, the value check would have caught 6; lowering its threshold to catch 33 mostly flagged different projects that happen to carry different version numbers. So it is a free safety net, strict on purpose, for memories without sleep; it does not replace sleep.

Why did my assistant still say that? neocore inspect

neocore inspect last                     # what the last answer was given, and where each piece came from
neocore inspect "which port does the memory server use"   # a fresh recall, as a new chat gets it
neocore inspect --list                   # recent answers that were given memory
neocore inspect --correct MESSAGE_OR_FACT --to "It listens on 8795." --apply "QUESTION"
neocore inspect --forget MESSAGE_OR_FACT --reason "wrong" --apply "QUESTION"
neocore viewer                           # the same as a page, on this computer only

No model is called by any of it. Each recall notes the question and the ids it supplied in answers.jsonl (never the memory text; "answer_log": false in config.json turns it off). inspect shows each supplied message with its chat, assistant, project and date, then what was built on it: the facts formed from it, the same claim formed again from other chats, the facts it replaced, the briefing using it, date ranges, learnt rules and why records. --json prints all of it.

Correct and forget cascade through everything derived. Every fact citing the message is withdrawn, including facts other messages also support (the safe choice: they are listed for review instead of kept with a citation missing). The same claim formed elsewhere goes too, the older facts it replaced point at the correction, and briefings built on it are removed until the next sync. Without --apply you see the plan; with it you get a receipt: the question recalled before, then again from a reopened memory with its index brought up to date, and "it holds" only if nothing withdrawn and none of its wording comes back. A correction is undoable (neocore undo); forget is permanent and also clears local copies quoting the text (pending checks, the opt-in NeoSift queue, the answers log, learnt-rule quotes). The same claim formed from other conversations is deleted with it, and only that can be put back: forget prints the neocore undo <run> that does it. Limits, so a common phrase never blanks an unrelated copy: a message under 12 characters (ignoring spacing, case and punctuation) is not blanked from other copies; in other chats a quoted fragment under 6 words (or a forgotten message under 6 words) is not blanked; and wording a message you keep also holds is kept, since the copy may quote that message.

neocore viewer serves the page on 127.0.0.1 at a random port with a token made for that run, refuses requests without it, loads nothing from the internet and stops after 30 idle minutes. It cannot verify what lives outside NeoCore and says so: chats that already received the text, summaries a host keeps itself (Hermes), and exports or backups made earlier.

When a fact holds

Every fact has a range: from the day it happened until the day a newer fact replaced it, or until a date set for it. Your AIs can see it and ask about it:

  • neocore_facts with as_of: "2026-11-05" lists what held that day, facts replaced since included; without it, facts that were replaced or whose end date has passed are left out.
  • neocore_open on a fact says "Holds: from 2026-11-01 to 2026-11-09 (replaced by fact_…)".
  • neocore_remember takes from and until for things that only hold for a time ("the office is closed until 2 January", "the new price applies from 1 December"); recall marks them (until …), (from …) or, once past, (ended …).
neocore valid FACT_ID --until 2026-12-31   # or --from DATE, or --clear; undoable

Ranges come from what the memory already has, with no model call: on the real memory above, sleep's verdicts give about 1,660 facts an end date. Set dates live in validity.json, which the change log, undo and backup all cover.

Read it, keep it: Markdown export and one-file backup

neocore export ~/NeoCore-vault     # Markdown notes; open the folder as an Obsidian vault
neocore backup ~/neocore-2026-11-19.zip
neocore restore ~/neocore-2026-11-19.zip [--force]
  • Export writes the briefing, learnt rules, lessons, the current facts by month and one note per conversation; each fact links to the conversations it came from. Withdrawn and forgotten messages, and the facts resting on them, are left out. Exporting again replaces only the notes NeoCore wrote, so notes you add in the same folder stay. The memory itself stays in its database: the export is for reading, searching and keeping.
  • Backup is one zip: a consistent copy of the database, taken while your AIs keep working, and the files that hold what the memory knows, each with a SHA-256. Downloaded models, keys and device links are left out. Restore checks every hash first, stops NeoCore's own daemon, and moves the files it replaces aside instead of deleting them.
  • A backup is your own file: neocore forget cannot reach into backups made before it.

Bring your past conversations: neocore import

Your old chats can come into NeoCore. Then Claude Code, Codex, Hermes or any other assistant that shares the memory can quote them back, with the date they were said.

neocore import chatgpt ~/Downloads/chatgpt-export.zip --list   # what is in it
neocore import chatgpt ~/Downloads/chatgpt-export.zip          # preview: nothing is written
neocore import chatgpt ~/Downloads/chatgpt-export.zip --yes    # import it
neocore import claude ~/Downloads/claude-export.zip --only "bike repair" --yes
neocore import claude-mem --since 2025-01-01 --yes             # reads ~/.claude-mem
  • Sources. A ChatGPT data export, a Claude.ai data export (the ZIP, the unpacked folder, or its conversations.json), and the claude-mem plugin's store (~/.claude-mem/claude-mem.db, or CLAUDE_MEM_DATA_DIR).
  • Choose. --list shows each conversation with its id, dates and message count. --only takes an id or words from a title, and can be repeated. --since and --until take dates; a prompt and its replies always come in together.
  • Preview first. Without --yes nothing is written, not even a new memory file. You see the counts, the date range and a few sample lines.
  • Safe to run again. Each message keeps its id from the export, so a second run adds nothing. A newer export adds only what is new, and a reply you regenerated since replaces the old one in recall. When you edited a prompt since, the turns of the old branch are set aside (kept, but out of recall); they come back if a later export shows that branch again. Dates given with --since or --until never set aside a turn the chat still shows. A message you forgot never comes back, and one you withdrew stays withdrawn, whatever export, branch or dates you import.
  • What comes in. The words you and the assistant said, with the original times. For ChatGPT, only the branch the chat showed (an edited message leaves the old branch out), and voice-mode transcripts as text. Images, files, tool calls and their output, and hidden reasoning are skipped and counted; a prompt with no words (only an image, a file or a recording) still opens its own turn, so its reply stays apart, but nothing is stored for it. Secrets are scrubbed as for live capture, and a broken character (half of an emoji) is replaced.
  • claude-mem. Opened read-only. Your prompts come in as yours. Its observations and session summaries come in as notes from claude-mem, labelled [claude-mem observation] and [claude-mem session summary]. A prompt NeoCore already captured from Claude Code, word for word, is not stored twice. The reader follows claude-mem's SessionStore tables (sdk_sessions, user_prompts, observations, session_summaries, old and new column names). It looks the columns up and skips what it cannot find.
  • Governed like the rest. Each conversation is stored as import:chatgpt:<id> (or import:claude-ai:, import:claude-mem:), in the internal scope (--scope to change). Recall labels it, for example ChatGPT (imported). Revoke or forget it like any conversation; neocore forget 'import:chatgpt:*' removes a whole import, and forgotten messages stay forgotten if you import again.
  • On a memory server. A device connected with neocore connect recalls only from the server, so import refuses there (--list still works). Run it on the server, with NEOCORE_HOME set to the server's memory folder (~/.neocore/server by default) and --scope set to a scope your keys read.
  • No model, no network. The import and recall make no model calls and no network calls. Big exports are read one conversation at a time; attachments are never opened (a 205 MB test export previewed in 10 s using under 40 MB of memory). If background facts are on, later syncs form facts from these messages a few batches at a time with your model. --no-facts keeps the messages that run adds or brings back out of that, and the mark stays with them when they are set aside and come back. A turn that is set aside loses its facts; if it comes back, they are formed again (the import says so), unless its messages carry that mark. A reply stored again when you switch the chat back to it is the same message: it keeps its facts and its mark, and the import says when it kept the mark. Only new text, such as a newly regenerated reply, arrives with no mark: facts are formed from it unless that import also uses --no-facts, and the import's Facts: line counts it.

Check it stays local: neocore doctor --network

neocore doctor --network

It makes a throwaway memory with your settings. Then it captures a turn, imports a small sample export and recalls a dated quote from it. Meanwhile every network call and every program start that Python makes in that process is blocked and counted. You should see 0 outbound connections. If your relevance filter uses the hosted scorer, the check says so, because that scorer is online by design. On a device connected to a memory server it names the server and fails: each prompt goes there for recall. This tests NeoCore's own code paths. It does not audit the whole machine or other programs.

NeoSift: the local relevance filter

Recall finds candidates by words and meaning, but many of them only share words with the prompt. NeoSift is a 32M-parameter cross-encoder that reads the prompt, the end of the turn before it and each candidate memory, and gives the chance that the memory would help. Only the best are injected (score >= 0.4, at most 12).

It was trained on real coding-assistant prompts whose candidate memories were graded by a frontier model (GPT-6.1). On 103 held-out real prompts, ranking useful memories above useless ones:

ScorerWhere it runsScore
GPT-6.1 (the teacher)hosted0.970
TypeSafe Jev 1.13hosted, ~$0.0007 per prompt0.931
NeoSift 32Myour graphics card, free0.914

On prompts where no memory was useful, NeoSift still let something through 40% of the time, against 74% for Jev. On 885 real prompts graded after their replies, the default cut-off injected 5.7 memories per prompt and caught 66% of the memories the replies needed. Raising the cut-off trades needed memories away about as fast as it saves space.

It runs on your graphics card. One prompt (48 candidates) takes 0.07 s on an RTX 3080. neocore setup installs it when it finds an NVIDIA card or Apple silicon, and only if a speed check passes:

neocore sift install      # or: neocore setup (does it when a graphics card is found)
neocore sift remove

It lives in ~/.neocore/sift: its own Python environment (torch, transformers, ~2-3 GB), the pinned model (~120 MB, hash-checked) and a server on 127.0.0.1 that keeps nothing. If it ever cannot answer in time, that prompt gets unfiltered recall instead of none. It was trained on English prompts: in other languages it let only 8-9 of 20 needed memories through (English 18), so a prompt that is not in English skips it and gets unfiltered recall. NeoSift is fine-tuned from Ettin (Apache-2.0); see NOTICE.

Help improve NeoSift (opt-in)

NeoSift gets better with more real prompts. neocore setup asks once:

Help improve NeoSift? If you say yes, NeoCore sends the prompts it recalls memory for, the end of the turn before each, the memories it offered and their scores, encrypted, to the NeoCore team. An AI model grades them and they are used only to train NeoSift, which outputs scores and cannot reproduce text. Your content is never used as knowledge, shared or sold. It is stored encrypted so future versions keep learning from it. Off by default. Stop any time with neocore share off, or remove everything you sent with neocore share delete.

What that means exactly (the code is share.py):

  • Sent: the prompt, your previous message (first 600 characters) and the end of the assistant's previous reply (last 800 characters), which is what NeoSift reads, and the memories recall offered with their scores, after NeoCore's usual secret redaction. Never the reply to the prompt, tool output or whole conversations. Prompts of fewer than three words are skipped (nothing to learn from), and at most 300 rows a day.
  • How: compressed, over HTTPS, in small batches, at most every six hours. On arrival each batch is encrypted with a key that only our training machine holds; the receiving service cannot read it back, and it keeps a batch only until the training machine has collected it. neocore share off also drops rows not yet sent.
  • Used for: grading by an AI model and training NeoSift. Nothing else.
  • Deleting: your install sends with a random secret id (in ~/.neocore/share/id; we store only its hash). neocore share delete deletes everything sent with it, including rows already collected for training (within a day), turns sharing off and starts a new id.

One memory across machines

Run the memory on one always-on machine (a home PC or a small VPS) and connect every other machine to it. Tell Claude Code on your laptop something once; Codex on your desktop knows it in its next chat's first message.

# on the machine that keeps the memory
neocore server init --person alex --device laptop --device desktop
# on each device, with the key file that device was given
neocore connect --url https://memory.example.com --key-file laptop.key

Each device has its own key, stored hashed on the server and revocable at once. Keys carry scopes, so one server can keep separate memories that never mix. Nothing is lost while the server is away: a device's transcripts are its queue. Admin commands (neocore server scopes, audit, export, forget) never show memory text unless asked to export it. One-command installers for Linux, macOS and Windows are in scripts/install/. Full guide: docs/shared-memory.md.

Why records: what was tried, shown before anyone changes it

A lesson says something went wrong. It does not say what was tried, what the fix protects or how it turned out, so the next AI can repeat a fix that already failed, or take a safeguard for a bug and remove it. Google DeepMind's Self-Improvement Memory work (Nov 2026) found that "problem only" memory can do worse than none, and that what carries improvements across models is the record of the change: root cause, rationale, the predicted outcome and the observed one.

A why record keeps exactly that, anchored to the files or names it concerns. When Claude Code is about to edit an anchored file, or run a command that changes it, that action is held once with the matching records as the reason, so they are read before anything changes; running it again goes through. Once per record per session, zero model calls. Reading a file, or writing a document that only mentions it, never triggers them. An anchor A + B needs both parts (Remove-Item + neocore-wt- is deleting a worktree, not working in one). This uses the before-action hook that neocore setup installs; the Claude Code plugin alone does not add it.

neocore why add --anchor scripts/deploy.sh --anchor IDLE_MIN \
  --change "Deploy waits until the gateway has been idle 10 min" \
  --cause "A restart mid-conversation dropped the reply in progress" \
  --why "Never deploy into a live conversation" --expect "No lost replies"
neocore why observe w-1a2b3c4d held "b152: busy customers waited, no lost replies"
neocore why for scripts/deploy.sh   # what an AI would be shown
neocore why capture .               # from commits with Why: / Cause: / Expect: lines

capture also marks a change failed when a later commit reverts it. Records from every AI share one file, so a fix Codex made is explained to Claude Code before it touches the same code. The evaluation (evals/why/RESULTS.md) replays real incidents with no memory, the problem only, the change only, and the full record. Over 16 runs where the obvious fix would undo a safeguard, the agent kept it 4 times with no memory, 10 with the problem only, 12 with the change only, and 16 with the full record. It still made the change when the safeguard's reason had gone.

Updates

NeoCore keeps itself up to date like any installed app. Once a day the background sync (the one your assistant's Stop hook already starts, with no model call) asks PyPI whether a newer neocore-memory is out. If one is, NeoCore installs it into its own Python, checks that the new version loads, and goes back to the old one if it does not. Your next prompt shows one line saying what happened.

neocore update            # check and install now
neocore update status     # installed version, latest seen, last check
neocore update auto off   # only tell me when an update is out
neocore update auto on    # install updates automatically (the default)

Set NEOCORE_NO_UPDATE=1 to turn checking off entirely. The check sends PyPI nothing but the request for the package's public page. A source checkout or an install from git is never replaced; NeoCore only tells you an update is out.

Quick start: Hermes Agent

NeoCore is a memory provider for Hermes Agent (0.22.2 or newer):

hermes plugins install VincentPorquet777/neocore/integrations/hermes
hermes memory setup          # pick "neocore"

Your own Hermes conversations (the CLI, the desktop app, and your own direct messages) join the same memory as Claude Code and Codex: this machine's after neocore setup, or your memory server after neocore connect. Hermes gets the same memory tools. Groups, and anyone else who messages your agent, keep a separate memory per chat and never see yours. Settings, what is stored and the one-time downloads are described in integrations/hermes.

Quick start: Gemini CLI, Cursor, Copilot CLI, opencode

neocore setup also sets up each of these it finds on the machine (--tools gemini-cli,cursor to pick, --tools none to skip). Each gets what its own hooks allow:

ToolMemory tools (MCP)Recall with every promptTurns kept in the memory
Gemini CLIyesyes (BeforeAgent hook)yes (AfterAgent hook)
Cursor (Grok Build)yesno: its prompt hook cannot add text, so the agent searchesyes
GitHub Copilot CLIyesno: its prompt hook cannot add textnot yet
opencodeyesnot yetnot yet

Setup merges into each tool's own settings file and keeps a .neocore-backup copy; neocore uninstall removes only NeoCore's entries. Gemini CLI runs MCP servers only in folders you trust. For any other tool that speaks MCP, neocore mcp-config prints the entry to paste.

Quick start: any assistant

from neocore import Memory

memory = Memory("memory.db")   # uses the embedder `neocore setup` downloaded, if present

memory.add(conversation="chat-1", user="I moved to Lisbon in May for the Feedzai job.",
           assistant="Congratulations on the move!", at="2026-05-03T10:00:00Z")
memory.add(conversation="chat-2", user="My card PIN hint is in the blue notebook.",
           scope="private")

result = memory.recall("Where do I work now?", scopes=["internal"])
print(result.rendered)   # dated, verbatim, budgeted block for your prompt
print(result.receipt)    # every delivered excerpt: evidence id + character offsets
  • memory.revoke(evidence_id, reason=...) hides a message until memory.store.restore(...).
  • memory.forget(evidence_id, reason=...) deletes the text and keeps an audit tombstone.
  • memory.abandon_branch(branch_id, reason=...) drops an edited-away branch.
  • memory.form_facts(ask) forms dated facts with any model: neocore.llm has Hermes CLI, Codex CLI, Claude CLI and OpenAI-compatible backends. Without an llm setting it uses the first one installed, in that order: Hermes on the model you set up there, then Codex or Claude Code on your own sign-in.

The only required dependency is the Python standard library. pip install neocore-memory[embed] adds dense recall (numpy, onnxruntime, tokenizers).

How it works

 your prompt ──► hook ──► warm daemon ──► Governed Recall ──► (optional filter) ──► context
                                          │  permitted?  scope · revoked · branch · revision
                                          │  rank        BM25 + bge-small, reciprocal-rank fused
                                          │  render      verbatim, dated, budgeted, receipts
 finished reply ──► sync ──► store (SQLite: immutable messages + access log)
                      └──► background, your own Codex/Claude sign-in:
                           facts (dated, cite their messages) · sleep (newest wins) · lessons
  • Store (neocore/store.py): one immutable row per message. An append-only access log covers revoke, restore and forget, and a branch log covers abandoned branches. Nothing is ever updated in place.
  • Recall (neocore/recall.py): permission is decided first. Ranking only ever sees permitted messages, so a forbidden message cannot "rank its way in".
  • Formation, sleep, lessons (neocore/assistant/): facts are add-only and cite their sources. Sleep judges groups of near-duplicate facts (current, history, superseded, outdated, duplicate) and every verdict can be undone. Lessons cite the facts they draw on.

More in docs/how-it-works.md and docs/governance.md.

Evals

Everything below runs through neocore.Memory and GovernedRecall from this repository. The recall step makes no model calls. Reader and judge are the only models. See evals/README.md to reproduce them.

BenchmarkQuestionsNeoCoreReader / judgeRecall p50Cost
LoCoMo (10 conversations, categories 1–4)1,54087.5%gpt-4.1-mini / gpt-4o-mini22 ms$2.42
LongMemEval-S50089.6%gpt-4.1-mini / gpt-4o (official prompts)20 ms$1.52
Governance (leaks)1,5400 (control: 1,540)none14 ms$0

By category:

LoCoMoLongMemEval-S
single-hop (841)91.8%single-session-user (70)98.6%
temporal (321)88.2%knowledge-update (78)92.3%
multi-hop (282)82.3%temporal-reasoning (133)91.7%
open-domain (96)63.5%single-session-preference (30)90.0%
single-session-assistant (56)87.5%
abstention (30, overlaps the others)86.7%
multi-session (133)82.0%

Recall makes no model calls in every row. The cost is the reader and judge calls through OpenRouter.

Caveats, stated plainly:

  • Tuned on these benchmarks. Recall settings (budget, top-k, the 30% fact share) were tuned on a stratified pilot of LongMemEval-S and four LoCoMo conversations, so these are not fully held-out numbers.
  • Facts formed once. Facts were formed once per session with gpt-4o-mini and are reused here (evals/data/*facts*).
  • Lenient LoCoMo judge. Our LoCoMo judge prompt is generous about wording, like the Mem0 protocol, but it is our own prompt.
  • Others' headline figures use bigger models. Zep's 94.7% on LoCoMo uses gpt-5.4 to answer and to judge; Mem0's 94.4% (LongMemEval) and 92.5% (LoCoMo) do not state their answering model or judge. With the same small answering model as ours, published LoCoMo results range from 64% to 93%, and some systems score above NeoCore. We have not re-run them. The like-for-like comparison, with sources, is in Where NeoCore stands.

Status and limits

NeoCore 0.3 is beta.

  • Battle-tested scale is modest. The assistant integration has run daily on one developer's Claude Code and Codex history (thousands of turns), and the engine has run behind three production assistants. Scale tests on large corpora are still to come.
  • NeoSift runs on a graphics card (NVIDIA or Apple silicon). Other machines use the hosted scorer or unfiltered recall.
  • NeoSift reads English. Prompts in other languages get unfiltered recall; memories in other languages need neocore embedder multilingual. Word matching does not split Chinese or Japanese into words, so recall there rests on the embedder alone.
  • NeoSift has learned mostly from one developer's coding prompts so far. On two business assistants' prompts it agreed with its teacher less well (0.68 against 0.80, an earlier round). Opt-in sharing is how it learns everyone's.
  • Windows, macOS and Linux. The daemon and hooks are developed on Windows and use only the standard library elsewhere. Please report issues.
  • Gemini CLI, Cursor, Copilot CLI and opencode are new (0.3.6). Gemini CLI, Copilot CLI and opencode were each checked to load NeoCore's memory tools from what setup writes. Cursor (now also called Grok Build) was checked live on Windows: its hooks kept a chat, and a fresh chat found it with neocore_search. The hooks are tested with the inputs each tool documents. Long daily use so far is on Claude Code, Codex and Hermes.

License

Apache-2.0. See LICENSE.

PYPI
neocore-memory
Install Command
pip install neocore-memory
Runtime: uvx