Which document should an agent read first?
Which document should an agent read first?
Why not hand an agent every company document and let it find the answer? More material sounds like more knowledge. In practice, a shared folder may contain two versions of a procedure, a price list restricted to procurement and a personnel file that should never be considered for a finance question. A model cannot repair an access decision after the text has already entered its context. Choosing what the agent reads first is therefore a question about ownership and permissions as much as search quality.
Imagine procurement asking how to compare supplier proposals. The folder contains an old evaluation form, a newer procedure and finance budget notes. Pasting everything into the conversation asks the model to decide which document this person may see, which version applies and which passage answers the question. If access is decided incorrectly, even a well worded answer can disclose restricted information. This is an illustrative workflow, not a customer incident.
Searching is not permission checking
Accepted ADR-0015 in the agentic-organization repository sets out a design for ingesting and ranking company documents. Its two starting requirements are a small context and access control. Small context means sending only a few relevant passages to the answering model. Access control means the agent must not receive a passage outside the caller’s permitted company, department, role or classification. Neither requirement follows automatically from asking a language model to “use the right files.”
Plain text extraction can lose the relationship between headings and paragraphs, or between columns and values in a table. The ADR selects Docling and structure-aware chunking to preserve those relationships. It proposes storing chunks with source, version and access fields. Reingestion should avoid duplicates, while an older version becomes invisible to search without deletion. These are design decisions, not a running document ingestion service.
The order of operations matters more than the ranking algorithm’s name. ADR-0015 proposes gathering candidates from keyword and vector search, but filtering them by the caller’s access rights in SQL before ranking. If a procurement user may not read an HR record, that record should not enter the candidate set, however closely its words match the question. Filtering an answer after generation is too late: the restricted passage has already reached the model, and possibly an external ranking service. The design places the boundary earlier. Whether a deployment actually enforces it must be checked in the implementation, not inferred from the ADR’s accepted status.
What relevance can and cannot decide
Keyword search catches literal terms but can miss a relevant paragraph written differently. Vector similarity broadens the search, yet semantic proximity does not prove that a passage is current or answers the precise question. ADR-0015 chooses both ways of finding candidates, followed by reranking. The proposed ranker keeps passages above a calibrated threshold. If none qualifies, the agent should say so instead of improvising.
For installations permitting cloud processing, the decision names TypeSafe Jev. For those keeping documents on premises, it proposes a local cross-encoder fallback. The ranker selects evidence, not the answer. Calibration remains unfinished: the ADR calls for latency and cost experiments followed by threshold testing on sample policies. An accepted design does not make an untested threshold reliable.
The cloud option sends candidate passages outside the installation. ADR-0015 calls this an accepted residual risk: the choice should be explicit per installation, visible to an administrator and audited. The local path avoids that transfer in the proposed architecture but requires maintaining a model. IT must ask who authorises the transfer, which documents it covers and how to review it.
The implementation boundary today
The current retrieval code solves a narrower problem. backend/services/rag_service.py indexes session messages, task results and agent memories in EmbeddingRecord. It uses pgvector on PostgreSQL or a cosine calculation on other databases. The record has company and human-owner fields, but not ADR-0015’s document metadata for department, role, classification and version. The roadmap lists the Docling worker, ACL-aware DocumentChunk and Jev ranker as unbuilt. Docling’s optional presence in a workspace image does not create a server ingestion pipeline.
The existing memory search returns no results on a cold index or an error. That does not prove that a planned company-document flow produces cited answers or abstains at a calibrated threshold. Nor does unfinished document ingestion make the memory search imaginary. They have different sources, boundaries and promises.
For production, the relevant source might be the latest machine maintenance instruction. Procurement needs the current supplier procedure. Finance may need a budget passage that other departments must not retrieve. HR has personnel records with an especially narrow readership. IT must keep track of document versions, access changes and any external transfer of candidate passages. These examples describe different questions a team should test; they are not claims that those departments have already deployed the proposed system.
A sensible rollout starts with a list of document owners, access rules and version changes, before picking a ranking model. Try a question whose answer exists in an older version but not the current one. Try a question from a user who cannot access the most semantically similar passage. Check what the retrieval step returns before the answering model sees it. Only then measure whether a threshold produces useful abstentions and whether citations identify the right document section and version. Such tests are less glamorous than a polished response, but they reveal whether the agent is reading on the right authority.
An agent does not need the most documents; it needs the right passage under the right permission and from the right version. ADR-0015 in agentic-organization makes that ordering explicit, while leaving the ingestion and ranking implementation as work to be done. For a team deciding how to use its own documents, keeping the proposed boundary separate from today’s retrieval code is the useful starting point.
Verification note: This article was checked against ADR-0015, docs/ROADMAP.md, backend/services/rag_service.py, backend/models.py and sandbox/workspace/README.md in agentic-organization. The proposed document ingestion and ranking pipeline is not presented as an existing feature.