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 configKey Files
| File | Purpose |
|---|---|
packages/core/src/index.ts | All public exports — this is the API surface |
packages/core/src/agent/agent.ts | Agent class with full execution loop |
packages/core/src/agent/types.ts | Message, RunState, StepRecord types |
packages/core/src/tools/define.ts | defineTool() factory function |
packages/core/src/llm/create.ts | createLLM() provider factory |
packages/core/src/llm/interface.ts | LLM and StreamingLLM interfaces |
agentforge.config.ts | Per-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.jsonNext Steps
- Configuration — customize
agentforge.config.ts - Concepts — understand the mental model