Skip to content

op doc_ocr

Mikhail Deynekin edited this page Nov 22, 2026 · 7 revisions

doc_ocr

State of the OCR capability and the decision for one particular file.

Group Documents
Edition pro — opens with a Pro licence
Capability doc-ocr — the feature that carries this operation; the licence matrix is on 15 · Editions and licensing
MCP tool ragraf_doc_ocr · read-only · idempotent
CLI ragraf -p <config> query doc_ocr …

Why it exists

The capability is declared by the Pro edition (doc-ocr), so on Community the call is refused by the edition layer with a reason BEFORE the engine is checked — which keeps "not licensed" and "no engine" as different answers. One operation covers both the state of the capability and the decision for a given file, because a second call would add no fact.

What it solves

  • Ask whether OCR is available under the current edition.
  • Ask what will happen to one specific file before running anything.
  • Tell a licence refusal from a missing engine.

How to use it

Command line: ragraf -p <config> query doc_ocr. The flags follow the parameter names; the CLI maps a few of them to its own switches, listed in 05 · CLI Reference.

$ ragraf -p <config> query doc_ocr

The same call through MCP: ragraf_doc_ocr().

No executed example. This operation needs the pro edition, and the demo run is a community one.

The call form above is generated from the signature; running it needs a corpus that supports the operation, and the page does not pretend an answer it has not seen.

Parameters

Name Type Default
path str ''

What it returns

Result keys visible in the code: edition, enabled, engine, reason, state.

The envelope around the result is the same for every operation; how to read it: 04 · Operations reference.

How it works

Step What happens
Reads none of the three stores directly — the answer comes through the engine the body calls, or from what the call is given
Calls no module function: the body computes the answer itself
Guarded by nothing: no licence gate and no revision check, the body answers directly
Writes nothing outside its own answer
Empty answer no separate branch: the body returns what it computed
flowchart TD
  Start[query doc_ocr]
  Body[operation body]
  Out[envelope with result]
  Start --> Body
  Body --> Out
Loading

Where it stops

Every answer carries a limits field, and it is never empty when a boundary exists: that is where the limits of this particular call are named — which part of the corpus was not covered, which fact could not be confirmed, what the operation refused to guess.

The boundary of the whole Documents group is stated once, on the reference page. It is a sentence about the group, so it is not repeated here as if it were a sentence about doc_ocr.

Around this group

← previous in the group: doc_search_levels

→ next in the group: entity_neighbors

The full table with all 87 operations · A–Z index · Documents


Where these fields come from: the parameters, their types and defaults are read from the signature op_doc_ocr in src/ragraf/facade.py:6430 (line numbers as of 0.12.0); the MCP annotations from the tool registration; the edition from src/ragraf/edition_baseline.json; the guards, calls, stores, envelope fields and the diagram from the body of that same method. The example is a run of tools/build-op-examples.py on the demo corpus at revision rev-0002; fields whose value is Russian prose in this build (limits, explanatory strings) are counted, not quoted. Nothing else on this page is written by hand.

The reason and the tasks above are a translation of the docstring of op_doc_ocr, src/ragraf/facade.py:6430, kept in tools/op-text.json next to the line it came from. That file is the only hand-written text in the pipeline; the gate tools/check-op-text.py checks that the line exists and that its text is English.

Clone this wiki locally