Repository navigation
Description
The gap, measured on the live deployment
The owner's v0.9.0 directive is that knowledge "gets vectorised, graphed so it makes
sense when accessed via chat or via the llc module". It is vectorised. Chat cannot
reach it.
Measured on the local deployment, commit 9027bf7e6 before and after the run:
| Chroma collection | vectors |
|---|---|
autobot_code |
11,241 |
autobot_docs |
6,741 |
autobot_memory |
359 |
| 23 others | 0, except three caches (79/10/10) and one with 1 |
POST /api/knowledge_base/search with {"query": "autobot"} returns total_results: 0 — HTTP 200, 29.6s.
So 6,741 chunks of AutoBot documentation and 11,241 of the codebase are indexed, and
the retrieval path the chat uses returns nothing for the most obvious query against
them.
What retrieval can see
A control proves the path works over the collection it does query. A fact created
through POST /api/knowledge_base/add_text was returned at score: 1.0 by a search
for its own wording, with full metadata. So the route, the embedding model, the
ranking and the metadata pass-through are all functioning — over autobot_memory
and the Redis fact store.
autobot_docs and autobot_code are not in that set. Nothing is broken inside the
search; the wrong collections are wired to it.
The documentation that cannot be reached is the best-described data in the system
A sample chunk from autobot_docs:
text: "# AutoBot Development Instructions Index plus the rules that are catastrophic to miss..."
meta: file_path=CLAUDE.md doc_type=project_rules section="Introduction"
chunk_index=0 total_chunks=10 tier=1 priority=critical
source=autobot_documentation indexed_at=2026-09-25T19:56:57Z
lineage_version=1 title="AutoBot Development Instructions" tags=...
Chunked with section titles, tiered, prioritised, lineage-versioned. That is richer
provenance than any of the five KB write legs produces (#17527) — and it is in the
collection retrieval does not query.
Why this was not obvious
GET /api/knowledge_base/stats reports:
total_documents: 359 total_chunks: 359 total_vectors: 359 total_facts: 1
categories: ["round-trip-17527"]
359 is autobot_memory's count alone. The endpoint names the field
total_documents and answers for one of at least three populated collections, so the
17,982 vectors in the other two are invisible to it. Reading that number as the store
is how I first concluded the knowledge base was empty — filed separately, because an
instrument that under-reports by 98% is its own defect.
Acceptance criteria
-
KnowledgeBase.search()queries the documentation and code collections, or the
reason it does not is recorded where a reader will find it. If the split is
deliberate — memory versus corpus — then chat needs a path that reaches the
corpus, and that path is the deliverable. - A query for a phrase present in
autobot_docsreturns the chunk, demonstrated
on the host with the deployed SHA recorded. - The LLC module's retrieval is checked the same way, not assumed to follow —
Umbrella: knowledge base intake is built but two legs are severed — upload has no UI, transcriber output cannot land #17527's criterion is chat and LLC. - A test asserts which collections the retrieval path queries, so a collection
added later is either included or explicitly excluded rather than silently
unreachable.
The last criterion is the one that keeps this from recurring
Three collections exist, one is queried, and nothing anywhere states that as a
decision. A test naming the queried set turns it into a claim someone has to maintain.
Related
#17527 (the intake umbrella — its provenance criterion is not the blocker; this is).
#12733 (facts wiped in Redis while ChromaDB vectors remained — the same
two-stores-disagreeing family, from the other direction).
Activity
mrveiss commentedon Sep 27, 2026
Root cause: the search path queries five collections and all five are empty
The live log shows the request entering
npu_semantic_search:npu_semantic_search.py:224defines every collection it will look in:Those five, against the host's actual counts:
autobot_text_embeddingsautobot_image_embeddingsautobot_audio_embeddingsautobot_multimodal_fusedautobot_code_embeddingsAnd the three that hold data, none of them in the map:
autobot_codeautobot_docsautobot_memoryThe semantic search path queries five empty collections. That is the whole of why
{"query": "autobot"}returnstotal_results: 0while 6,741 documentation chunks areindexed.
Why nobody caught it, and this is the part worth keeping
The names are near-misses of each other:
A reader asking "does the search query a code collection?" sees
autobot_code_embeddingsand answers yes. A reader asking "is the code indexed?"sees 11,241 in
autobot_codeand answers yes. Both are right, and nothing in eitherview shows that the two names are different collections. The failure needs both halves
in front of you at once, which is only true on the host.
This also explains the result that looked contradictory: my probe fact was returned at
score: 1.0by a prose query. It came back through the hybrid mode's other half —the Redis fact store — not from any of the five. So one half of hybrid retrieval works
over a corpus of one fact, and the vector half searches five empty collections.
A second instrument disagrees with the host too
cli/doctor.py:83verifies ChromaDB collections exist:There is no
code_kbon the host, andcode_kbappears nowhere else in therepository. So the doctor reports
Missing collections: {'code_kb'}and offers afixablerepair that creates an empty sixth collection while 11,241 code vectorssit in
autobot_code, which it does not check for. Three different names for the codecorpus across three components, and no two agree.
Revised acceptance criteria
pointing the map at the populated names, or populating the mapped names, is the
decision — and it needs stating, because the two produce different systems.
three ways (
autobot_code,autobot_code_embeddings,code_kb); a constant orSSOT entry makes a mismatch a failed import rather than an empty result.
rather than returning zero results. An empty collection currently produces a
successful search with no hits, which is indistinguishable from a corpus that
genuinely has no match.
cli/doctor.pychecks the collections the application actually uses, and itsrepair does not create a collection nothing reads.
name the searcher does not query fails in CI.
The third criterion is the one that would have caught this on day one
Everything here reported success. The indexer wrote 17,982 vectors successfully. The
search returned HTTP 200 successfully. The doctor would have offered a successful fix.
Nothing asserted that the collection being searched had anything in it.
mrveiss commentedon Sep 27, 2026
Correction to my root-cause comment above. The five empty collections are not what the search queries — I traced the map and not the call path.
What I said, and why it was wrong
I wrote that
npu_semantic_search.collection_namesis "every collection it will look in". It is not. That map is used in exactly one place — the init loop at:1100, which creates each collection if absent. Nothing queriesself.collections.The actual chain, followed to the collection this time:
and the knowledge base's vector store is one collection, named by config:
ChromaVectorStoretakes one collection. So:The retrieval path queries exactly one collection —
autobot_memory, 359 vectors. Not five, not zero-of-five.autobot_docs(6,741) andautobot_code(11,241) have no reader anywhere in the retrieval path.What the five collections actually are
Dead weight, created at startup by the init loop and never written or read. Their existence is a real defect — they are the reason a reader checking "does search cover code?" sees
autobot_code_embeddingsand answers yes — but they are not the cause of zero results.So my near-miss-naming observation stands as why this was hard to see, and is wrong as the mechanism. The mechanism is simpler and worse: one collection, single-collection by construction.
Why the distinction changes the fix
If the search had queried five wrong names, the fix would be a name map. It does not.
ChromaVectorStore(chroma_collection=...)is one collection per store, so reaching the documentation corpus is a design question, not a rename:autobot_memory. No retrieval change; the corpus flows through the existing path. Costs a re-index of 17,982 vectors and merges three corpora with different chunking and metadata shapes into one collection.autobot_docs/autobot_code, fused at the search layer. Keeps the corpora separate, which their metadata already assumes —autobot_docscarriestier,priority,doc_type,section;autobot_memorycarries fact provenance. Most work, and the only option where "which corpus answered" stays visible in a result.memory.chromadb.collection_nameatautobot_docs. One config change, and wrong: it would make the documentation reachable and the fact store unreachable, trading one empty result for another.My recommendation is 2, because the two corpora are genuinely different — one is chunked documentation with section and tier metadata, the other is facts with ingest provenance — and #17527's criterion is that a retrieved thing can say where it came from. Fusing them into one collection (option 1) discards the distinction that criterion depends on.
What I am fixing now, and what I am not
Not the design. It needs the owner's call between 1 and 2, and picking wrong bakes in a retrieval architecture.
Fixing, because each is unambiguous and independent of that call:
cli/doctor.pyexpectingcode_kb, which exists nowhere, and offering to create it.Method note
I anchored on a log line, found a plausible mechanism twelve lines from it, and published before following the call path to the collection. The measurement — five collections, all empty — was correct; the claim about what queries them was not. Same shape as the stats endpoint that started this: correct number, wrong question.
mrveiss commentedon Sep 27, 2026
Company tiering changes this, and it retires the recommendation I made two comments ago. Raised by the owner asking whether the design considers company-tiered knowledge and whether it covers the whole subtree. Two answers: yes, and no.
Yes — a tiered, multi-collection, weighted retriever already exists
llc/kb/inheritance.py,KbInheritanceResolver:It resolves a chain of per-company collections with weight decay per hop
(
current.kb_inheritance_weight), guards against circularparent_org_id, and searchesthem in parallel before re-ranking. The host confirms the collection shape exists:
company_<uuid>,company_<uuid>_decisions,company_<uuid>_agents,project_<uuid>,work_item_<uuid>.And
KnowledgeBaseis built for it —knowledge/base.py:109:So multi-collection retrieval is not something to build. It exists, it is weighted,
and it is tiered. What is true is that there are two retrieval architectures and
only one of them is tiered:
KnowledgeBase.vector_storeautobot_memoryrag_assembler+search_with_collectionsThat retires my option 2 above ("build a second retriever, fuse at the search layer").
The second retriever is already there; chat does not use it.
No — it does not contain the subtree
The walk is strictly upward:
Company → parent → grandparent → root. Ancestors only. A company sees what it
inherits from above and never what its own sub-companies hold.
I checked for a downward traversal before asserting the negative: nothing in
autobot-backend/llcorautobot-backend/user_managementqueries organizations byparent_org_id == <node>. Thechildrenrelationships that exist are on goals andwork items, not organizations. So there is no subtree query to fix — there is none to
begin with.
The module's own docstring states the intent as one-directional: "Sub-companies
automatically inherit parent company KB collections via read-through." That is a
deliberate design, and "knowledge contains the whole subtree" is a different one.
And the tiered collections are empty too
Every per-company, per-project and per-work-item collection on the host holds 0
vectors. So the tiered path has never carried anything either — the same condition as
the five collections I misattributed earlier, and for the same reason: created, never
written.
Revised options
and code corpora as tiers with their own weights. Reuses the weighting, the parallel
query and the re-rank. Needs a decision on what weight a global corpus carries
relative to a company's own knowledge.
of (1) and needed if "whole subtree" is the requirement — with two things to settle:
the weight direction for descendants (inheritance decays upward today; a subtree
needs its own rule), and whether a parent seeing a child's knowledge is an access
decision rather than only a retrieval one.
autobot_memory— still the cheapest and still discards the corpusdistinction, and now also bypasses the tiering entirely.
Recommendation: 1 and 2 are separate pieces of work and 2 is the one that needs a
ruling first, because it is a visibility question. Upward inheritance is safe by
construction — a child seeing its parent's shared knowledge. Downward is not
symmetric: a parent company reading a subsidiary's decisions collection may be exactly
right or exactly wrong depending on what the tiers mean, and that is not a retrieval
decision.
Method note, third on this issue
I recommended building a retriever that already existed, because I traced the chat path
and stopped. The tiered one is in a sibling package I had already read for a different
purpose —
context_builder.py'ssourcescame from this same module's resolver. Eachcorrection here has narrowed the claim; each was caused by publishing before following
the chain to its end.
mrveiss commentedon Sep 27, 2026
Consolidated state, after the owner corrected two premises of mine. Two of my earlier claims were wrong and the blocker narrows to one sentence.
What each collection actually holds
autobot_docsfile_path,doc_type,section,chunk_index,tier,priority,lineage_versionautobot_code"Problem: performance_nested_loop_complexity Severity: medium File: ... Line: 54", keyed byseverity/problem_type/suggestionautobot_memoryKnowledgeBase.vector_storeautobot_*_embeddings/_fusednpu_semantic_search's init loopKbInheritanceResolver, when populatedCorrection 1 — there is no code corpus, so nothing about code retrieval is broken
I reported "11,241 code chunks are vectorised and chat's retrieval path queries neither".
Wrong.
autobot_codeis a findings index: 11,241 embedded problem reports withseverity and suggestions, produced by the LLC project findings scan
(
POST /api/llc/projects/{id}/findings/scan). That is a product feature working asdesigned. Wiring it into chat retrieval would surface lint findings in answers to
questions about code, which is not what anyone wants.
Correction 2 — the documentation is not duplicated
I expected
autobot_docscontent to also appear inside the codebase ingest, since therepository contains
docs/. It does not: of 200 sampledautobot_codeentries, 0have a
docs/or.mdpath, because that collection indexes findings keyed to sourcefiles rather than file contents. So there is no double-ingest to reconcile.
What the blocker actually is
AutoBot ships knowing about itself — 6,741 chunks of its own documentation, indexed by
default — and chat cannot reach any of it. That is the whole of #17625 now. The code
collection is a different feature; the tiered company collections are empty; the five
*_embeddingscollections are dead.Why tiering does not apply to this corpus, which narrows the fix
The owner's note that an end user would not have AutoBot's codebase in their LLC settles
the design question I was holding open. AutoBot's documentation is global: every
deployment ships the same corpus, it is not company-scoped, and it does not belong in a
company_<uuid>collection or inherit along aparent_org_idchain. SoKbInheritanceResolver's weighted ancestor walk is the right mechanism for companyknowledge and the wrong frame for this corpus.
That removes option 2 from my previous comment (add docs as tiers in the inheritance
chain) and leaves the question much smaller:
weighted below their own knowledge so a company's own answer wins a tie.
autobot_memory. One re-index, no retrieval change, and thecorpus distinction is lost —
autobot_docscarriestierandprioritythatautobot_memoryhas no field for.Recommendation: 1. The documentation is the one corpus every deployment has, and
option 2 discards the metadata that makes it useful —
tier: 1, priority: criticalon aCLAUDE.md chunk is exactly what a retrieval layer should rank on.
Still open for the owner, and separate from the above
Does knowledge cover the whole subtree? Today: no, ancestors only. That is a
visibility decision, not a retrieval one, and it is independent of the documentation
blocker. It stays open regardless of which option above is taken.
Method note
Four corrections on this issue, each narrowing the claim, three caused by publishing
before following the chain to its end and one by reading an endpoint as the store. The
measurements were right every time; the question each answered was not the one I
reported it against.
mrveiss commentedon Sep 27, 2026
The blocker is smaller than every framing I have given it, including the last one. The merge exists and is skipped.
The owner's target: three default buckets
autobot_docs, 6,741 chunks, reader existsautobot_memory— the one collection chat queriesThe reader and the merge both already exist
DocIndexerService.COLLECTION_NAME = "autobot_docs"writes it, andsearch()reads it— with its docstring stating this exact purpose:
And
services/rag_service.py:787does the merge:So #4953 built the reader, the merge was wired, and the embedding question I was about
to guard against does not arise:
search()embeds with the same_embed_modelthatwrote the collection, and
_create_collectionrecords embedding provenance (#10420).Measured: the merge is skipped, and the endpoint that skips it entirely is faster
POST /api/knowledge_base/rag/advanced_search,{"query": "what are the 8 core rules"}:documents_considered: 0— it never reached the corpus. The merge is gated ondoc_svc._initialized, andDocIndexerService.search()has the same guard internally:Three reasons to return
[], all indistinguishable to the caller from "searched andfound nothing" — over a collection holding 6,741 chunks.
Meanwhile
POST /api/knowledge_base/searchnever merges at all:autobot_memoryonly,29.6s, zero results.
So the fix is not what I said three times
Not a rename, not a second retriever, not a new RRF view. The narrow statement:
The documentation merge exists and its initialisation gate is closed in the serving
process, so 6,741 chunks are skipped silently while the endpoint that skips them by
design answers faster.
Revised acceptance criteria
_initializedis false in the serving process. The startup steplogs
✅ [ 85%] Doc Index: Checking documentation index...and no outcome linefollows it, so the check's result is not recorded either way.
search()distinguishes its three empty-return reasons. Not initialised,collection absent and collection empty are three different facts and one
return value — the caller cannot tell any of them from "no match", which is why
this survived with a populated collection.
if doc_svc._initialized:with no else branchmeans the documentation bucket silently leaves the result set.
POST /api/knowledge_base/searcheither merges the buckets or says it does not.Two endpoints with different corpora and no visible difference is how I spent an
afternoon measuring the wrong one.
Method note, fifth correction
Each framing was narrower and each was caused by the same thing: I measured an endpoint
and reported it as the retrieval path.
/api/knowledge_base/searchand/api/knowledge_base/rag/advanced_searchhave different corpora, and nothing in eithername says so.
mrveiss commentedon Sep 27, 2026
Why the gate is closed: established facts, and one contradiction I am not going to paper over.
Established
1. The startup step's outcome is unrecorded on every boot.
_auto_index_documentationin
initialization/lifespan.pyhas four possible outcomes and logs a line for each:Counted across today's five backend starts (09:36, 10:09, 10:33, 12:16, 12:21):
Doc Index: Checking documentation index...Doc Index: Failed to initializeDoc Index: Collection has N vectors, skippingDoc Index: done — N indexedFive entries, zero outcomes. Whatever happens after that first line, it has never been
recorded on this deployment.
And the entry line carries a⚠️ sees a
✅. A reader scanning the startup log for ✅ /green check for a step whose result is unknown. The tick is printed before the work.
2. The gate is closed at serve time.
rag/advanced_searchreturnsdocuments_considered: 0in ~2s, both before and after the documentation re-index wastriggered from the GUI.
rag_service.py:793'sif doc_svc._initialized:has no elsebranch, so the documentation bucket leaves the result set with nothing said.
3. The indexer is pointed at a persistent Chroma path, and that path is empty.
initialize()opens its client withdb_path=<project>/data/chromadb, and on thedeployment that directory has been empty since June. The 18,341 vectors live in a Chroma
HTTP server — a separate process,
chroma run --host 127.0.0.1, with its storeelsewhere.
4. It is not an unreachable embedding service. Ollama answers in 6ms.
The contradiction, stated rather than resolved
DocIndexerServiceis what writesautobot_docs, andautobot_docsholds 6,741 vectorsin the server. If the indexer read and wrote the empty persistent path, those vectors
could not be where they are.
So one of these is true and I have not established which:
get_chromadb_clientresolves to the HTTP server regardless of thedb_pathargument,in which case fact 3 is a red herring and the closed gate has another cause;
and the serving process genuinely reads an empty store.
That distinction determines the fix, so it is the next thing to establish and I am not
guessing at it. Naming it because I have published five successive framings of this issue
and each was narrower than the last — the pattern was publishing at the first plausible
mechanism.
What is actionable regardless of which it is
boots, is a step nobody can audit.
✅moves to the outcome, not the entry. A tick before the work is a statusclaim about nothing.
if doc_svc._initialized:says something when it is false. A bucket silentlyleaving a result set is the defect this whole issue is about.
DocIndexerService.search()distinguishes not initialised, no collection andempty collection from each other and from no match — four facts, one
[].mrveiss commentedon Sep 28, 2026
Framing correction from a read-only audit: this is not the
source_iddefect and not a backfill. It is a wiring defect, and the issue's own text says so.Checked against
origin/main@7adaca8c29because this was being triaged as stored-data work whose fix had already merged. It is not that.What this issue actually reports, in its own words: "Nothing is broken inside the search; the wrong collections are wired to it." The control it documents proves the machinery works — a fact added through
POST /api/knowledge_base/add_textcomes back atscore: 1.0with full metadata. The route, the embedding model, the ranking and the metadata pass-through all function overautobot_memoryand the Redis fact store.autobot_docs(6,741 vectors) andautobot_code(11,241) are simply not in the set the retrieval path queries.So:
source_iddefect fixed by fix(analytics): the index request never sent source_id, so every panel queried rows that could not match (#17651) #17672. That fix was in the analytics index request path. This issue's measurement is a KB retrieval query returningtotal_results: 0while two populated collections sit outside its scope.Where the collections come from, for whoever wires it:
autobot_codeis created and written by the codebase-analytics side —api/codebase_analytics/storage.py:59and:91create it,api/codebase_analytics/chromadb_storage.py:471writes to it. So the work is deciding whether KB retrieval federates over those collections or whether their contents are projected into a collection it already queries — a design question with an owner, not a missing line.One cross-link before anyone edits that writer:
api/codebase_analytics/chromadb_storage.pyis also one of the three still-unguarded content→ChromaDB write paths in #17025 (measured: 2 of its 5 paths are now in the redaction chokepoint guard, that one is not). Same file, two open issues, two unrelated defects.mrveiss commentedon Sep 28, 2026
Owner ruling 2026-09-28: federate — query across the collections
Asked and answered directly by the repository owner today, relayed by the coordinating session. Recorded here rather than left in a session transcript.
KB retrieval fans out over the additional collections. Contents are not projected or copied into a collection the KB already queries.
Why this is the shape of the fix, per this issue's own measurement
This issue established that nothing is broken inside the search — a fact added via
add_textreturns atscore: 1.0with full metadata. The wrong collections are wired to a working retrieval path. So the repair is wiring, not ingestion, and specifically not a backfill or a rewrite of stored data.That also means the approval-gate rule for stored data (
#17041,#17038) does not apply here. It was assumed to, and the assumption was wrong: federation reads existing rows and writes nothing. Stating that explicitly so nobody parks this behind an approval queue it never needed.What federation buys and what it costs
The rejected alternative was projecting both collections into one the KB already queries. That would give faster queries and a second copy requiring synchronisation on every analytics write — a durable store plus a rebuildable projection, which the store-authority convention permits but which nobody asked for here. Federation keeps one copy of each collection and pays its cost per query instead, scaling with the number of collections rather than with write volume.
The implementer should state the measured query-cost change rather than assuming it is negligible.
Ownership note, which is not settled by this ruling
autobot_codeis created atapi/codebase_analytics/storage.py:59and:91and written atchromadb_storage.py:471— the codebase-analytics side, not the KB. So the collection's writer and the query that must now reach it have different owners. This ruling settles the direction; it does not assign the work, and coordination across that boundary is still required.Before editing the writer
api/codebase_analytics/chromadb_storage.pycarries two unrelated open defects: it writes the collection this issue cannot reach, and it is one of three still-unguarded redaction bypass paths under#17025. One file, two issues, different causes — check the other before editing it.