# oracle/agent-spec architecture

> Architecture diagram of the GitHub repository oracle/agent-spec, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oracle/agent-spec
- Repository: https://github.com/oracle/agent-spec

## Overview

AgentSpec is a portable, framework-agnostic specification and SDK for describing agents and structured flows, with Python and TypeScript implementations. The main workflow is to define components and their properties, serialize or deserialize configurations, then load them through a runtime adapter for execution in an agent framework. The repository also includes evaluation, tracing, data-source, and integration capabilities. Relationships are limited to those supported by the README or the supplied source index; unsampled subsystem internals are not inferred.

Main entry points: [`pyagentspec/src/pyagentspec/__init__.py`](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/__init__.py) (Python SDK), [`tsagentspec/src/index.ts`](https://github.com/oracle/agent-spec/blob/main/tsagentspec/src/index.ts) (TypeScript SDK), [`pyagentspec/src/pyagentspec/component.py`](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/component.py) (Components), [`pyagentspec/src/pyagentspec/llms/llmconfig.py`](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/llms/llmconfig.py) (LLM configs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Specification model"]
  node_py["Python SDK<br/>[__init__.py]"]
  node_ts["TypeScript SDK<br/>[index.ts]"]
  node_component["Components<br/>[component.py]"]
  node_properties["Typed properties<br/>[property.py]"]
  node_agents["Agents<br/>[agent.py]"]
  node_flows["Structured flows<br/>[flow.py]"]
  node_llm["LLM configs<br/>[llmconfig.py]"]
  node_tools["Tools and MCP<br/>[tool.py]"]
  node_serialization["JSON/YAML serialization<br/>[serializer.py]"]
  node_datastores["Datastores<br/>[datastore.py]"]
  node_transforms["Message transforms<br/>[transforms.py]"]
end

subgraph group_runtime["Runtime adapters"]
  node_adapters["Framework adapters"]
  node_langgraph["LangGraph adapter"]
  node_wayflow["WayFlow adapter"]
end

subgraph group_eval["Evaluation and observability"]
  node_evaluation["Evaluation<br/>[evaluator.py]"]
  node_metrics["Metrics and judges<br/>[metrics.py]"]
  node_tracing["Tracing<br/>[trace.py]"]
end

subgraph group_integrations["External integrations"]
  node_llmservices["LLM providers"]
  node_mcpservices["MCP services"]
end

node_builder(("SDK user"))
node_framework["Agent frameworks"]

node_builder -->|"defines configurations"| node_py
node_builder -->|"defines configurations"| node_ts
node_py -->|"builds abstractions"| node_component
node_ts -->|"builds abstractions"| node_component
node_component -->|"uses properties"| node_properties
node_builder -->|"creates agents"| node_agents
node_builder -->|"creates flows"| node_flows
node_agents -->|"configures with"| node_llm
node_py -->|"serializes components"| node_serialization
node_ts -->|"serializes components"| node_serialization
node_builder -.->|"composes tools"| node_tools
node_builder -.->|"configures data access"| node_datastores
node_builder -.->|"configures transforms"| node_transforms
node_builder -->|"selects adapter"| node_adapters
node_adapters -->|"transforms for execution"| node_framework
node_langgraph -->|"compiles configurations"| node_framework
node_wayflow -->|"loads configurations"| node_framework
node_builder -.->|"evaluates agents"| node_evaluation
node_evaluation -.->|"computes metrics"| node_metrics
node_metrics -->|"uses judge model"| node_llm
node_builder -.->|"observes execution"| node_tracing
node_llm -.->|"configures providers"| node_llmservices
node_tools -.->|"connects via MCP"| node_mcpservices

click node_py "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/__init__.py"
click node_ts "https://github.com/oracle/agent-spec/blob/main/tsagentspec/src/index.ts"
click node_component "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/component.py"
click node_properties "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/property.py"
click node_agents "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/agent.py"
click node_flows "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/flows/flow.py"
click node_llm "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/llms/llmconfig.py"
click node_tools "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/tools/tool.py"
click node_serialization "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/serialization/serializer.py"
click node_datastores "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/datastores/datastore.py"
click node_transforms "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/transforms/transforms.py"
click node_adapters "https://github.com/oracle/agent-spec/tree/main/pyagentspec/src/pyagentspec/adapters"
click node_langgraph "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/adapters/langgraph/_langgraphconverter.py"
click node_wayflow "https://github.com/oracle/agent-spec/tree/main/pyagentspec/src/pyagentspec/adapters/wayflow"
click node_evaluation "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/evaluation/evaluator/evaluator.py"
click node_metrics "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/evaluation/metrics/metrics.py"
click node_tracing "https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/tracing/trace.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_py,node_ts,node_component,node_properties,node_agents,node_flows,node_llm,node_tools,node_serialization,node_datastores,node_transforms,node_builder toneBlue
class node_adapters,node_langgraph,node_wayflow toneAmber
class node_evaluation,node_metrics,node_tracing toneMint
class node_llmservices,node_mcpservices toneRose
class node_framework toneIndigo
```

## Components

### Specification model

- [Python SDK](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/__init__.py): `pyagentspec/src/pyagentspec/__init__.py`
- [TypeScript SDK](https://github.com/oracle/agent-spec/blob/main/tsagentspec/src/index.ts): `tsagentspec/src/index.ts`
- [Components](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/component.py): `pyagentspec/src/pyagentspec/component.py`
- [Typed properties](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/property.py): `pyagentspec/src/pyagentspec/property.py`
- [Agents](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/agent.py): `pyagentspec/src/pyagentspec/agent.py`
- [Structured flows](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/flows/flow.py): `pyagentspec/src/pyagentspec/flows/flow.py`
- [LLM configs](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/llms/llmconfig.py): `pyagentspec/src/pyagentspec/llms/llmconfig.py`
- [Tools and MCP](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/tools/tool.py): `pyagentspec/src/pyagentspec/tools/tool.py`
- [JSON/YAML serialization](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/serialization/serializer.py): `pyagentspec/src/pyagentspec/serialization/serializer.py`
- [Datastores](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/datastores/datastore.py): `pyagentspec/src/pyagentspec/datastores/datastore.py`
- [Message transforms](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/transforms/transforms.py): `pyagentspec/src/pyagentspec/transforms/transforms.py`

### Runtime adapters

- [Framework adapters](https://github.com/oracle/agent-spec/tree/main/pyagentspec/src/pyagentspec/adapters): `pyagentspec/src/pyagentspec/adapters`
- [LangGraph adapter](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/adapters/langgraph/_langgraphconverter.py): `pyagentspec/src/pyagentspec/adapters/langgraph/_langgraphconverter.py`
- [WayFlow adapter](https://github.com/oracle/agent-spec/tree/main/pyagentspec/src/pyagentspec/adapters/wayflow): `pyagentspec/src/pyagentspec/adapters/wayflow`

### Evaluation and observability

- [Evaluation](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/evaluation/evaluator/evaluator.py): `pyagentspec/src/pyagentspec/evaluation/evaluator/evaluator.py`
- [Metrics and judges](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/evaluation/metrics/metrics.py): `pyagentspec/src/pyagentspec/evaluation/metrics/metrics.py`
- [Tracing](https://github.com/oracle/agent-spec/blob/main/pyagentspec/src/pyagentspec/tracing/trace.py): `pyagentspec/src/pyagentspec/tracing/trace.py`

### External integrations

- **LLM providers**
- **MCP services**

### Other components

- **SDK user**
- **Agent frameworks**

## Connections

- SDK user → Python SDK: defines configurations (evidence: `README.md`)
- SDK user → TypeScript SDK: defines configurations (evidence: `tsagentspec/src/index.ts`)
- Python SDK → Components: builds abstractions (evidence: `README.md`)
- TypeScript SDK → Components: builds abstractions (evidence: `tsagentspec/src/index.ts`)
- Components → Typed properties: uses properties (evidence: `pyagentspec/src/pyagentspec/component.py`)
- SDK user → Agents: creates agents (evidence: `README.md`)
- SDK user → Structured flows: creates flows (evidence: `README.md`)
- Agents → LLM configs: configures with (evidence: `README.md`)
- Python SDK → JSON/YAML serialization: serializes components (evidence: `README.md`)
- TypeScript SDK → JSON/YAML serialization: serializes components (evidence: `tsagentspec/src/index.ts`)
- SDK user → Tools and MCP: composes tools
- SDK user → Datastores: configures data access
- SDK user → Message transforms: configures transforms
- SDK user → Framework adapters: selects adapter (evidence: `README.md`)
- Framework adapters → Agent frameworks: transforms for execution (evidence: `README.md`)
- LangGraph adapter → Agent frameworks: compiles configurations
- WayFlow adapter → Agent frameworks: loads configurations (evidence: `README.md`)
- SDK user → Evaluation: evaluates agents
- Evaluation → Metrics and judges: computes metrics
- Metrics and judges → LLM configs: uses judge model
- SDK user → Tracing: observes execution
- LLM configs → LLM providers: configures providers
- Tools and MCP → MCP services: connects via MCP
