Skip to content

Data contracts (schemas)

The platform's data contracts are defined as Pydantic models in code and are the single source of truth. The *.schema.json files in this directory are generated from those models — regenerate them with:

.\.venv\Scripts\python.exe scripts\export_schemas.py

LLM layer (aop.llm.types)

Model File Purpose
Message message.schema.json One chat message (role, content).
Usage usage.schema.json Token accounting.
ChatResponse chat_response.schema.json Non-streaming chat result.
ChatChunk chat_chunk.schema.json One streamed delta.
EmbeddingResponse embedding_response.schema.json Embedding vectors.
ModelInfo model_info.schema.json Model metadata.
HealthStatus health_status.schema.json Provider health probe.

Diagnostics (aop.diagnostics.report)

Model File Purpose
CheckResult check_result.schema.json One diagnostic row.
DiagnosticsReport diagnostics_report.schema.json Full aop diagnose output.

Data layer (aop.data.models)

Model File Purpose
SourceSpec source_spec.schema.json Ingestion source description.
Document document.schema.json Unstructured document.
Record record.schema.json Structured (tabular) row.
Chunk chunk.schema.json Embedded chunk (+ RAPTOR tree fields).
QualityReport quality_report.schema.json Data-quality result.
IngestionResult ingestion_result.schema.json Ingestion run summary.
SearchResult search_result.schema.json Ranked retrieval hits.

RAG + memory (aop.rag.models, aop.memory.models)

Model File Purpose
AnswerResult answer_result.schema.json Grounded answer + citations.
MemoryTurn memory_turn.schema.json One conversation turn.
ConversationContext conversation_context.schema.json Assembled memory context.

Orchestrator (aop.tools, aop.orchestrator.models)

Model File Purpose
ToolResult tool_result.schema.json Tool invocation outcome.
Step step.schema.json One agent reasoning/tool step.
AgentResult agent_result.schema.json Full agent run + trace.
CapabilityManifest capability_manifest.schema.json Agent routing manifest.

These contracts are consumed by the CLI and the FastAPI service, and will be consumed by the Canvas UI (Phase 4).