AgentForge

Project Structure

Understand the AgentForge monorepo layout and where to find things.

Monorepo Layout

AgentForge is a Turborepo monorepo with TypeScript core and Python SDK:

agentforge/
├── packages/
│   ├── core/                  # @ahzan-agentforge/core (TypeScript)
│   │   ├── src/
│   │   │   ├── agent/         # Agent class, execution loop, types
│   │   │   ├── tools/         # defineTool, ToolCache, validation
│   │   │   ├── llm/           # LLM interface, createLLM, providers
│   │   │   ├── state/         # StateStore, InMemory, Redis
│   │   │   ├── memory/        # MemoryStore, PgVector, embeddings
│   │   │   ├── governor/      # BudgetGovernor, AutonomyPolicy
│   │   │   ├── multi-agent/   # Coordinator, patterns, handoffs
│   │   │   ├── mcp/           # MCP client/server, adapters
│   │   │   ├── testing/       # MockLLM, TestHarness, StepDebugger
│   │   │   ├── integrations/  # HTTP, Slack, GitHub, etc.
│   │   │   ├── templates/     # Pre-built agent templates
│   │   │   ├── trace/         # Run traces, formatting, replay
│   │   │   ├── errors/        # Error catalog, AgentForgeError
│   │   │   ├── observability/ # OpenTelemetry, anomaly detection
│   │   │   ├── inspector/     # Visual inspector server
│   │   │   ├── rollback/      # RollbackLedger, compensation
│   │   │   ├── config/        # defineConfig, loadConfig
│   │   │   ├── cli/           # CLI commands (init, run, trace, etc.)
│   │   │   └── index.ts       # Public API exports
│   │   ├── tests/             # Vitest test suites
│   │   └── package.json
│   └── python/                # Python SDK
│       ├── agentforge/
│       │   └── __init__.py    # Full API surface (mirrors TypeScript)
│       ├── tests/
│       └── pyproject.toml
├── examples/                  # Demo applications
│   ├── officestationery-bot/
│   └── multi-agent-demo/
├── apps/
│   └── docs/                  # This documentation site
├── docs/                      # Phase documentation (internal)
├── turbo.json                 # Turborepo configuration
├── tsconfig.base.json         # Shared TypeScript config
└── package.json               # Root workspace config

Key Files

FilePurpose
packages/core/src/index.tsAll public exports — this is the API surface
packages/core/src/agent/agent.tsAgent class with full execution loop
packages/core/src/agent/types.tsMessage, RunState, StepRecord types
packages/core/src/tools/define.tsdefineTool() factory function
packages/core/src/llm/create.tscreateLLM() provider factory
packages/core/src/llm/interface.tsLLM and StreamingLLM interfaces
agentforge.config.tsPer-project agent configuration

Your Agent Project

When you create a project with agentforge init, you get:

my-agent/
├── src/
│   ├── agent.ts       # Agent definition
│   ├── tools/         # Custom tools
│   └── index.ts       # Entry point
├── agentforge.config.ts
├── package.json
└── tsconfig.json

Next Steps