Commit f7c05be
committed
brain: recall-quality, multi-agent isolation, and storage hardening
A single coherent pass over the read path, the extractor, multi-agent
scoping, and table initialization. Pre-release; breaking changes made
in place with no compat shims.
storage / metadata
- Eager table materialization: open_or_init_schema now materializes
every catalog table on open, so read paths can trust a table exists
rather than each guarding TableDoesNotExist. Removes ~50 dead guards
across metadata/ops/planner/workers; a fresh shard no longer logs
"entity HNSW startup rebuild: metadata scan failed".
- Drop version suffixes from 6 table names (edges_v2 -> edges, etc.)
and all 28 rkyv type tags (::vN). No migrations: wipe data/.
retrieval
- Graph lane: keep the memory-anchor walk at depth 1 (depth 2 floods
fusion with entity-dense memories on a diverse corpus).
- Semantic soft-timeout 50ms -> 1000ms (CPU BGE embed needs headroom);
log per-call embed/search split.
- Rerank: combine fused_score + alpha*normalize(rerank) instead of
letting the cross-encoder logit replace the fused order, so a
confident multi-retriever consensus survives a noisy single-pair
logit while close ties still flip.
extractor
- Drop the brain:fact wildcard sink: predicates outside the active
schema are now dropped (with a metric), not collapsed onto
(subject, brain:fact) where they tripped spurious supersession.
- system schema prompt: omit a statement when no declared predicate
fits, rather than coercing to brain:fact.
- Entity-name normalization: strip a leading determiner; reject
over-long / pure-quantity surfaces before resolution.
- Delete the now-unused original_predicate_qname field stack-wide
(core, metadata row, ops payload, wire view, sdk, explore, shell).
multi-agent
- RECALL isolates to the calling agent by default; agent_filter scopes
to an explicit set and include_other_agents opts out. Wired through
QueryRequest, the wire RecallRequest, both retrievers' filters
(now Vec<AgentId>), the recall handler, sdk builder, and shell flags.
- MemoryResult carries agent_id so callers see per-hit provenance.1 parent cbcfd32 commit f7c05be
109 files changed
Lines changed: 1966 additions & 1752 deletions
File tree
- crates
- brain-core/src/nodes
- brain-explore/src/render
- brain-index/src
- pq
- tantivy_shard
- retriever
- brain-metadata
- benches
- src
- api_keys
- audit
- entity
- extractor
- llm_cache
- recovery
- schema
- statement
- system_schema
- tables
- brain-ops/src
- apply
- handlers
- index
- graph_retriever
- semantic_retriever
- text_indexer
- memory
- rebuild
- writer
- brain-planner
- benches
- src
- executor
- hybrid
- fusion
- planner
- tests
- brain-protocol/src
- envelope
- ops
- brain-rerank/src
- brain-sdk-rust
- src/ops
- tests
- brain-server/src/shard
- brain-shell/src
- commands
- statement
- parser
- brain-workers
- src/workers
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | 361 | | |
370 | 362 | | |
371 | | - | |
372 | | - | |
373 | | - | |
| 363 | + | |
374 | 364 | | |
375 | 365 | | |
376 | 366 | | |
| |||
417 | 407 | | |
418 | 408 | | |
419 | 409 | | |
420 | | - | |
421 | 410 | | |
422 | 411 | | |
423 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
232 | 240 | | |
233 | 241 | | |
234 | 242 | | |
| 243 | + | |
235 | 244 | | |
236 | 245 | | |
237 | 246 | | |
| |||
289 | 298 | | |
290 | 299 | | |
291 | 300 | | |
| 301 | + | |
292 | 302 | | |
293 | 303 | | |
294 | 304 | | |
| |||
359 | 369 | | |
360 | 370 | | |
361 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
362 | 391 | | |
363 | 392 | | |
364 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 48 | | |
54 | 49 | | |
55 | 50 | | |
| |||
65 | 60 | | |
66 | 61 | | |
67 | 62 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 63 | + | |
76 | 64 | | |
77 | 65 | | |
78 | 66 | | |
79 | 67 | | |
80 | 68 | | |
81 | 69 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 70 | + | |
88 | 71 | | |
89 | 72 | | |
90 | 73 | | |
| |||
128 | 111 | | |
129 | 112 | | |
130 | 113 | | |
131 | | - | |
132 | | - | |
133 | 114 | | |
134 | 115 | | |
135 | 116 | | |
| |||
178 | 159 | | |
179 | 160 | | |
180 | 161 | | |
181 | | - | |
182 | 162 | | |
183 | 163 | | |
184 | 164 | | |
| |||
215 | 195 | | |
216 | 196 | | |
217 | 197 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | 198 | | |
243 | 199 | | |
244 | 200 | | |
| |||
274 | 230 | | |
275 | 231 | | |
276 | 232 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | 233 | | |
0 commit comments