Repository navigation
Description
Owner directive (2026-09-26)
knowledgebase is what holds everything together … all that gets vectorised, graphed so it makes sense when accessed via chat or via llc module that helps to do the everyday work
that would need to be highest priority currently — v0.9.0 has to be functional
The knowledge base has four intake paths. Three reach vectorise+graph; one produces output that goes nowhere, and one has a working backend with no way to use it.
Measured state (origin/main)
| Intake path | State |
|---|---|
| Manual one-time entry | present |
| File upload | POST /knowledge/upload exists (api/knowledge.py:1213, UploadFileResponse) — no UI reaches it |
| Audio / video → transcriber | transcriber present; its KB push is broken — #17022, kb_push.py imports a non-existent DocIndexerService |
| Watch folders | services/kb_folder_watcher.py, surfaced in KnowledgeEntries.vue |
| Connectors (fileservers, databases, web) | api/knowledge_connectors.py + knowledge_connector_oauth.py, routed at /knowledge/manage?tab=connectors |
So the gap is not "build ingestion". Ingestion is built. Two legs are severed at different ends:
- upload: finished backend, orphaned — nothing calls it
- transcriber: working producer, broken consumer — output cannot land
Children
- Upload UI — wire
/knowledge/manageto the existingPOST /knowledge/upload. Frontend-only; the backend half is done. Confirm the endpoint's accepted content types and size limits rather than assuming them. - bug(transcriber): kb_push.py imports a non-existent DocIndexerService -- push_to_kb is dead on arrival #17022 — unblock the transcriber's KB push. Until this lands, audio and video are transcribed into nothing.
-
DOCUMENTentity type — see Umbrella: knowledge/memory is the relation system of record and every module a consumer — today nothing outside knowledge calls it #17526.ENTITY_TYPEShas noCODE, noDOCUMENT, noFILE(onlyFILE_ACTIVITY, a user action). Every path above ingests an artifact with a source, and withoutDOCUMENTa fact cannot point back at the document, page or recording it came from. Provenance is what makes the KB trustworthy when the LLC module leans on it, and it is the edge that cannot be expressed today. - Classification — owner note, same session: "knowledge would benefit of classification." Entries arrive from four sources with no taxonomy, so retrieval cannot filter by kind, trust or domain, and the graph cannot express "this is a spec" versus "this is a transcript" versus "this is a scraped page". Needs a decision on whether classification is assigned at ingest, inferred, or both — recorded before implementation, not during.
- End-to-end acceptance: a document added by each of the four paths is retrievable via chat and via the LLC module, with its source identifiable. If any path cannot demonstrate that, it is not done.
Why this is the acceptance test
Counting wiring has misled repeatedly on this subsystem — an endpoint can exist and be unreachable, a producer can run and its consumer be broken, and an import count says nothing about whether a traversal returns. The test is the round trip: ingest by each path, then retrieve from chat and from LLC with provenance intact.
Related
#17526 (relation/entity substrate — CODE/DOCUMENT types, cross-store edges), #17022 (transcriber push), #17215 (retrieval fusion).
Activity
mrveiss commentedon Sep 26, 2026
Correcting this issue: the upload premise is false. I wrote it, and it was wrong.
The table above says "File upload —
POST /knowledge/uploadexists, no UI reaches it." Both halves of that are wrong.autobot-frontend/src/components/knowledge/KnowledgeUpload.vueexists — 1,633 lines, drag-drop, per-file progress, category and tags.KnowledgeEntries.vueas a tab and is the default one, so/knowledge/manageopens on it.KnowledgeUpload.vue:855→KnowledgeController.ts:179 addFileDocument→KnowledgeRepository.ts:341→POST .../knowledge_base/upload.router/index.ts:208redirects/knowledge/upload→/knowledge/manage, soKnowledgeBrowser.vue:1108's import button lands there too.How I got it wrong: I grepped frontend filenames matching
knowledge.*manage.*\.vueand searched for the path/knowledge/upload.KnowledgeUpload.vuematches neither — the frontend spells the base/knowledge_base/upload. I then reported the absence as a finding. A search that cannot find a thing is not evidence the thing is missing, which is the same error this repo keeps cataloguing, committed here in the issue that sets the priority.The real defect, found by the session I misdirected
The upload path works and discards every reason the backend gives for a failure.
ApiRepository.requestthrowsnew Error(`HTTP ${status}: ${statusText}`)without reading the JSON body:knowledge.py:838)HTTP 400: Bad Request:846)HTTP 400: Bad Request:1274)HTTP 422: Unprocessable Entity_no_text_detail,:1191)HTTP 400: Bad RequestThe last row is the sharpest: #13884 exists specifically to tell a user "scanned, needs OCR" rather than "empty", and that message has never been able to reach anyone. It is rendered at
KnowledgeUpload.vue:302and never populated.Two more in the same path:
KnowledgeUpload.vue:193offers.doc .yaml .yml .xmlwhich the server refuses, and omits all five office types (.xlsx .pptx .odt .ods .odp) the server accepts (knowledge.py:128).knowledge.py:1320truncatescontentto 100 chars +"..."on the 200 path, andKnowledgeController.ts:182writes that into the client store as the document's content — so a 50-page PDF is a 103-character document locally until something refetches it.Revised children
Wire the upload UI— already wired. Replaced by: read the error body inApiRepository, align the accept list to the server's allow-list, and stop storing the truncated preview as content. Constraint established by the implementer: 16 call sites match on the thrown string (err.message.includes('HTTP 503')and similar,ErrorHandler.js:71-158,ApiClient.ts:425,useKnowledgeGraphRAG.ts:310,MemoryPrivacyPanel.vue:206, …), so the detail must be appended —HTTP 400: Bad Request — File too large…— never substituted, or all 16 break silently.DOCUMENTentity type — unchanged, see Umbrella: knowledge/memory is the relation system of record and every module a consumer — today nothing outside knowledge calls it #17526.categorywith an"uploads"default. Provenance needs no decision and is nearly free; inferred topic labels are the part that needs a ruling.Note for anyone reading the table above
Two of the five rows in the original assessment were produced by greps that could not have found what they were looking for. The round-trip acceptance test is in this issue precisely because reference-counting keeps producing confident wrong answers about this subsystem — including mine.
mrveiss commentedon Sep 26, 2026
Second correction, and it invalidates the method behind the whole table: three of the five "works" rows were asserted from file existence, and at least one of them is false.
Watch folders are severed too.
services/kb_folder_watcher.py:484callsawait kb.add_fact(...). There is noadd_factanywhere in the repository —git grep "def add_fact"returns zero definitions, and that line is its only call site. No class-level__getattr__rescues it either; the two__getattr__s inknowledge/__init__.pyandknowledge_base.pyare PEP 562 module-level lazy loaders. The real method isadd_document(knowledge/documents.py:42). Filed as #17531 by the session that found it.I marked watch folders as working. I had checked that
kb_folder_watcher.pyexists and is referenced fromKnowledgeEntries.vue. That is a file, not a function. I then told another session it was a working reference implementation to copy — and they discovered the reference was broken only because they went to read it.Corrected intake table
kb_push.pycalls an APIDocIndexerServicehas never hadknowledge_connectors.pyand the OAuth module exist, nothing moreTwo of five are confirmed severed. Two are unverified and were previously reported here as working. One works with its error reporting broken.
The #13551 detail is the one to keep
That issue fixed a missing
awaitonget_knowledge_base(). Before:AttributeError: 'coroutine' object has no attribute 'add_fact'. After:AttributeError: 'KnowledgeBase' object has no attribute 'add_fact'.Same exception class, same attribute name, same
except Exceptionhandler, sameerrors += 1. No log line and no counter distinguished the repaired code from the broken code. The fix was real, correct, and completely unobservable — so the file reads as a closed bug while the leg has never ingested anything. A repair whose success and failure are indistinguishable at the only place anyone looks.Correct call sequence, established rather than assumed
Both mixins compose onto the same object (
_composed.py:36) — two calls, not two services.add_document→_add_document_internal→store_factreturns{"status", "fact_id", "action", "content"}, so the id passes straight through. Astatus: "duplicate"still carries afact_id, so duplicates must still join the collection or a re-push routes fewer segments than the first.Related defects surfaced by asking the same question of the other writers
api/transcripts.pyreturnedresult.get("doc_id");add_documentsetsfact_idand neverdoc_id, so the document identifier was null on every successful push. Its test mocked{"doc_id": "test-doc-123"}and asserted against that — a test asserting a shape it invented. This bears directly on this issue's "source identifiable" criterion: the one working writer gave callers no handle on what it created.collections.py:102), but both intake surfaces send a name:KbPushButton.vue:15defaults to the literal'default', andWatchFolderConfig.collectiongoes only into metadata. There is noget_collection_by_name. Resolving it is a policy decision — match, create-on-first-use, or refuse — not a lookup..add_fact(/.add_documents(was declined rather than written, becauseautobot-infrastructure/shared/scripts/identity_config_utility.py:47callskb.add_documents(...)behind ahasattrprobe and would need an exemption on day one.What this means for the acceptance test
The round trip in this issue is not optional and not a formality. Every row above that I marked "works" was a file-existence check, and the two that have since been read by someone were both broken. Manual entry and connectors have still not been exercised by anyone. Until a document ingested by each path is retrieved via chat and via LLC with its source identifiable, the state of that path is unknown — not working.
fix(kb): the transcriber and the watch folder wrote to a knowledge ba…
mrveiss commentedon Sep 27, 2026
Measured all five intake legs for the last criterion — "a document added by each path is retrievable via chat and via the LLC module, with its source identifiable". Every leg writes provenance. No two write it the same way, and one writes no
sourcekey at all.What each leg actually stores
sourceholdsapi/knowledge.py:1292)source,type: "file",filename, + page offsets via_page_provenance_metadatatranscriber/knowledge/kb_push.py, #17536)source_type: "transcript",source,recording_id,recording_filenamerecording:<id>services/kb_watch_ingest.py, #17531)source: "watch_folder",folder_id,filename,file_path,collectionknowledge/connectors/base.py:596)source_type: "connector",source_connector_id,connector_type,source_id,content_typesourcekeyapi/knowledge.py:563)source,title,categorysource_typeis present on two legs and absent on three.filenameis present on two.sourcemeans four different kinds of value where it exists, and for connectors it does not exist.So the criterion is true per leg and false across legs
Each leg, read on its own, satisfies "its source is identifiable" — the information is there. But a consumer cannot answer "where did this come from" without first knowing which leg wrote the fact, and there is no field that tells it that consistently. For a connector-ingested fact, a consumer reading
sourcegets nothing at all.The upload leg is the strongest of the five and worth copying rather than replacing:
_page_provenance_metadatastores offsets derived from the samerender_plaincall that produced the stored content, so a retrieved span resolves to a page without the page number entering the embedding, and it returns{}for unpaginated formats rather than inventingpage: 1.Retrieval, both surfaces
KnowledgeBase.search(), whose results carry"metadata"— so whatever a leg wrote is reachable. The chat leg's problem is not availability.{chunks, sources}inllc/kb/context_builder.py, and builds that list fromresult["source_company_id"]— a tenancy id, not a document origin. The document's metadata rides along inside each chunk and is never surfaced as a source. A caller reading the key namedsourcesgets the company, with no signal that it answered a different question.Why this is one finding and not five
The three defects found across this criterion are the same shape at three layers:
"source": "ecl_pipeline", a constant (#17588)source_company_id, a tenancy answer under a provenance-shaped namesource, one leg with noneIn each case a caller asking about origin receives something plausible and gets no signal that it means something else. That is why counting wiring has misled on this subsystem, as this issue already says.
The decision this needs, which is not mine to make
A canonical provenance vocabulary across five legs is an architecture call, so recording it rather than choosing it. The options:
store_fact/add_documentreject a write with nosource_type, and each leg declares its own. Strongest, and it fails every existing caller until they are updated.source_typemandatory,sourcedefined as a URN with a per-leg scheme (file:,recording:,connector:,watch:). Correct, and it touches every leg plus the stored facts already written.My recommendation is 3 for new writes with 2 as the read path during migration — the accessor is needed anyway so that retrieval has one thing to call, and it makes the migration observable rather than a flag day.
What I am doing under the assignment, and what I am not
Doing: surfacing document provenance in the LLC's
sourcesalongside the tenancy field rather than instead of it; a contract test pinning what each leg writes today and asserting it survives retrieval to both surfaces; a host procedure for the real ingest-and-retrieve, written and not executed — running against a deployed instance is not something I have sanction for, and a host-behaviour criterion cannot be closed by a CI test.Not doing: choosing the vocabulary. The contract test will pin today's five dialects, so whichever option is chosen, the test shows what changed.
sourcesanswers tenancy, not where the document came from #1761846 remaining items
mrveiss commentedon Nov 6, 2026
Local branch
issue-17527-provenance-accessor(not on GitHub), inspected 2026-11-06Verdict: LANDED (triage said REAL-UNIQUE)
Intent: One accessor for five provenance dialects in the KB, every reader migrated, and a guard (filed under #17618).
Result: Corrected from REAL-UNIQUE. All three commits are on main (1fce5cd, 10a6c0d, 96e478f); provenance_test.py and the context-builder test are identical on main. Pending lines are guard/doc wording main reworded.
Commits not on main (3 non-merge, 0 merge):
927c6f239cfix(kb): the agentic citation keeps the writer's own source label; the URN only fills a gap (bug(llc): the KB context'ssourcesanswers tenancy, not where the document came from #17618)11b0437ab7fix(kb): record the provenance scan's reach verdict (bug(llc): the KB context'ssourcesanswers tenancy, not where the document came from #17618)e8db053591feat(kb): one accessor for five provenance dialects, every reader migrated, and a guard (bug(llc): the KB context'ssourcesanswers tenancy, not where the document came from #17618)Pending hunks (added lines not on main): 4 hunks in 4 files; largest:
autobot-backend/knowledge/provenance.py:(top level)(5 lines) — # The only leg that writes nosource. Its identity is the connectordocs/developer/KB_ROUND_TRIP.md:(top level)(5 lines) — > LLC module, with its source identifiable. If any path cannot demonstrate that,repo_tests/_reach_policy.py:ALLOWANCE_VERDICTS: dict[str, tuple[str, str, str]] = {(3 lines) — "provenance-accessor-scan": (repo_tests/provenance_accessor_17527_test.py:(top level)(3 lines) — return sum(1 for node in ast.walk(ast.parse(source)) if _reads_key(node))mrveiss commentedon Nov 6, 2026
Local branch
issue-17527-round-trip(not on GitHub), inspected 2026-11-06Verdict: LANDED (triage said REAL-UNIQUE)
Intent: First version of the provenance accessor plus the KB round-trip acceptance procedure (KB_ROUND_TRIP.md).
Result: Corrected from REAL-UNIQUE. The accessor is superseded by main's #17618 version; main's KB_ROUND_TRIP.md has the "What this procedure leaves behind, and who can remove it" section from d2912d7. Pending hunks are docstring wording. Do NOT revive. The criterion itself (a live four-path round trip) is still open on this umbrella.
Commits not on main (2 non-merge, 0 merge):
d2912d7256docs(kb): name what the round trip leaves behind, and who can remove it (Umbrella: knowledge base intake is built but two legs are severed — upload has no UI, transcriber output cannot land #17527)e89fe7014dfeat(kb): one accessor for five provenance dialects, and the LLC surfaces it (Umbrella: knowledge base intake is built but two legs are severed — upload has no UI, transcriber output cannot land #17527)Pending hunks (added lines not on main): 4 hunks in 3 files; largest:
autobot-backend/knowledge/provenance.py:(top level)(13 lines) — _UNKNOWN = Origin(leg=None, reference=None)autobot-backend/llc/kb/context_builder.py:class HeartbeatContextBuilder:(7 lines) —sourcesholds company ids and always has — it answers which tenantdocs/developer/KB_ROUND_TRIP.md:(top level)(5 lines) — > LLC module, with its source identifiable. If any path cannot demonstrate that,autobot-backend/llc/kb/context_builder.py:class HeartbeatContextBuilder:(3 lines) — # Five intake legs write provenance in five dialects; the accessormrveiss commentedon Nov 20, 2026
Branches
issue-17527-round-trip(PR #21811, head 663b9df) andissue-17527-provenance-accessor(PR #21818, head 29cdae8) were deleted as zero-change branches: their content is already on main. None of the five ACs is ticked: I found no/knowledge/managewiring toPOST /knowledge/upload(only a/knowledge/uploadroute push inKnowledgeBrowser.vue:17,1109), and the end-to-end retrieval AC needs run evidence.