Knowledge Base: The Questions Your Schema Did Not Ask
Structured output answers the questions you knew to ask when you designed the schema. Every anyformat workflow now ships with a knowledge base that answers the ones you did not, and every answer cites the page and the region it came from.
A schema is a list of questions. Counterparty, effective date, contract value, payment terms: every field is a question you knew to ask when you designed the workflow, and extraction answers it on every document, at volume, with a confidence score attached. That is the job, and it is most of the value.
But a schema is written before the documents arrive, and the documents do not read it. Three months in, someone in finance needs to know which of the contracts processed this quarter renew before March, and what notice each one requires. Nobody put a renewal clause in the schema, because nobody was thinking about renewals when the schema was about totals. The answer is in the documents. The workflow parsed every one of them. And the only ways to get it are to open the PDFs one by one, or to write a new schema, re-run extraction and wait.
Structured output answers the questions you knew to ask. The ones you did not are not the exception. They are most of the questions a document gets asked after it has been processed. Today every anyformat workflow answers those too, with the same evidence behind each answer that sits behind every extracted field.
What ships today
Every anyformat workflow can now ship with a knowledge base. You add the Knowledge Base node to the canvas, downstream of Parse, Extract or Validate. It has no options: its presence is the switch. After each run, the latest parse of every document in the workflow is compiled into the corpus, and the corpus accumulates across runs and workflow versions. Then you ask it questions, from the Knowledge Base tab in Studio or from the /ask endpoint, and every answer comes back with citations: the file, the page, and the bounding box of the region the answer was read from.
Take a supplier contract workflow. Parse reads each contract into pages and blocks. Extract pulls the counterparty, the effective date and the value. Validate checks the value against the purchase order. The Knowledge Base node sits at the end and compiles everything Parse produced. Now ask it the question from the paragraph above. This is the request, and this is the response as it appears in the API reference (the reference example keeps a single citation for brevity):
curl -X POST 'https://api.anyformat.ai/v3/workflows/{workflow_id}/knowledge/ask' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"question": "Which contracts renew before March and what notice do they need?"}'{
"answer": "Two contracts renew before March. Meridian MSA renews 2026-02-01 and needs ninety days' notice to terminate. Aldrete supply agreement renews 2026-02-14 with thirty days' notice.",
"citations": [
{
"path": "2026-07/meridian-msa-2024.md",
"quote": "Either Party may terminate upon ninety (90) days' notice.",
"file_id": "0192f0c1-a2b3-4c5d-8000-abcdef012345",
"block_id": "block-2",
"page": 2,
"bbox": { "x0": 0.08, "y0": 0.31, "x1": 0.92, "y1": 0.36 }
}
],
"path": [
{ "tool": "kb_grep", "args": { "pattern": "renewal" } },
{ "tool": "kb_read", "args": { "path": "2026-07/meridian-msa-2024.md" } }
],
"steps_used": 2,
"thread_id": null
}The citation is not a document title or a chunk number. It is a sentence, on a page, inside a rectangle. The path shows how the answer was found: one search for renewal clauses, one read of the Meridian contract, two steps. In Studio, clicking it opens that page with the region highlighted, so checking an answer takes the two seconds it should take. Follow-up questions pass a thread id and keep the context of the ones before.
Why it is not a vector store
The obvious way to build this is the one everyone has seen: split the text into chunks, embed the chunks, store the vectors, retrieve the nearest ones, put them in a prompt. RAG in its usual shape. We did not build it that way, and each decision has a reason.
The corpus is the parse, not a second copy of the document. Extraction already ran on a parsed representation: pages, blocks, tables, each block with its position on the page. The knowledge base is compiled from those same blocks. There is no separate ingestion, no second OCR pass, no chunker with its own opinion about where a paragraph ends. One representation means one truth. A field that Extract pulled from block 2 on page 2, and an answer that cites block 2 on page 2, are pointing at the same ink.
Retrieval navigates the document instead of searching for lookalike text. Similarity search returns whatever chunks resemble the question. For "what notice period" across forty contracts, that is forty near-identical paragraphs and no reliable way to tell which belongs to which. The answer agent works the way a person works with a filing cabinet instead: it lists what is there, opens the documents that matter, reads the sections that matter, and stops. The response returns the path it took and the number of steps it used, as in the example above, so the retrieval is inspectable rather than hidden behind a similarity threshold.
No vector store in the critical path. Nothing to re-embed when a model changes. No index to rebuild. No second datastore to back up, secure, and keep in sync with the documents it was built from. Compilation is incremental: after a run, only pages whose content is new or changed are compiled, and those are the only pages you pay for.
One audit chain. Extraction, validation and /ask all cite the same parse: the same file ids, the same pages, the same block ids, the same bounding boxes. When an auditor asks where a number came from, the evidence has the same shape whether the number came out of a schema or out of a question. That is the difference between an assistant bolted onto a document store and a feature of the workflow.
Compiled, not indexed. The knowledge base is not an index over text. It is the workflow's own parsed corpus, made queryable. As far as we know, nobody else ships this: an answer, an extracted field and a validation verdict that all point at the same block on the same page, inside the same workflow. That is the level of grounding we mean when we say cited.
Enterprise grade by inheritance
Because the knowledge base is a node in the workflow, it inherits the workflow's posture. The documents it answers from are the documents the workflow already holds, under the same organization, the same access control and the same data handling. The corpus is scoped to the workflow: a question asked of one workflow cannot read another workflow's documents. There is no export to a separate service, and no second copy of the corpus living somewhere else with its own retention rules. The controls that earned the platform its ISO 27001 certification cover it because it never left the platform.
Cost is bounded the same way. A question is metered on the text the agent actually reads, and a question the organization cannot afford is refused before anything runs, not billed afterwards.
Getting started
Add the Knowledge Base node to any workflow, run it once, and ask. Until the first compilation finishes, /ask returns a 409 rather than a partial answer. After that, questions go through the Knowledge Base tab in Studio or through POST /v3/workflows/{workflow_id}/knowledge/ask with a plain-language question and an optional thread id.
The pricing is the published per-page model. Compiling costs 2 credits per page, charged only for new or changed content, so Parse plus Knowledge Base comes to 27 credits per page. A question costs 8 credits per 10,000 input tokens the agent reads, which means a narrow question costs less than a broad one. Browsing and searching the corpus in Studio are free.
The corpus is also open to agents. The anyformat MCP server exposes it through ask_knowledge, search_knowledge and read_knowledge, so a coding assistant or an agent of your own can build on top of it today. More agentic features on top of the knowledge base are coming soon.
Knowledge Base is live in the anyformat platform today. The documentation covers the node, the tab and the endpoint in detail.
anyformat is the document intelligence platform that turns unstructured documents into reliable, structured data, with enterprise-grade security, confidence scoring, and full auditability. Learn more at anyformat.ai.







