Skip to content
Back to search

Brain4Agent

Committed to building the world’s most cutting-edge, CJK-first memory module for all mainstream agents. Any issues and PRs are welcome.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/SparkofSpike/Brain4Agent with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/SparkofSpike/Brain4Agent'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sparkofspike--brain4agent/badge.svg)](/listings/sparkofspike--brain4agent)

HTML

<a href="/listings/sparkofspike--brain4agent"><img src="/api/listings/sparkofspike--brain4agent/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

pip install "Brain4Agent[precise]"   # recommended: adds jieba, hit@1 0.925
pip install Brain4Agent              # zero dependencies: bigrams only, hit@1 0.825

Windows and macOS both work; Python 3.11 or newer is required. The package is on PyPI as <https://pypi.org/project/Brain4Agent/>. To work on the code itself, `git clone` and `pip install -e ".[precise,dev]"`.

`jieba` is a ~20 MB static dictionary. It is not required — the code degrades to bigrams on both sides of retrieval and keeps working.

**Windows, non-ASCII input.** The MCP server and the CLI pin their stdin/stdout to UTF-8, so CJK content works regardless of the console code page. Command line *arguments* are decoded by Python before any of that runs, though — if you pass non-ASCII text as an argument, set `PYTHONUTF8=1`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 530 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Brain4Agent
  2. **English** | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
  3. > **Agents: start here.** [FOR_AGENTS.md](FOR_AGENTS.md) is this page written
  4. > for you — what the store does for an agent, how to install it, how to call
  5. > it, and where it stops being useful.
  6. Long-term memory for agents. CJK-first retrieval, no model in the core path,
  7. and evidence instead of confidence scores.
  8. `pip install "Brain4Agent[precise]"` needs Python 3.11+, plus a 20 MB optional
  9. dictionary. Everything works without it.
  10. ---
  11. ## Contents
  12. - [What it is](#what-it-is)
  13. - [Install](#install)
  14. - [Quick start](#quick-start)
  15. - [How it works](#how-it-works)
  16. - [Benchmarks](#benchmarks)
  17. - [Running alongside another memory server](#running-alongside-another-memory-server)
  18. - [Against the frontier](#against-the-frontier)
  19. - [Status](#status)
  20. - [Contributing](#contributing)
  21. - [Special thanks](#special-thanks)
  22. - [License](#license)
  23. ## What it is
  24. An agent working on a codebase accumulates context: why a decision was made,
  25. which approach failed, where a deployment lives. Brain4Agent stores those turns
  26. in one SQLite file and retrieves them by session.
  27. - **CJK works out of the box.** Character bigrams need no dictionary and no
  28. segmentation model. The benchmarked numbers are Chinese; Japanese, Korean and
  29. Vietnamese are supported and tested.
  30. - **The core makes no model calls.** Retrieval is BM25: no API key, no
  31. accelerator, no cold start, single-digit milliseconds per query.
  32. - **It reports evidence, not verdicts.** A search returns which question words
  33. the corpus never contained (`corpus_missing`) and which ones a given session
  34. lacked (`missing_terms`). The caller decides what that means.
  35. - **What is stored is not what is indexed.** A memory keeps its full text; the
  36. index can hold a narrower, more distinctive version.
  37. Memories also carry `tags` (scope), `superseded_by` (replacement) and `refs`
  38. (one-hop links), supplied by the writer.
  39. ## Install
  40. ```bash
  41. pip install "Brain4Agent[precise]" # recommended: adds jieba, hit@1 0.950
  42. pip install Brain4Agent # zero dependencies: bigrams only, hit@1 0.875
  43. ```
  44. Windows and macOS both work; Python 3.11 or newer is required. The package is on
  45. PyPI as <https://pypi.org/project/Brain4Agent/>. To work on the code itself,
  46. `git clone` and `pip install -e ".[precise,dev]"`.
  47. `jieba` is a 20 MB static dictionary. Without it the code falls back to bigrams.
  48. **Windows, non-ASCII input.** The MCP server and the CLI pin their stdin/stdout
  49. to UTF-8, so CJK content works regardless of the console code page. Command
  50. line *arguments* are decoded by Python before any of that runs, though — if you
  51. pass non-ASCII text as an argument, set `PYTHONUTF8=1`.
  52. ## Quick start
  53. ### CLI
  54. ```bash
  55. $ brain4agent exchange \
  56. "中文查询搜不到记忆,recall 返回空" \
  57. "根因在 keywords.py 第 443 行,正则不含汉字范围"
  58. stored exchange in session 913bcac81341
  59. $ brain4agent exchange \
  60. "杭州那台测试机的地址是 203.0.113.42" \
  61. "部署目录 /opt/demo-app,跑的是 PostgreSQL 14"
  62. stored exchange in session c060a5294037
  63. $ brain4agent search "中文查询为什么搜不到" -k 1
  64. 1 sessions for '中文查询为什么搜不到'
  65. [ 6.73 cov=1.00] 913bcac81341
  66. --- 913bcac81341 score=6.73 coverage=1.00 ---
  67. user: 中文查询搜不到记忆,recall 返回空
  68. assistant: 根因在 keywords.py 第 443 行,正则不含汉字范围
  69. ```
  70. A question the store cannot answer:
  71. ```bash
  72. $ brain4agent search "杭州测试机上装的是什么数据库" -k 1
  73. 1 sessions for '杭州测试机上装的是什么数据库'
  74. corpus has no: 数据库, 机上
  75. [ 4.81 cov=0.28] c060a5294037 session lacks: 数据库, 机上
  76. ```
  77. Bulk-load an existing history from JSONL (one object per line, `content`
  78. required):
  79. ```bash
  80. $ brain4agent import conversations.jsonl
  81. imported 4 turns across 2 sessions
  82. ```
  83. ```jsonl
  84. {"session_id": "s1", "role": "user", "content": "中文查询搜不到记忆"}
  85. {"session_id": "s1", "role": "assistant", "content": "根因在 keywords.py 第 443 行"}
  86. ```
  87. ### MCP server
  88. ```json
  89. {"mcpServers": {"brain4agent": {
  90. "command": "python",
  91. "args": ["-m", "brain4agent.mcp_server"],
  92. "env": {"BRAIN4AGENT_DB": "/path/to/brain.db"}
  93. }}}
  94. ```
  95. Five tools:
  96. | Tool | Purpose |
  97. |---|---|
  98. | `b4a_remember` | Store one turn; returns a session id |
  99. | `b4a_recall` | Search; returns sessions with `corpus_missing` and per-session `missing_terms` |
  100. | `b4a_ask` | Retrieve and answer in one step; needs a model, and says so when none is configured |
  101. | `b4a_session` | Read a whole session in order |
  102. | `b4a_stats` | Counts |
  103. The same library is also packaged as an agent [skill](integrations/).
  104. ### Library
  105. ```python
  106. from brain4agent import MemoryStore
  107. with MemoryStore("brain.db") as store:
  108. sid = store.new_session()
  109. store.add("杭州那台测试机的地址是 203.0.113.42", session_id=sid, role="user")
  110. store.add("部署目录 /opt/demo-app", session_id=sid, role="assistant")
  111. result = store.search("杭州测试机上装的是什么数据库")
  112. print(result.corpus_missing) # ['数据库', '机上']
  113. print(result.best().coverage) # 0.28
  114. ```
  115. `add_exchange(user=..., assistant=...)` stores a pair as one session. Retrieval
  116. is session-level, not turn-level.
  117. Bulk imports go through `batch()`, which defers the commit to one per group:
  118. ```python
  119. with store.batch():
  120. for turn in turns:
  121. store.add(turn.text, session_id=turn.sid, role=turn.role)
  122. ```
  123. ### Optional hosted judge
  124. Off by default. Enabled only when a key is present.
  125. ```python
  126. from brain4agent import Judge, MemoryStore
  127. judge = Judge.from_env() # reads BRAIN4AGENT_JUDGE_KEY; None if unset
  128. if judge:
  129. r = store.search_judged("question", judge)
  130. print(r.verdict) # found / not_found / uncertain
  131. ```
  132. `uncertain` is a third state, distinct from `not_found`: a judge that times out
  133. is not evidence that the memory does not exist.
  134. ## How it works
  135. ```
  136. write read
  137. │ │
  138. bigrams + dictionary words dictionary words
  139. │ │
  140. ▼ ▼
  141. ┌──────────────────────────────────────────┐
  142. │ SQLite: id, session, role, content, │
  143. │ created_at, tokens │
  144. └──────────────────────────────────────────┘
  145. │ │
  146. ▼ ▼
  147. BM25 index (in memory) → session-level evidence
  148. + corpus_missing
  149. + per-session coverage
  150. ```
  151. ### Storage
  152. One SQLite file. Rows are turns; the unit of retrieval is the session. Index
  153. tokens are computed at write time and cached in a column, so rebuilding the
  154. in-memory index is a counting exercise.
  155. ```
  156. import rebuild query
  157. 127 turns 44 sessions 3.9 ms 1.8 ms
  158. 1016 turns 352 sessions 0.25 s 29 ms 3.7 ms
  159. ```
  160. Writes commit in batches. A 1,016-turn import takes 3.8 s one commit at a time
  161. and 0.25 s inside `batch()`.
  162. The rebuild column in that table is the oldest measurement in this README. Two
  163. later changes both live in the rebuild: the phrase pair index (D-041), which
  164. roughly doubles the column, and the sequence cache (D-042). Re-measured on the
  165. same machine against one real store, rebuilding now costs **18.0 ms at 127 turns,
  166. 101 ms at 1,016 and 393 ms at 2,925** -- three to four times the numbers above.
  167. The table is kept because its shape is still right and the import column is still
  168. current; use the new figures for anything that depends on open latency (D-043).
  169. The file is SQLite because of the writes, not the reads: retrieval happens in
  170. the in-memory index, while every search credits access counts with one commit,
  171. and the MCP server and the CLI can hold the same file at once. WAL mode means
  172. "one file" is three on disk -- `brain.db`, `brain.db-wal`, `brain.db-shm` -- and
  173. a snapshot must go through SQLite's backup API rather than a file copy, which
  174. leaves the log behind and drops committed rows.
  175. The cost to know about is not the file. A local write marks the store dirty and
  176. the next search rebuilds the whole index: **402 ms at 2,925 memories**, against
  177. 4 ms for a keyword query once warm. Resident memory is the other ceiling --
  178. 145 bytes per index token, about 1.2 GB at 100k memories. Both belong to the
  179. in-memory index layer, not to SQLite (D-043).
  180. ### Read/write tokenizer split
  181. Indexing and querying use different tokenizers. Measured over a 3×3 grid of
  182. index strategy against query strategy (D-019), then two changes on top of the
  183. best cell (D-037):
  184. | index | query | hit@1 | MRR |
  185. |---|---|---|---|
  186. | bigram | bigram | 0.825 | 0.891 |
  187. | jieba | jieba | 0.875 | 0.911 |
  188. | bigrams + words | words | 0.925 | 0.940 |
  189. | **bigrams + words** | **words − question words** | **0.950** | **0.961** |
  190. The last row adds two things the 3×3 grid did not test: interrogatives are
  191. removed from the query side, and a session's best three turns are folded into
  192. one score. Both are measured in
  193. [D-037](docs/decisions.md#d-037-query-side-question-words-and-session-folding);
  194. the first 3×3 grid is [D-019](docs/decisions.md#d-019-index-wide-query-narrow).
  195. English gets the same treatment one language over (D-041): query-side stopwords
  196. (`when`, `the`, `for`), inflection folding on both sides (`camped` matches
  197. `camping`), and a small bonus when two adjacent query words appear adjacent in a
  198. memory (`pottery class` outranks the same two words scattered). The stemmer
  199. runs at index time, not in the stored token column, so an existing database
  200. needs no migration. Chinese is untouched by all three — its bigrams already
  201. index adjacency, and the rules refuse non-ASCII terms.
  202. ### Where the words sit
  203. BM25 counts occurrences. It cannot tell a session that is *about* an event from
  204. one that mentions the same words in passing. On LoCoMo's 486 misses, 417 had the
  205. right session inside the top ten and **188 had it at rank 2**, usually within a
  206. few percent of the winner (D-042).
  207. So a document also earns a bonus for keeping the question's words together: the
  208. fraction of distinct query terms that share a window of 40 index tokens,
  209. multiplied into the score. It is not coverage reweighted — coverage asks
  210. *whether* a session has the words, and four separate attempts to use it as a
  211. post-hoc term were flat or worse (D-020, D-024, D-039, D-041). This asks
  212. *where* they are, which is a fact the index throws away.
  213. Three guards, each from a measurement that regressed without it: only ASCII
  214. words take part (Chinese bigrams already index adjacency), documents under
  215. three windows are skipped (a one-sentence belief has no passage), and queries
  216. under five terms are skipped (two to four words is a lookup — on a real store
  217. the bonus cost 0.043 hit@1 there and nothing anywhere else, D-042).
  218. ### Evidence, not verdicts
  219. - **`corpus_missing`** — a content word from the question appears nowhere in the
  220. stored corpus.
  221. - **`missing_terms`** (per session) — which question words that session lacked.
  222. - **`term_frequencies`** — how many sessions each question word appears in. A
  223. word present in 453 of 2898 memories is neither missing nor misspelt; it is
  224. too common to separate anything, and the query needs another word (D-039).
  225. - **`related_terms`** — up to five words the top sessions use that the query did
  226. not. The third word a two-word query needs, taken from the corpus (D-040).
  227. Whether to refuse is the caller's decision; the store reports the fact.
  228. ## Benchmarks
  229. All numbers are reproducible from the `bench/` scripts, which import the
  230. shipping code rather than a copy of it.
  231. ### LongMemEval (English) — retrieval
  232. 470 answerable questions over the `s` variant (average haystack 493 turns):
  233. ```
  234. hit@1 0.8660
  235. hit@5 0.9511
  236. hit@10 0.9660
  237. MRR 0.8990
  238. ```
  239. `python -m bench.run_longmemeval --dataset s`. `bench/data/` is fetched by
  240. `bench/fetch_data.py` (264 MB, not committed).
  241. These use the harness's bigram/bigram configuration. The store's own
  242. configuration (wide index, words minus question words, fuzzy) scored 0.8596 on
  243. the same 500 tasks and took 8× longer, so LongMemEval keeps bigrams — measured,
  244. not assumed.
  245. Across three benchmarks:
  246. | benchmark | metric | this store | best third-party |
  247. |---|---|---|---|
  248. | LongMemEval `s` | hit@10 | 0.9660 | — |
  249. | PrecisionMemBench | active | **42/43** | 18/43 (open-knowledge-format) |
  250. | PrecisionMemBench | total | **74/77** | 36/77 (open-knowledge-format) |
  251. | LoCoMo | hit@1 | **0.7054** | not comparable |
  252. ### PrecisionMemBench — retrieval precision
  253. 77 single-turn cases over 35 beliefs. No generation model and no judge: the
  254. answer is the set of belief IDs the store returns. `active` is the honest
  255. column, because 33 of the 77 cases pass with an empty store.
  256. ```
  257. active 42/43 = 0.9767 cases that need query-dependent retrieval
  258. total 74/77 = 0.9610 including cases any store passes
  259. ```
  260. Three changes lifted this from 34/43 and 64/77. The result set is now sized from
  261. the names a query contains at every length, and only from beliefs the case's
  262. scope can see — the old rule forced `top_k=1` below eight words and counted
  263. out-of-scope beliefs. Whole-word name matching replaced substring matching, so
  264. `pipe` no longer matches inside `pipeline`. A fuzzy query path then matches a
  265. misspelt English word against a corpus word one edit away (`typscript` →
  266. `typescript`, `mongod` → `mongodb`). See
  267. [D-038](docs/decisions.md#d-038-sizing-the-result-set-and-matching-one-edit-away).
  268. Two more cases came with the English query folding in
  269. [D-041](docs/decisions.md#d-041-english-query-folding-stopwords-stems-and-adjacency):
  270. a query's grammar is not a memory, so dropping `what` and `the` from the query
  271. side keeps a scope-bleed belief out of the result set.
  272. Official table, from the benchmark's own site (`tenureai.dev/benchmark`):
  273. ```
  274. System Active Total
  275. ---------------------- ------ -----
  276. tenure (the authors) 43/43 77/77
  277. this store 42/43 74/77
  278. open-knowledge-format 18/43 36/77
  279. atomicmemory 5/43 16/77
  280. supermemory 2/43 15/77
  281. yourmemory 0/43 21/77
  282. gbrain 0/43 11/77
  283. hindsight 0/43 11/77
  284. zep 0/43 9/77
  285. agentmemory 0/43 9/77
  286. cognee 0/43 9/77
  287. mem0 0/43 9/77
  288. a-mem 0/43 7/77
  289. ```
  290. Best third-party result on both columns. The benchmark's own reference
  291. implementation scores 43/43 and 77/77.
  292. ### LoCoMo — retrieval
  293. 1540 questions over 272 sessions, 5882 turns.
  294. ```
  295. hit@1 0.7054
  296. hit@5 0.9086
  297. hit@10 0.9549
  298. MRR 0.7921
  299. ```
  300. `python -m bench.locomo.run` — no model, data committed. These are session
  301. retrieval rates, not answer accuracy under an LLM judge, so they are not
  302. comparable to published LoCoMo numbers.
  303. Indexing turns instead of sessions costs 2.5 points of hit@1 (0.6022 → 0.6310),
  304. same tokenisers and scoring — measured before D-041 and D-042 raised both.
  305. By category (hit@1): open-domain 0.7919, temporal 0.6906, single-hop 0.5445,
  306. multi-hop 0.4494. The last two are lookups of a single fact inside a session,
  307. which is why the proximity bonus in [D-042](docs/decisions.md#d-042-proximity-where-the-query-words-sit-not-just-whether-they-appear)
  308. turns itself off for short queries: it helps a question that names an event and
  309. hurts one that names a fact.
  310. ### Chinese benchmark
  311. 59 questions (40 answerable, 19 unanswerable), 44 sessions.
  312. | metric | bigram/bigram | current |
  313. |---|---|---|
  314. | hit@1 | 0.825 | **0.950** |
  315. | hit@5 | 0.950 | **1.000** |
  316. | hit@10 | 1.000 | 1.000 |
  317. | MRR | 0.891 | **0.961** |
  318. `current` is index `bigrams + words`, query `words minus interrogatives`, and
  319. sessions folded from their best three turns (D-037). hit@10 is saturated; only
  320. hit@1 and MRR discriminate.
  321. ### Where the Chinese number stops holding
  322. **0.950 describes 44 sessions. Dense near-duplicates collapse it.**
  323. | corpus | hit@1 | hit@5 |
  324. |---|---|---|
  325. | 44 sessions | 0.950 | 1.000 |
  326. | +300 same-topic sessions | 0.000 | 0.000 |
  327. Asked which file and line caused a bug, a vague session saying "some file, some
  328. line" outranks the one saying `keywords.py line 443`. Supplying the gold
  329. session's own file names, line numbers and commit hashes recovers 15%:
  330. | query | hit@1 |
  331. |---|---|
  332. | question only | 0.000 |
  333. | + 3 oracle entities | 0.150 |
  334. Read the top five, weight `corpus_missing` over raw score, and tag your
  335. memories — scope, kind, what supersedes what. The fix is at write time; four
  336. query-side attempts are in [D-020](docs/decisions.md#d-020-bag-of-words-retrieval-degrades-on-dense-same-topic-corpora)
  337. and [D-021](docs/decisions.md#d-021-oracle-entities-recover-15-the-failure-is-not-missing-literals).
  338. ### Abstention
  339. At the natural operating point of `corpus_missing`:
  340. | approach | keep | refuse | latency | resident |
  341. |---|---|---|---|---|
  342. | BM25 only | 1.000 | 0.000 | 0.22 ms | 0 |
  343. | **corpus_missing** | **0.875** | **0.632** | ~0 | 0 |
  344. | local 2B | 0.750 | 1.000 | 0.77 s | ~1 GB |
  345. | local 9B | 0.950 | 0.895 | 1.5–2 s | 15.2 GB |
  346. | hosted `deepseek-flash` | 0.925 | 1.000 | 0.81 s | 0 |
  347. A 0.875 keep rate means 12.5% of answerable questions would be refused
  348. automatically, so the signal is reported rather than acted on. A hosted judge
  349. adds 0.81 s per lookup — 24 seconds across 30 lookups in one task.
  350. ## Running alongside another memory server
  351. **Do not enable two memory MCP servers in the same agent.** With
  352. `neural-memory` and `b4a` both loaded, an agent queried the other server and
  353. reported "memory has no record of this" while five relevant memories sat in
  354. `b4a`. Use one memory server per agent, or names that make the choice
  355. unambiguous.
  356. ## Against the frontier
  357. | Capability | Status here |
  358. |---|---|
  359. | Structured memory (typed facts, preferences, entities) | **Partial.** `kind` is a free-form label, `tags` are scopes, `refs` are links. No schema, no validation. |
  360. | Temporal / graph memory (validity windows, relation evolution) | **Not built.** `created_at` and `superseded_by` only; no validity interval, no query-time traversal. One-hop `refs` scores 4/4 on PrecisionMemBench. |
  361. | Conflict resolution | **Built.** `supersede(old, new)`; the replaced memory stops surfacing. PrecisionMemBench supersession category: 3/3. |
  362. | Write-path deduplication / pattern extraction | **Not built.** Extraction exists (`remember()`) and is **off by default** (D-023). |
  363. | Multi-retriever fusion | **Not built.** One retriever: BM25. |
  364. | Forgetting / consolidation | **Crude.** `prune(keep_sessions=N)` is recency-based size control; `decay` and `prune_by_weight` add a weight signal. Recovering a noisy corpus needs deleting 95% of it (D-022). |
  365. | Cross-session aggregation | **Not built.** |
  366. | Proactive recall | **Partial.** `recall-context` for client-side hooks; no scheduler. |
  367. | Multimodal | **Not built.** |
  368. | Hallucination defence | **Partial.** Evidence/verdict separation, `corpus_missing`, three-state judge. Nothing detects a wrong answer produced from a correct retrieval. |
  369. | Reproducibility of published numbers | **Strong.** Three benchmarks, two with no model in the loop. |
  370. ## Status
  371. Library, CLI and MCP server are complete.
  372. **New:** near-duplicate detection (`duplicates_of`, SimHash; reports, does not
  373. merge, and is not on the search path) and weight (`reinforce`, `decay`,
  374. `prune_by_weight`). Retrieval drops question words from the query side, folds a
  375. session's best three turns into one score, and matches an unknown English word
  376. one edit away from a corpus word (D-037, D-038). English queries also drop
  377. stopwords, fold inflections, and reward word adjacency (D-041) — LoCoMo hit@1
  378. 0.6310 → 0.6826 and PrecisionMemBench total 72/77 → 74/77, with the Chinese
  379. number unchanged. A session is also rewarded for keeping the question's words
  380. in one passage (D-042) — LoCoMo hit@1 0.6826 → 0.7054 and MRR 0.7784 → 0.7921,
  381. with the Chinese benchmark, PrecisionMemBench, LongMemEval and keyword queries
  382. against the real store all measured unchanged.
  383. **Not built:** cross-session synthesis, multimodal, schema on `kind`,
  384. multi-retriever fusion, a recall scheduler, time-decayed forgetting.
  385. **Measured and rejected:** query-time graph traversal (D-024), write-time
  386. extraction (D-023), chunking LoCoMo sessions for retrieval, running LongMemEval
  387. on the store's own tokenisers (D-037), chunking LoCoMo sessions (D-037),
  388. minimum-span and early-position re-ranks (D-042).
  389. Release history is in [CHANGELOG.md](CHANGELOG.md). The
  390. [decision log](docs/decisions.md) records 43 entries; the
  391. [research notes](docs/research.md) and [landscape analysis](docs/landscape.md)
  392. cover the field.
  393. ## Contributing
  394. ```bash
  395. python -m pytest tests/ -q
  396. python -m ruff check src bench tests
  397. python -m ruff format --check src bench tests
  398. python -m bench.zh.e2e
  399. python -m bench.pmb.run
  400. python -m bench.locomo.run
  401. ```
  402. `bench/zh/e2e.py` should report `hit@1 0.9500`; `bench.pmb.run` `pass 74/77`;
  403. `bench.locomo.run` `hit@1 0.7054`. Lower is a regression. The last two need no
  404. API key and no network. Changes to a design decision belong in
  405. `docs/decisions.md` as a new entry, with the measurement that justifies it.
  406. ## Special thanks
  407. To [nhadaututtheky](https://github.com/nhadaututtheky) for
  408. [neural-memory](https://github.com/nhadaututtheky/neural-memory). This project
  409. began as a bug fix there: a Chinese query returned nothing because the keyword
  410. regex had no Han range. Its brain is also the corpus for `bench/nmem/`.
  411. ## License
  412. Apache-2.0. See [LICENSE](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.