Skip to content

Types

Literal aliases for the enum-ish string args, and TypedDicts for dict-shaped return values. Importing from here gives you IDE autocomplete on result fields and rejects typos in arguments.

from kglite_docs.types import Verdict, SearchHit

def my_fn(verdict: Verdict) -> list[SearchHit]:
    ...

Public type aliases.

TypedDicts for the dict-shaped values our methods return, and Literals for the enum-ish string arguments. Importing from here gives IDE/type-checker autocomplete on result fields and rejects typos in arguments.

Example::

from kglite_docs.types import Verdict, SearchHit

def my_fn(verdict: Verdict) -> list[SearchHit]:
    ...

SearchHit

Bases: TypedDict

One row from Corpus.search(). Fields beyond id, score, type are best-effort — some are added by post-join enrichment and may be missing when the underlying chunk has unusual state.

DocumentRow

Bases: TypedDict

One row from Corpus.list_documents().

DocumentDetail

Bases: TypedDict

Corpus.get_document() return shape.

SectionRow

Bases: TypedDict

One row from Corpus.list_sections() — the grain between document and chunk (derived from the PDF outline or top-level headings at ingest).

ChunkDetail

Bases: TypedDict

Corpus.get_chunk() return shape.

SummaryRow

Bases: TypedDict

Corpus.get_summaries() row.

IngestSummary

Bases: TypedDict

Aggregate of Corpus.ingest_dir() results.

PendingOcrRow

Bases: TypedDict

Corpus.list_pending_ocr() row.

OcrStatusRow

Bases: TypedDict

Per-document OCR status (the documents array in ocr_status()).

OcrStatus

Bases: TypedDict

Corpus.ocr_status() return shape.

CoverageDocRow

Bases: TypedDict

Per-document row in coverage_report().

CoverageReport

Bases: TypedDict

Corpus.coverage_report() return shape — honest extraction + embedding coverage with a human-readable summary.

CorpusStatus

Bases: TypedDict

Corpus.status() — one-call snapshot of the corpus.

TriageMap

Bases: TypedDict

Corpus.triage_map() — aggregated content signals for orientation.

ReviewTicketRow

Bases: TypedDict

One row from Corpus.list_review_queue(). Add target and events by going through Corpus.get_review_ticket().

ReviewEvent

Bases: TypedDict

One event in a ticket's audit trail.

ReviewTicketDetail

Bases: ReviewTicketRow

Corpus.get_review_ticket() return shape.

ReviewStats

Bases: TypedDict

Corpus.review_stats() return shape.

AgentRow

Bases: TypedDict

Corpus.list_agents() row — identity + counters, no template.

AgentConfig

Bases: TypedDict

Corpus.get_agent() return shape — full template + counters.

tools and context are hydrated from the underlying JSON properties so callers receive a real list / dict, not strings.

AgentActivity

Bases: TypedDict

Corpus.agent_activity() return shape — what an agent has done, optionally scoped to one target node.

TagRow

Bases: TypedDict

Corpus.list_tags() row.

ContextItem

Bases: TypedDict

One entry in Corpus.compose_context()['items'].

ComposedContext

Bases: TypedDict

Corpus.compose_context() return shape.

GroundingSentence

Bases: TypedDict

One sentence's grounding analysis inside check_grounding.

ComparisonQueryResult

Bases: TypedDict

Per-query hits from each side of a compare_documents call.

ComparisonResult

Bases: TypedDict

Corpus.compare_documents() return shape.

Side-by-side cross-document retrieval result. For each query in the input list, you get the top hits from each document independently plus a budgeted merged context bundle suitable for handing to a downstream LLM that's writing a comparison.

GroundingReport

Bases: TypedDict

Corpus.check_grounding() return shape.

StudyRow

Bases: TypedDict

One study from Corpus.list_studies() / get_study().

AssessmentRow

Bases: TypedDict

One ranked row in a study ledger.

Ledger

Bases: TypedDict

Corpus.study_ledger() return shape — weight-ranked evidence.

FindingRow

Bases: TypedDict

One cross-chunk Finding from Corpus.list_findings() — a pattern asserted over a set of chunks.

ReportRow

Bases: TypedDict

A versioned study report from Corpus.get_report().

ConflictRow

Bases: TypedDict

One contested chunk — current supports vs against assessments.

ConflictReport

Bases: TypedDict

Corpus.study_conflicts() return shape.