=================================================================================
_ _ __ ____ _ _ _ ____ _
/ \ | |/ // ___|| | | | / \ | _ \ / \
/ _ \ | ' / \___ \| |_| | / _ \ | |_) | / _ \
/ ___ \| . \ ___) | _ |/ ___ \| _ < / ___ \
/_/ \_\_|\_\|____/|_| |_/_/ \_\_| \_\/_/ \_\
V I S I O N
Restore. Read. Preserve.
=================================================================================
A local-first, vendor-agnostic document intelligence CLI & grounded chat workbench
Vision language models and LLMs are excellent at OCR correction and translation, but integrating them directly into bulk archival pipelines fails on practical execution.
Workflows are fragile. A network drop can ruin a multi-hour book extraction, dense scans trigger context truncation, and models ignore layout structural metadata entirely.
| Ad-Hoc Model Calls | Akshara Vision Engine |
|---|---|
| Fragile Pipelines API failures or terminal exits abort progress; no state preservation. | Resumable Stages Continuous page checkpoints guarantee no data loss on interruption. |
| Raw Text Clutter Extracts plain strings without layout tags, figures, or roles. | Structure Normalization Builds normalized layout trees mapping columns, headers, and figures. |
| Vendor Lock-in Hardcoded connections restrict migration between platforms. | Model-Agnostic Routing Uniform routing across local GGUF offline engines or cloud APIs. |
Every page is parsed hierarchically, extracting reading orders, column estimates, local geometry, and semantic document roles.
| Quality | Full pipeline: local layout parse + block-guided LLM restoration + vision crop verification. Best accuracy for damaged pages. |
| Balanced | Saves time: local layout parse + direct block-guided text restoration. Skips costly iterative layout reviews. |
| Fast | Max speed: bypasses block mapping, visual segment prompting, role classification, and crops. Fast pure text extraction. |
[BLOCK x] tags.
Ask questions directly over processed run directories. All answers are strictly grounded in indexed source text chunks, maintaining absolute audit trails.
$ akv chat examples/sample.txt [i] Running grounded chat over examples/sample.txt [i] Type /exit or Ctrl+D to end. akv chat › /find land grant [i] Found 2 matches in sources: * Page 3 (Paragraph block 1) * Page 7 (Footnote block 4) akv chat › What year was the land grant executed? The land grant was executed in 1823 during the reign of Serfoji II (Page 3).
Run folders can be reviewed visually inside the terminal or compared side-by-side inside a browser to verify rendering and layout composition.
Plots text columns and figure regions directly in a terminal-native layout preview screen before generating exports.
`akv compare` compiles a side-by-side visual report of raw pages and restored text to review image crops and layout flow.
Saves a readable `layout_review.md` in the run directory. Delete incorrect figure crop assets locally to skip them automatically.
Routes queries transparently. Run offline local models (Ollama, LM Studio, Jan, llama.cpp) for privacy and zero cost, or scale out to cloud APIs (Gemini, OpenRouter, Anthropic).
Writes page/chunk stage checkpoints. Interruptions (Ctrl+C, network crash) do not force re-processing. Simply run resume to recover completed pages and compile state.
Caches `layout_tree`, `semantic_units`, and `layout_profile`. Detects footnotes, running headers, table of contents, contributors, and page boundaries for clean formatting.
Builds structured book packages. Outputs clean copy-paste text, formatted Markdown, HTML, DOCX, publication-ready EPUB files, and formatted PDF documents.
Built with a modular backend routing layer, abstract layout interfaces, and extensible file exporters.
Ensures high runtime reliability and seamless integration with existing archival pipelines.