distillcore
Skip to Content
AgentsOverview

Agents

distillcore-agents adds an autonomous orchestration layer on top of the distillcore pipeline. Four specialized agents collaborate to process documents end-to-end.

Architecture

Document → [Triage] → [Processing] → [QA] → [Research*] → Result * conditional
AgentModelToolsPurpose
Triage5.4-mini2Assess document, select preset and config
Processing5.4-mini2Execute pipeline, save results
QA5.4-mini2Validate coverage and chunk quality
Research5.4-mini3Search stored docs, synthesize answers

Quick Start

from distillcore_agents import Orchestrator async with Orchestrator(openai_api_key="sk-...") as orch: result = await orch.process_one("contract.pdf") print(result.triage.preset) # "legal" print(result.triage.reasoning) # "Contains case numbers..." print(result.processing.chunk_count) # 24 print(result.qa.verified) # True

Pipeline Flow

  1. Triage previews the document and selects the optimal configuration
  2. Processing runs the full 7-stage pipeline with triage’s recommendations
  3. QA checks coverage thresholds and inspects chunk quality
  4. Research only runs if QA fails, searching for context to improve results

Batch Processing

async with Orchestrator() as orch: batch = await orch.process_batch( ["doc1.pdf", "doc2.pdf", "doc3.pdf"], max_concurrency=3, ) print(f"{batch.succeeded}/{batch.total} succeeded")

Streaming

async with Orchestrator() as orch: async for event, result in orch.process_one_stream("doc.pdf"): print(event.event_type, event.data) # result is the final PipelineResult

Learn More