How phani465/agentforge works
AgentForge is a platform for defining agents, executing governed multi-step runs, evaluating changes, and inspecting costs and traces. The main workflow is dashboard or API client → gateway → runtime → persisted run and trace; evaluation suites take a separate gateway-to-evaluation-service path. The graph also preserves authentication, SDK, and dashboard capabilities. Several service connections are documented in the README or source index; unsampled implementations and integrations are shown only where documented.
Main entry points: main.py API gateway · engine.py Agent execution loop · db.py Database sessions · client.ts Dashboard API client
Components 27
User Experience
- Dashboard routes
dashboard/src/App.tsx - Dashboard auth
dashboard/src/lib/auth.tsx - Dashboard API client
dashboard/src/api/client.ts - Agent, trace, eval, analytics, settings
dashboard/src/pages - Python SDK
packages/sdk/agentforge - Go CLI
packages/cli-go/cmd
API and Identity
- API gateway
services/api-gateway/main.py - Agent management
services/api-gateway/routers/agents.py - Run orchestration
services/api-gateway/routers/runs.py - Evaluation routes
services/api-gateway/routers/evals.py - Analytics and traces
services/api-gateway/routers - Login and token issuer
services/auth-service/main.go - Gateway auth dependencies
services/api-gateway/dependencies.py
Agent Execution
- Agent execution loop
services/agent-runtime/engine.py - Runtime API
services/agent-runtime/routers/runs.py - Safety, scope, tools
services/agent-runtime - Routing and compression
services/agent-runtime/routing.py - Trace collector
services/trace-collector/main.py
Evaluation
- Evaluation runner and scoring
services/eval-service/runner.py
Shared Data
- Shared domain models
packages/common/agentforge_common/models.py - Persistence mappings
packages/common/agentforge_common/orm.py - Database sessions
packages/common/agentforge_common/db.py - Shared security and errors
packages/common/agentforge_common/security.py
Other components
- User
- LLM provider
- PostgreSQL
- Redis cache
Connections 34
- User → Dashboard routes: uses
README.md - Dashboard routes → Dashboard auth: provides auth
dashboard/src/App.tsx - Dashboard routes → Agent, trace, eval, analytics, settings: routes to
dashboard/src/App.tsx - Agent, trace, eval, analytics, settings → Dashboard API client: requests data
dashboard/src/pages/AgentCatalog.tsx - Dashboard auth → Dashboard API client: uses key storage
dashboard/src/lib/auth.tsx - Dashboard API client → API gateway: calls API
README.md - Dashboard API client → Login and token issuer: auth requests
dashboard/src/api/client.ts - Python SDK → API gateway: uses platform API
- Go CLI → API gateway: uses platform API
- API gateway → Agent management: registers routes
services/api-gateway/main.py - API gateway → Run orchestration: registers routes
services/api-gateway/main.py - API gateway → Evaluation routes: registers routes
services/api-gateway/main.py - API gateway → Analytics and traces: registers routes
services/api-gateway/main.py - Run orchestration → Runtime API: posts run
services/api-gateway/routers/runs.py - Runtime API → Agent execution loop: executes run
- Agent execution loop → Safety, scope, tools: applies controls
services/agent-runtime/engine.py - Agent execution loop → Routing and compression: uses optimization
services/agent-runtime/engine.py - Agent execution loop → LLM provider: requests completions
README.md - Agent execution loop → Trace collector: exports traces
README.md - Evaluation routes → Evaluation runner and scoring: posts suite
services/api-gateway/routers/evals.py - Evaluation runner and scoring → Agent execution loop: executes agent
- API gateway → Database sessions: uses sessions
services/api-gateway/main.py - Runtime API → Database sessions: uses sessions
- Evaluation runner and scoring → Database sessions: uses sessions
- Trace collector → Database sessions: uses sessions
services/trace-collector/main.py - Database sessions → PostgreSQL: connects
packages/common/agentforge_common/db.py - Persistence mappings → Database sessions: uses base
packages/common/agentforge_common/orm.py - API gateway → Persistence mappings: persists domain data
- Agent execution loop → Redis cache: uses response cache
README.md - Agent execution loop → Shared domain models: uses run models
services/agent-runtime/engine.py - Persistence mappings → Shared domain models: maps domain models
- API gateway → Gateway auth dependencies: uses auth dependencies
- Gateway auth dependencies → Shared security and errors: checks credentials
- Login and token issuer → PostgreSQL: reads and writes users
services/auth-service/main.go