NeoCore

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.
|
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 pressure |
0 leaks in 1,540 questions (an ungoverned store leaked on all 1,540) |
| Model calls per recall |
0: p50 22 ms, offline |
All numbers come from this repository's code (evals/), run through the public package. See
Evals for the setup and the honest caveats.
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 (~35 MB);
- 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.
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 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,
and it deletes every undo copy with them, since a copy may hold text derived from what is being
forgotten. 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.
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]