Typed framework for declaring and running agentic systems
Project description
Agent Foundry
Agent Foundry is a typed, boundary-enforced framework for declaring and running agentic systems. Builders compose processes from declared constructs, validate state boundaries, and run them through adapter seams for workflow engines, agent harnesses, model providers, tools, and observability backends.
Current Targets Audience and Use Case
- framework for experimentation and learning
- rapid development of high-quality MVPs
Those seams are the long-term portability strategy. The adapter ecosystem is still a work in progress: Agent Foundry provides the core abstractions and initial integrations, while broader backend and provider support still needs to be built and validated.
Status: alpha. Agent Foundry is pre-1.0 and APIs may change. License: Apache-2.0. See LICENSE.
Why Agent Foundry
Agentic systems are still early. Teams are learning which instructions work, how memory should be managed, what topology fits a use case, which models are worth their cost, where humans should stay in the loop, and how agent behavior should be evaluated.
Agent Foundry is for running those experiments without rebuilding the whole system each time. It keeps the durable shape of an agentic system stable while the volatile parts change: prompts, models, tools, memory strategies, agent harnesses, execution backends, and observability systems.
The core idea is simple: process state crosses construct boundaries through declared Pydantic models. The framework validates those boundaries before and during execution so dynamic agent behavior has an inspectable process frame.
Core Concepts
A process is a tree of typed constructs.
Control-flow constructs shape the process:
- Sequence: run steps in order.
- Loop: iterate over a collection.
- Retry: repeat until a condition passes or attempts are exhausted.
- Conditional: branch on state.
Action constructs do work at the leaves:
- FunctionAction: call in-process Python code.
- AsyncFunctionAction: call async Python code.
- GateAction: pause for human or external input.
- AICall: call a model provider through a typed model-call contract.
- AgentAction: delegate work to an agent executor or harness.
Each construct declares the Pydantic input model it reads and the output model it returns. Composite constructs accumulate internal state and choose which typed fields leave their scope.
Example
from pydantic import BaseModel
from agent_foundry import FunctionAction, Process, Sequence
class DraftInput(BaseModel):
topic: str
class DraftState(BaseModel):
topic: str
outline: str
class DraftOutput(BaseModel):
topic: str
outline: str
title: str
def outline(state: DraftInput) -> DraftState:
return DraftState(topic=state.topic, outline=f"Notes about {state.topic}")
def title(state: DraftState) -> DraftOutput:
return DraftOutput(
topic=state.topic,
outline=state.outline,
title=f"Understanding {state.topic}",
)
process = Process(
root=Sequence[DraftInput, DraftOutput](
steps=[
FunctionAction[DraftInput, DraftState](function=outline),
FunctionAction[DraftState, DraftOutput](function=title),
]
)
)
process.validate()
process.validate() checks that the declared state fields line up across the
construct tree. run_process(...) executes the process and returns a typed
RunOutcome; see Getting started for a full
runnable example.
Current Integrations
Agent Foundry currently includes:
- A LangGraph-backed compiler/runtime for bounded process execution.
- Pydantic-based input and output contracts.
- Function, async function, human gate, model call, and agent action constructs.
- A containerized Claude Code agent execution path.
- Lifecycle events and run summaries.
- OpenTelemetry span emission.
- An optional MLflow adapter.
- An evaluation harness for model and process experiments.
The goal is to make more of these choices replaceable over time. New adapters should preserve Agent Foundry's process, state, error, lifecycle, and output semantics, ideally through shared contract tests.
Install
pip install agent-foundry-ai
pip install agent-foundry-ai[mlflow] # optional MLflow adapter
Requires Python 3.14.
Documentation
| Area | Where |
|---|---|
| Getting started | docs/guides/getting-started.md |
| Agent containers | docs/guides/agent-containers.md |
| Extending Agent Foundry | docs/guides/extending.md |
| Vision | docs/vision.md |
| Architecture | docs/architecture/ |
| Design docs | docs/design/ |
| Reference | docs/reference/ |
| Contributing | CONTRIBUTING.md |
Out Of Scope
Agent Foundry is not:
- a hosted platform
- a general-purpose workflow engine
- only a model provider abstraction
- a replacement for every agent framework
- a promise of backend portability before adapters exist
Design Promises
- Process declarations stay framework-neutral where possible.
- Typed I/O boundaries are non-negotiable.
- Provider- and runtime-specific details belong in adapters.
- Escape hatches are allowed, but should be marked non-portable.
- Adapter compatibility should be validated with shared contract tests as adapters are added.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_foundry_ai-0.12.0.tar.gz.
File metadata
- Download URL: agent_foundry_ai-0.12.0.tar.gz
- Upload date:
- Size: 266.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f83fc9361dc2fb94e751026e53173d578d805c4568a4f0ae00e83b932988da6f
|
|
| MD5 |
0082a5425378043698100dea957cb567
|
|
| BLAKE2b-256 |
10910ed9d97b58b3af5cc701750be194384f725477d7ede01220be4603ff9f1e
|
Provenance
The following attestation bundles were made for agent_foundry_ai-0.12.0.tar.gz:
Publisher:
ci.yml on monkeynaut-ai/agent-foundry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_foundry_ai-0.12.0.tar.gz -
Subject digest:
f83fc9361dc2fb94e751026e53173d578d805c4568a4f0ae00e83b932988da6f - Sigstore transparency entry: 2201831745
- Sigstore integration time:
-
Permalink:
monkeynaut-ai/agent-foundry@2a4766d9356eb4cbe6febe2edf0d818aaec93dba -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/monkeynaut-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@2a4766d9356eb4cbe6febe2edf0d818aaec93dba -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_foundry_ai-0.12.0-py3-none-any.whl.
File metadata
- Download URL: agent_foundry_ai-0.12.0-py3-none-any.whl
- Upload date:
- Size: 152.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12265af94f1d824f48bec07d68ec04b7b304953fcafc0e1d17247f6ad9825980
|
|
| MD5 |
fd3e143fc07dd49a78876aa411e43129
|
|
| BLAKE2b-256 |
8b1e093fa3f73034c19059f33766873c3058de6ec94d44cc8a55692f15b63b83
|
Provenance
The following attestation bundles were made for agent_foundry_ai-0.12.0-py3-none-any.whl:
Publisher:
ci.yml on monkeynaut-ai/agent-foundry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_foundry_ai-0.12.0-py3-none-any.whl -
Subject digest:
12265af94f1d824f48bec07d68ec04b7b304953fcafc0e1d17247f6ad9825980 - Sigstore transparency entry: 2201831804
- Sigstore integration time:
-
Permalink:
monkeynaut-ai/agent-foundry@2a4766d9356eb4cbe6febe2edf0d818aaec93dba -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/monkeynaut-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@2a4766d9356eb4cbe6febe2edf0d818aaec93dba -
Trigger Event:
push
-
Statement type: