Building Your First AI Agent with ForgeBot
ForgeBot is the agent builder layer of the Forge platform. It lets you create, configure, and deploy AI agents without writing orchestration code. In this tutorial, we will walk through building a customer support agent from scratch, covering template selection, capability configuration, model choice, and the prime-first routing pattern that powers every ForgeBot.
Step 1: Choose a Template
Start in the ForgeBot section of your dashboard. You will see a gallery of 15-20 templates, each pre-configured for a specific use case. Templates include Customer Support, Sales Assistant, Research Analyst, Code Reviewer, Content Writer, DevOps Bot, and more. Each template comes with a recommended set of capabilities, model preferences, and sample prompts.
For this tutorial, select the Customer Support template. This gives you a baseline agent configured with memory (so it remembers past conversations with each customer), standard security (to prevent prompt injection from user inputs), and a conversational personality suited to support interactions.
Step 2: Configure Capabilities
The capability configuration screen shows a list of toggles. Each toggle enables or disables a specific Forge capability for your agent:
Memory: Enabled by default for support agents. This connects your agent to Forge's three-layer memory system. Vector memory (Qdrant) stores conversation embeddings for semantic search. Graph memory (Neo4j + Graphiti) stores relationships between entities mentioned in conversations. State memory (Redis CRDTs) tracks real-time session data. When a returning customer messages your agent, it can retrieve their conversation history and entity relationships instantly.
Security: Toggle between standard, strict, and minimal modes. For a customer-facing agent, we recommend strict mode, which runs the full ForgeGuard seven-layer pipeline on every message. This protects against prompt injection attempts where users try to override the agent's instructions.
Payments: If you want to monetize your agent or track per-interaction costs, enable the payments toggle. This activates x402 micropayment metering, which tracks the exact inference cost of each conversation and can charge end users via credit packs or subscription tiers.
Connect Apps: The Connect Apps tab lets you browse over 3,000 integrations via Forge Connect (powered by Pipedream). For a support agent, you might connect your helpdesk (Zendesk, Intercom), your CRM (Salesforce, HubSpot), and your knowledge base (Notion, Confluence). Each connected app gives your agent tools it can call during conversations — like creating a support ticket or looking up a customer's order history.
Step 3: Select a Model
The model selection screen lets you choose a default model for your agent or set it to "auto" for intelligent routing. For a support agent, auto mode works well because most interactions are conversational (routed to a fast, cheap model) but occasionally require complex reasoning like diagnosing technical issues (routed to a more capable model).
You can also configure model overrides per capability. For example, you might want the memory retrieval step to use a fast embedding model while the response generation step uses a high-quality conversational model. These overrides are optional — the default auto routing handles most cases well.
Step 4: Understand Prime-First Routing
Every ForgeBot uses prime-first routing as its message handling pattern. This is the core architectural decision that makes ForgeBots feel intelligent rather than scripted. Here is how it works:
Phase 1 — Analyze: Every incoming message goes to the bot's Prime agent. The Prime reads the message, considers the conversation history and available context, and makes a decision: should it respond directly, or should it delegate to specialist agents? For a simple greeting or FAQ question, the Prime responds directly. For a complex request that requires looking up order data and checking inventory, it delegates.
Phase 2 — Delegate: When the Prime delegates, it dispatches specific tasks to specialist agents with clear instructions. For example: "Agent A, look up order #12345 in the CRM. Agent B, check current inventory for product X. Agent C, retrieve this customer's support history." Specialists run concurrently when possible, reducing total response time.
Phase 3 — Synthesize: The Prime collects results from all specialist agents and composes a single, coherent response for the user. It does not just concatenate the results — it synthesizes them into a natural conversational message. "I found your order #12345. It shipped yesterday and is expected to arrive Thursday. I also see that you contacted us last week about a similar issue — would you like me to reference that conversation?"
This three-phase pattern (Analyze, Delegate, Synthesize) means your ForgeBot can handle arbitrarily complex requests without any custom orchestration code. You just configure the capabilities and connected apps, and the Prime agent figures out how to use them.
Step 5: Deploy
Click Deploy and your ForgeBot is live. You get an API endpoint for programmatic access, a webhook URL for chat platform integrations, and an embeddable widget for your website. For Telegram, Slack, or Discord, use the platform-specific adapter that auto-wires incoming messages to your bot's Prime agent.
The ForgeBot runs on Forge's infrastructure. You do not need to manage servers, configure auto-scaling, or worry about uptime. Every message is traced in Langfuse, so you can monitor response quality, latency, cost, and security scan results in real time.
What Comes Next
Once your bot is live, you can iterate on its behavior by adjusting the Prime's system prompt, adding or removing specialist agents, connecting additional apps, and reviewing conversation traces to identify areas for improvement. ForgeBot also supports A/B testing of prompt variants through Forge Prompt, so you can experiment with different conversational styles and measure their impact on customer satisfaction.
Related Articles
Stay up to date
Get the latest articles on AI infrastructure, security, and engineering delivered to your inbox. No spam, unsubscribe anytime.
By subscribing you agree to our privacy policy.