Cammut is an agent gateway with one shared memory: two searches fused by rank and reordered by a small student reranker on CPU. A lab build, Library-1M, stores each card once in a binary index and was measured on one million cards, 934,161 of them synthetic, with the Cammuteur-R1 reranker.
00Abstract
Cammut gives AI agents one gateway to their tools and one shared memory. The live memory searches by meaning and by keyword, merges the two lists by rank and reorders the first 40 notes with a distilled student reranker on CPU. The Library-1M lab build replaces text scanning with a write-once binary index: content hashes, 8-bit nested vectors in rooms, keyword postings and pre-tokenised cards, so a warm query reads no raw note text. Cammuteur-R1, a bilingual Russian and English cross-encoder with a list-aware head, reranks 200 candidates; out-of-fold logistic calibration turns its scores into probabilities for a ten-branch decision policy. On 1,000,000 cards, 65,839 real and 934,161 synthetic, the build reaches Hit@5 0.7432 at 163.30 ms median. Cammuteur-R1 scored below the live student reranker and stays outside the live path.
01Encoders
The live memory encodes notes and questions with bge-m3, a multilingual bi-encoder from 2024, and searches the vectors by meaning beside a keyword search. The paper keeps this encoder only because the stored vectors were made with it, and lists it as a legacy model. The lab reranker uses a different backbone, RuModernBERT-base: 150 million parameters, a context of 8,192 tokens, pretrained on about two trillion Russian, English and code tokens. The paper gives the reason for the choice: an encoder pretrained on English misses Russian morphology and notes that mix both scripts.
Library-1M stores each card as a 256-dimension Matryoshka prefix quantised to 8-bit integers. A Matryoshka vector nests a short coarse vector inside the full one, so the prefix alone can drive the first search stage. For figure queries the paper selects Qwen3-VL-Embedding-2B under Apache-2.0, with an optional reranker of the same family over the top 8 candidates. On 48 bilingual queries over 32 public scientific figures it reached nDCG@10 1.000 within 4.37 GB of GPU memory, while an English-trained CLIP baseline fell to 0.226 on the Russian queries.
02Rank fusion
Each question runs through two searches. The search by meaning finds notes that say the same thing in other words or in the other language. The keyword search finds notes that share exact terms, names and identifiers. Their scores live on different scales, so the live memory merges the two lists by rank position and keeps the first 40 notes. Fusion needs no trained weights, and it stays as the fallback order when the reranker is late or fails.
The two searches fail in different places. In the figure benchmark, keyword search scored nDCG@10 0.758 on English queries and 0.237 on Russian ones, because a Russian paraphrase of an English note shares no words with it. On the live system, fusion alone placed a right note in the top five for 0.380 of 79 test questions; that run came before a clean-up of the store, so it does not compare exactly with later runs. At one million cards, the hybrid first stage kept the answer among 200 candidates for 0.8818 of questions, against 0.6520 for keyword search alone.
Two searches, one ranking
- Two kinds of search
A query is answered twice: by the meaning of the question and by its words. Each search returns its own ranking of the notes.
One question goes to two searchers at once. The first looks for notes that mean the same thing, even in the other language. The second looks for notes that contain the same words.
A question splits into two lanes; each lane returns its own short list of note cards in its own order.
- Rank fusion
Reciprocal rank fusion gives each note a score that falls with its rank in each list, so a note that both searches rank high rises above a note that only one of them finds.
The two lists cannot be compared by score, because each searcher counts in its own units. So only the place in each list is used. A note that stands high in both lists rises above a note that one searcher alone liked.
Cards from both lanes slide into one column; a card present in both lanes moves up as its two positions combine.
- One list
The fused ranking is the candidate list that the reranker reads next.
The result is one list of 40 notes. A small reader model then reads the question next to each note and puts the best ones on top. If the reader is late, the merged list is returned as it is.
One column of cards remains; a small reader passes down it and a few cards rise to the top.
03Rerankers
A reranker is a cross-encoder: it reads the question and one note together and returns one relevance score. The teacher is bge-reranker-v2-m3. On 46 lab questions it reached hit@5 0.891 at 2.16 s of CPU time per question. The student, a small model distilled from the teacher, reached 0.870 at 0.22 s, about a tenth of the time for two points of hit rate.
The student runs in the live path on CPU. On the live system hit@5 was 0.380 with fusion alone and 0.772 with the student on 79 questions, and 0.823 when the client also merged an English variant of the question. The fusion run came before a clean-up of the store, so the two values do not compare exactly. The reranker has a time limit of 2.5 s, after which the fused order is returned; the limit does not fully hold, because the client retries on its own. On the larger set of 296 questions the same student reached Hit@5 0.8142 at 472 ms median and 950 ms at the 95th percentile.
04Cammuteur reranker
Cammuteur-R1 is a bilingual cross-encoder on RuModernBERT-base with a list-aware scoring head. A usual cross-encoder scores each note alone. The Cammuteur head, adapted from Deep Sets, joins the hidden state of each candidate with the mean over the whole list and passes the pair through one shared feed-forward block, so a score depends on the other candidates and never on their order. The measured difference between permutations of one list stayed below 3.6e-7 for lists of 16 to 80 notes.
The model learns from clipped teacher log-odds under four objectives: pointwise squared error, pairwise margin error, a pairwise variant weighted by reciprocal teacher rank, and an anchored loss that adds a mean term and a listwise term. Lean 4 proofs back the choice: a small pointwise error can invert a ranking, pairwise margin error forbids inversions below half the squared margin, and the anchor fixes the absolute score level that the pairwise loss leaves free.
On the 296 questions the small model reached Hit@5 0.7399 and the base models 0.7973 and 0.8108, all below the 0.8142 of the live student. The comparison gate recorded no gain, so Cammuteur-R1 is evaluated and is not in the live path. Its multimodal variant, which fuses text and figure scores with calibration, reached nDCG@10 0.9923 on the figure benchmark.
05Calibration and policy
A raw reranker score is not a probability. Calibration fits a logistic model on four features of a result list: the top score, its gap to the second score, its gap to the last score and the list length. The fit is out of fold: questions are split in two halves, and each half is scored by a model fitted on the other. On the base model the expected calibration error of candidate scores fell from 0.5344 to 0.0073. At one million cards the list probability reached a Brier skill score of 0.264 over the base rate, with a calibration error of 0.077.
The probability feeds a deterministic rule of ten branches that selects one of nine actions: stop, say cannot, ask, search wider, check, answer, plan, act or learn. A list below 0.50 triggers one wider search, and a second failure leads to a question for the owner. The answer threshold is the lowest value that gave 0.90 precision on the fitting half. Lean 4 proofs check the rule over all Boolean inputs; one of them shows that a high-risk action never runs without consent. Each query writes a decision record with its probabilities and exit rules and with no note text.
06Write-once index
Library-1M reads each card once, at ingest. The content is hashed with SHA-256, and a card with a known hash is neither embedded nor tokenised again. Ingest writes four structures: 8-bit Matryoshka vectors grouped into rooms, which are clusters of nearby vectors; a compressed table of keyword postings for both languages; the token numbers of every card as 16-bit integers; and a table of metadata. Notes that contradict an older dated note are linked at ingest, so the newer one can outrank the stale one.
A query runs in two stages. Stage one probes 24 rooms and the keyword postings and keeps 200 candidates. Stage two reranks them with Cammuteur-R1 on the stored token numbers and keeps 24, from which the top five are reported. A stale revision is demoted unless the question pins an old date. When the calibrated probability is low, the search widens once to 72 rooms and 400 candidates.
After ingest the raw text store is locked, and a query that touches it raises an error. All warm queries in the benchmark logged zero raw-text reads, and Lean 4 proofs cover the lock, repeated ingest and the order of superseded notes. The real store indexed 30,855 keyword terms and 22,541 links between superseded notes. The index is a lab build and does not serve the live memory.
A million cards, five notes
- Write once
Each note is hashed when it is stored. A duplicate hashes to the same value and is skipped, so the index holds one copy of every card.
Every card is read one time, when it enters the library. It gets a fingerprint, and a card with a known fingerprint is skipped. After that the original text is locked away, and no search opens it.
Cards stream past a stamp; duplicates fade out, and a lock closes over the pile of original text.
- Rooms and words
A query probes a few rooms of compressed vectors and the keyword postings and keeps a few hundred candidates.
The million cards are sorted into rooms of similar cards, and a word list records which cards hold which words. A question opens 24 rooms and the word list, and 200 cards come out. The other cards are never looked at.
A grid of rooms; 24 light up beside a word list, and 200 small cards leave them.
- Rerank
A small reranker reads only the candidates and keeps a few dozen.
A reader model compares the question with each of the 200 cards, using the stored number form of the text. It keeps 24. A card replaced by a newer note drops lower, unless the question asks for the old date.
200 cards pass a reader and 24 stay; one stale card sinks below its newer copy.
- Five notes
The agent receives five notes. Scores are calibrated, so that a confidence can be read as a probability.
The top five notes go to the agent, with a number that says how likely the right note is among them. If the number is low, the search opens more rooms one time. In the test with a million cards, the right note was among the five for about three questions of four.
Five cards remain beside a probability dial; a low dial reading sends one wider sweep back through the rooms.
07Gateway
The gateway is one Go program in a small container. Tool servers that speak the Model Context Protocol are registered once, and their secrets stay in the gateway. An agent sees four tools: one lists the connected servers, one searches for a tool, one describes its inputs and one runs it. Tool lists load only on request, so a slow server does not hold the others back. Each agent token carries scopes, and a call outside them is refused before it reaches the server. Every call is logged, and a web console manages tokens, servers, secrets and the log.
Memory uses the same gateway. Agents save and recall notes through it, the Hindsight store keeps them, and the gateway itself calls no language model. The paper also audits an exit guard that masks secret-like strings and blocks transfer of private notes: it stopped 10 of 10 replayed leaks, yet 7 of 8 unseen secret patterns passed its pattern rules. The index design therefore keeps raw text out of the query path and treats the output filter as a second line.
08Evaluation
The text benchmark has 296 questions written by the authors over 65,807 real notes, half Russian and half English, in five classes: plain, mixed script, two facts, dated and update. An audit of 85 misses found 6 questions with a defective answer key and 53 misses that had retrieved a valid note the key did not list, and the paper states that it reports raw and clean scores to avoid label inflation. The figure benchmark has 48 queries over 32 public figures.
The one-million index holds 65,839 real cards and 934,161 synthetic distractors, tagged as such in every table. On it the answer note stayed among 200 candidates for 0.8818 of questions and among 24 finalists for 0.8074. Hit@5 was 0.7399, and 0.7432 after one widening on 35 questions. By slice, mixed-script questions reached 0.9667, Russian 0.7027, English 0.7838 with widening, dated 0.5167 and update 0.5000. The figure slice reached Recall@5 0.9167 inside the same index.
The live memory was measured apart, on 79 questions on 4 November 2026: hit@5 0.772 as agents receive it, 2.90 s median search time and no failed call among 128. Hit@5 is the share of questions with a right note among the first five. These questions were also written by the authors, one run differs from the next by about two questions, and the answer notes were protected during the clean-up of the store, so this test cannot show a loss of those notes.
09Compute and limits
The measurements of the paper ran on laptop hardware with an 8 GB GPU. Ingest of the 65,839 real cards took 25.70 s and produced a 40.7 MB index in 256 rooms. The one-million index took 43.66 s to build and occupies 461.3 MB in 512 rooms. A warm query took 155.52 ms at the median and 213.98 ms at the 95th percentile, and 163.30 ms and 257.14 ms with widening. The base Cammuteur model has a median of 3.6 s per question in 32-bit floats, 1.2 s in 8-bit integers on CPU and 121 ms on the laptop GPU.
The distractors are synthetic: they load storage, speed and quantisation, and they do not reproduce the topic overlap of a million human notes. The questions were written by the authors. The intended encoder weights were not available offline for the one-million run, so query vectors came from the centroids of the eight nearest stored vectors, and the figure slice used a legacy English CLIP model. Widening lifted Hit@5 on the triggered questions only from 0.2857 to 0.3143. Cammuteur-R1 scored below the live student reranker.
10System design
Agents reach tools and one shared memory through the gateway; the live recall path ends at the student reranker, and the Library-1M path with Cammuteur-R1 is a lab build.
Reported figures
| Value | What it is | Evidence |
|---|---|---|
| 0.772hit@5 | Recall with reranker, as agents get it | measured |
| 2.90s | Median search time | measured |
| 0 of 128calls | Failed calls in the same run | measured |
| 0.870 vs 0.891hit@5 | Student vs teacher reranker, 46 questions | measured |
| 0.7399Hit@5 | 1,000,000 cards, narrow search, 296 questions | measured |
| 0.7432Hit@5 | Same, with one widening for low confidence | measured |
| 0.882 / 0.807recall | Answer note still listed after stage 1 (200) and stage 2 (24) | measured |
| 155.5 / 214.0ms | Median and 95th-percentile search time at one million cards | measured |
| 0.264 / 0.077BSS / ECE | Out-of-fold calibration of the lookup scores | computed |
| 0reads | Raw note reads during warm queries | measured |
| 0.917Recall@5 | Figure search, 48 queries, 32 images among the 1,000,000 | measured |
Cite
Danil Kotelnikov (2026). Cammuteur-R1 and Library-1M: Calibrated Bilingual Memory Retrieval, Multimodal Funnel Indexing, and Machine-Checked Routing. Technical paper, Arc Science.
- entry
- @misc
- key
- arcscience_cammut2026
- title
- Cammuteur-R1 and Library-1M: Calibrated Bilingual Memory Retrieval, Multimodal Funnel Indexing, and Machine-Checked Routing
- author
- Danil Kotelnikov
- year
- 2026
- note
- Technical paper, Arc Science
11Reports and papers
Source: this page. The attached report holds the full text, tables and derivations.
- CammutCammuteur-R1 and Library-1M: Calibrated Bilingual Memory Retrieval, Multimodal Funnel Indexing, and Machine-Checked RoutingDanil Kotelnikov, 2026, 15 pagesPDF 0.1 MB
Abstract
Personal memory archives hold bilingual notes and scientific figures and keep growing. Scanning the text is slow, lets raw text past exit gates and gives scores that are not probabilities. The paper describes Cammuteur-R1 and the Library-1M index. A write-once binary index deduplicates cards by SHA-256 and keeps int8 Matryoshka vectors in IVF rooms, so warm queries read no raw note text. Image queries go to vision-language encoders. Two-fold out-of-fold logistic calibration turns scores into probabilities for a deterministic ten-branch policy. Lean 4 proofs cover ranking, key masking, the policy, warm-lock invariants and supersession order. On 1,000,000 entries, 65,839 real cards and 934,161 synthetic distractors, hybrid search reaches 0.7432 Hit@5 at 163.30 ms median latency. The visual slice reaches 0.9167 Recall@5.