We believe the real power of LLMs isn't just in chatting — it's in the tools they can use.
Agent Foundry is an open-source toolbox and plugin ecosystem for building, sharing, and combining tools that make AI useful in the real world. Think of it as a forge 🔨 where the community co-creates tools, versions them, and makes sure everything is reproducible.
View on GitHubStandardized interfaces for AI, OCR, window, screenshot, and more.
File-system based registry (default: ~/Desktop/af-registry/) with version management and index.json.
Install, update, and publish plugins via CLI with automatic version resolution.
Guarantee reproducibility across machines and teams.
Comprehensive command-line interface for plugin lifecycle management.
Run plugins individually or compose them into workflows.
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Activate virtual environment (before each use)
source venv/bin/activate
# Publish plugin to remote registry (Desktop folder)
python3 -m afm.cli publish hello_world
# View available plugins in remote registry
python3 -m afm.cli remote-list
# Install plugin from remote
python3 -m afm.cli install hello_world
# List installed plugins
python3 -m afm.cli list
# Run plugin
python3 -m afm.cli run hello_world --args "your parameters"
# Update plugin to latest version
python3 -m afm.cli update hello_world
# Generate lockfile
python3 -m afm.cli lock
Note: Remote registry default location is~/Desktop/af-registry/, can be modified inafm/config/settings.py.
ocr.tesseractHere's how a plugin looks in Agent Foundry.
Each plugin just needs to follow a standard interface (Protocol) and return a consistent result format.
# agent_foundry_ocr_tesseract/ocr_plugin.py
from agent_foundry.interfaces import OCRService, Result
import pytesseract
from PIL import Image
class TesseractOCR(OCRService):
def initialize(self, config: dict) -> bool:
return True # load configs if needed
def extract_text(self, image_path: str) -> Result:
try:
text = pytesseract.image_to_string(Image.open(image_path))
return {"success": True, "data": {"text": text}, "meta": {"engine": "tesseract"}}
except Exception as e:
return {"success": False, "error": {"code": "OCRFailed", "message": str(e)}}
# pyproject.toml
[project.entry-points."agent_foundry.plugins"]
"ocr.tesseract" = "agent_foundry_ocr_tesseract.ocr_plugin:TesseractOCR"
meta.json
{
"name": "agent_foundry_ocr_tesseract",
"version": "0.4.2",
"core": ">=0.3,<0.4",
"apis": ["OCRService@1"],
"description": "OCR plugin using Tesseract"
}
checksums.txt
sha256 agent_foundry_ocr_tesseract-0.4.2-py3-none-any.whl a7d2...9f
Use CLI to upload plugin to remote registry:
# Publish plugin (automatically reads version from manifest.json)
python3 -m afm.cli publish ocr.tesseract
# Or specify version
python3 -m afm.cli publish ocr.tesseract --version 0.4.2
Plugin will be automatically uploaded to ~/Desktop/af-registry/plugins/ocr.tesseract/0.4.2/ and index.json will be updated.
# Install from remote
python3 -m afm.cli install ocr.tesseract
# Or install specific version
python3 -m afm.cli install ocr.tesseract --version 0.4.2
# Run plugin
python3 -m afm.cli run ocr.tesseract --args '{"image_path": "sample.png"}'
Remote registry structure (default at ~/Desktop/af-registry/):
af-registry/
├── index.json # Plugin index, records all available plugins and versions
└── plugins/
└── {plugin_name}/
└── {version}/
├── plugin.py
└── manifest.json
Locally installed plugins are located at afm/plugins/{plugin_name}/, registry information is in data/registry.json.
install <name> [--version VERSION] - Install plugin from remote registry (automatically uses latest version if not specified)list - List installed pluginsuninstall <name> - Uninstall pluginupdate <name> [--version VERSION] - Update plugin (automatically checks and updates to latest version if not specified)run <name> [--args ARGS] - Run pluginpublish <name> [--version VERSION] - Upload local plugin to remote registryremote-list - List all available plugins in remote registrylock - Regenerate lockfile (fix exact versions of all current plugins)# Complete workflow
python3 -m afm.cli publish my_plugin # Publish plugin
python3 -m afm.cli remote-list # View remote plugins
python3 -m afm.cli install my_plugin # Install plugin
python3 -m afm.cli list # View installed
python3 -m afm.cli run my_plugin --args "test" # Run plugin
python3 -m afm.cli update my_plugin # Update to latest version
python3 -m afm.cli lock # Generate lockfile
Agent Foundry is meant to be built together. You can help by:
👉 See CONTRIBUTING.md for setup steps and development guidelines.
Agent Foundry plugins and pipelines follow a consistent contract for inputs and outputs to enable composition, testing, and reproducibility.
OCRService@1)Example schema (JSON Schema):
{
"$schema": "https://json-schema.org/draft-07/schema#",
"$id": "https://agent-foundry.dev/schemas/ocr.extract_text@1.json",
"title": "OCR.extract_text parameters",
"type": "object",
"required": ["image_path"],
"properties": {
"image_path": { "type": "string" },
"lang": { "type": "string", "default": "eng" },
"dpi": { "type": "integer", "minimum": 72, "maximum": 1200 }
},
"additionalProperties": false
}
Recommended validation flow:
1) Load JSON params → 2) Validate against schema → 3) Pass typed object to implementation.
0 for success; non-zero for failure (e.g., 2 for validation error, 3 for runtime error)Success payload shape:
{
"success": true,
"data": { /* task-specific result */ },
"meta": { "plugin": "ocr.tesseract", "version": "0.4.2", "elapsed_ms": 123 }
}
Error payload shape (written to stdout for machine consumption, details to stderr):
{
"success": false,
"error": {
"code": "ValidationError",
"message": "'image_path' is required",
"details": { "path": ["image_path"], "schema": "ocr.extract_text@1" }
},
"meta": { "plugin": "ocr.tesseract", "version": "0.4.2" }
}
Suggested exit codes:
2: Parameter/Schema validation error3: Dependency or environment error (e.g., missing binary/model)4: External I/O failure (network/filesystem)5: Plugin-defined runtime errorMIT — free to use, share, and modify.
✨ Agent Foundry is not just another framework — it's a community forge for AI tools.
Let's build the toolbox that makes LLMs truly useful.
View on GitHub