Pure Go · zero dependencies · deterministic

The document engine for
AI applications

Turn PDF, Office, HTML, email and scans into a queryable, citable intermediate representation — then query it, pack a context window, recompile or redact it, and ground every answer in the exact page region.

Zero dependenciesDeterministic outputEvery block cited
q3-report.pdfPOST /v1/parse
heading1.00
paragraph0.99
table0.97
figure0.95
{ "id": "324b1b83", "source_format": "pdf" }
headingp1-b0Q3 Report
paragraphp1-b1Revenue grew 18% this quarter.
tablep1-b2rows: 3 · cols: 4
figurep1-b3chart.png
One API forPDFDOCXXLSXPPTXHTMLEMLPNGJPEG
The surface

Not a text extractor. A document compiler.

Every format becomes one intermediate representation you can query, pack, recompile, search and verify — deterministically, no model in the loop.

A queryable, citable IR

Every block gets a stable id like p2-b7. Select by type, heading, page or text — and resolve any citation back to the exact region on the page.

headingp1-b0
paragraphp1-b1
tablep1-b4

Context, packed

Fit the highest-value blocks into a token budget — in reading order, with citations.

2,000 budget1,180

Recompile & redact

Deterministic IR→IR passes, then re-emit as IR, Markdown or text.

drop furniturekeep §Financialsredact PII

Search the library

Full-text across every stored doc — ranked, block-level, cited.

p1-b3…total revenue grew…

Pixel-faithful pages

Born-digital text redrawn from the file's own embedded fonts.

pure-Go glyphs

Verifiable fidelity

A 0–1 score for how faithfully each document was reconstructed.

0.94
high
How it works

One pipeline. Every arrow is an interface.

Watch a document move from raw bytes to one intermediate representation — the same IR everything downstream reads.

01 / 06

Parse

Format parsers lower each document into positioned primitives — text with geometry, embedded fonts, bookmarks and links.

25 50 44 46 2D 31 2E 37↓
Revenuegrew18%

Not a black box — the playground streams every stage live as your file parses, page by page.

Deterministic IDs
p2-b7 = page 2, reading order 7. Same input, byte-identical output.
Honest confidence
Explicit structure reports 1.0; heuristics report what they actually know.
Geometry survives
Blocks keep bounding boxes, so answers highlight on the page image.
Reverse-engineerable
Query it, pack it, recompile it, verify it — a document as a compiler artifact.
Under the hood

Built from the bytes up. Not a wrapper.

Most “document AI” is a thin client over a cloud API or a neural model. Cognita reads the bytes itself — the PDF object graph, the font outlines, the page raster — in one deterministic process. Nothing here calls out to a model or a server; your file never leaves the box.

$ cat go.mod
module cognita

go 1.26

require go.mongodb.org/mongo-driver v1.17.1  // the document store

// everything below is transitive — pulled in by
// the driver, not by anything that reads a document
require (
  github.com/golang/snappy         // indirect
  github.com/klauspost/compress    // indirect
  golang.org/x/crypto              // indirect
  golang.org/x/text                // indirect
  …
)
One direct dependency — and it's the database. Every parser, the font engine, OCR and layout are standard-library Go.
25K+lines of Go
41internal packages
1direct dependency
0model or cloud calls
Written from first principles
internal/parser/pdf/filter.go
// decode applies a PDF stream's filter chain
switch name {
case "FlateDecode": return inflate(data)
case "LZWDecode": return lzw(data)
case "ASCII85Decode": return ascii85(data)
case "RunLengthDecode": return runLength(data)
case "CCITTFaxDecode": return ccitt(data, params)
}
xref tables & streams, object streams, a hand-written lexer — and every stream filter.

Send a file, get structure.

Sign in and turn any document into AI-native JSON, Markdown, RAG chunks and page images — with one API call.

Try CognitaRead the docs
Service temporarily unavailable

We can't reach the Cognita API right now. Please try again in a few minutes.