Component Details
The Agent Protocol Interface subsystem in forge/agent_protocol
provides a standardized API for interacting with AI agents, adhering to the Agent Protocol specification. It manages tasks, artifacts, and communication.
ProtocolAgent
This is the core business logic component of the Agent Protocol. It orchestrates the creation, execution, and management of tasks and steps, and handles artifact storage and retrieval. It acts as the bridge between incoming API requests and the underlying agent's capabilities.
APIRouter
This component defines all the API endpoints for the Agent Protocol, mapping specific HTTP methods and URLs to the corresponding handler functions within the ProtocolAgent
. It's built using FastAPI's APIRouter
and serves as the public-facing interface for the Agent Protocol.
AgentDB
This class manages the database connection and provides an abstraction layer for performing CRUD operations on tasks, steps, and artifacts. It ensures that the state of the Agent Protocol entities is persistently stored.
TaskModel
This is an SQLAlchemy ORM model that defines the database schema for tasks, including fields like task ID, input, and status.
StepModel
This is an SQLAlchemy ORM model that defines the database schema for steps, including fields like step ID, task ID, input, and status.
ArtifactModel
This is an SQLAlchemy ORM model that defines the database schema for artifacts, including fields like artifact ID, task ID, step ID, and file path.
Task
This is a Pydantic model that defines the data structure for tasks as specified by the Agent Protocol. It's used for request and response validation and serialization in the API.
Step
This is a Pydantic model that defines the data structure for steps as specified by the Agent Protocol. It's used for request and response validation and serialization in the API.
Artifact
This is a Pydantic model that defines the data structure for artifacts as specified by the Agent Protocol. It's used for request and response validation and serialization in the API.
Middlewares
This module contains middleware functions that are applied to the FastAPI application for cross-cutting concerns like authentication, logging, or global error handling.
FileStorage
A component responsible for managing and storing artifacts.