How It Works — AI Agent Pipeline, Tools, RAG & Guardrails | AI Agent Builder
How it works

How it works

AI Agent Builder orchestrates every conversation through a configurable pipeline with knowledge, tools, guardrails, memory, and full observability.

Pipeline

Pipeline

Each user message flows through a configurable pipeline of steps. You can enable, disable, and reorder steps from the admin panel — no code required.

Context
History + memory
Knowledge
Document search
Guardrail
Safety checks
Tools
APIs, MCP and webhooks
Image Gen
DALL-E, Gemini
Response
Final answer
Memory
Save facts
Summary
Compress history
Input / OutputProcessingSafetyPersistence

Simplified view of a typical pipeline. The actual workflow is a directed graph — agents can include conditional branching, intent classification, loops, and sub-agent calls.

Tools

The agent can call external tools via OpenAPI, MCP, or webhooks. OpenAPI connects existing APIs, MCP encapsulates tools and agents, and webhooks execute operational workflows.

Agent
ReAct loop
tool_router selects and executes the right tool
OpenAPI REST
  • Auto-discovered OAS 3.x spec
  • LLM-generated parameters
  • CEL filters in query string
  • Great for existing APIs
MCP
  • Model Context Protocol
  • tools/list + tools/call
  • Encapsulated business logic
  • Third-party agents as tools
Webhooks
  • HTTP endpoints as tools
  • Typed body, query, path and headers
  • Auth: API keys, bearer, context tokens
  • Great for quick automations
When to use OpenAPI

API already exists with a spec. Params are simple. Quick integration, no extra code.

When to use MCP

Need to encapsulate logic. Rich typing. Connect third-party tools from the MCP ecosystem.

When to use webhooks

You want to trigger an automation or notify an external system without building a full integration.

Guardrails

Configurable safety checks that run before or after the agent responds. Protect against harmful content, data leaks, and off-topic conversations — all without custom code.

User message
Pre-check
Agent
LLM + tools
Response to user
Checks on the user message (before the agent)
Prompt injection defense

Detects attempts to manipulate the agent's behavior through crafted inputs. Protects the integrity of your agent's instructions.

Topic scope

Keeps the agent focused on your business domain. If a user asks about something outside scope, the agent politely redirects.

Content moderation

Detects and blocks harmful, violent, or inappropriate content in the user's message before the agent processes it.

PII detection

Identifies personal data such as emails, phone numbers, and documents in the user's input. Can redact or block the message before it reaches the agent.

Custom business rules

Define your own rules in plain language. The guardrail evaluates each message against your policies — no code required.

All checks are configurable per agent from the admin panel — no code required.

Knowledge base

The agent can search your internal documents before responding. This grounds answers in real information and reduces hallucinations.

Document ingestion
Document
split
Chunks
vectorize
Embeddings
store
Vector Store (Qdrant / pgvector)
User query
User message
vectorize
Query embedding
cosine similarity
Semantic search
Top-K chunks
inject
Prompt context
LLM

Semantic search compares the query vector against all stored vectors using cosine similarity. The K most similar chunks are included in the LLM prompt.

Memory

AI Agent Builder maintains two levels of memory for each conversation — so the agent remembers context within a session and across sessions.

Session memory

Compressed summary of the current conversation. Regenerated when history exceeds the limit.

Scope: active session
Trigger: message count / tokens
Context step reads summary
Agent
Context step reads memories
Long-term memory

Facts, preferences and operational notes that persist across sessions.

Scope: per organization + agent + customer
Write: memory step extracts facts using AI
writesSummary step writes summary
writesMemory step persists facts

Flow control

Build workflows that adapt to each conversation. Route on rules or AI-classified intent, iterate until a condition is met, and pause for a human when a decision needs one.

User message arrives
Decision point
Rule-based or AI classification
Sales inquiry
Sales workflow
Support issue
Support workflow
Off-topic
Politely redirect
Continue pipeline
DecisionWorkflow pathStop / redirect

Automation

Run workflows without consuming LLM tokens. Execute API calls, transform data, and respond with deterministic logic — triggered by REST requests or cron schedules. The same visual editor, the same observability, zero AI cost per execution.

REST-triggered workflow
HTTP trigger
POST /api/rest/:tenant/:agent
Code (JavaScript)
Transform, validate, compute
Direct tool call
API call without LLM reasoning
HTTP response
Custom status, headers, body
Scheduled execution
Cron trigger
Every day at 09:00
Read persistent state
Counters, config, last sync
Direct tool call
Fetch data from external API
Code → transform results
Process, aggregate, store state
HTTP triggerCode executionDirect tool callResponseScheduled trigger
Zero LLM tokens consumed — deterministic execution

Orchestration

Orchestrate multiple agents within a single conversation. Delegate tasks to specialized sub-agents using the agent node, integrate third-party agents via MCP as tools (agent-as-tool pattern), group related steps into reusable units, or add flexible AI processing at any point in the workflow.

Sub-agent delegation
Main agent workflow
Billing agent
Handles invoices
Shipping agent
Tracks orders
Results merged → continue
Agent-as-tool (MCP)
Tool router (ReAct loop)
Billing API
OpenAPI
Sentiment agent
MCP
CRM agent
MCP
Third-party agents exposed via MCP are invoked as tools alongside direct APIs — all in the same turn
Step groups with loops
Process each item
Loop enabled
Validate item
Apply business rules
Generate response
Repeats for each item until all are processed

Agent harness

Describe what the agent should do and the platform compiles the agent loop for you — planning, step execution, verification, and context management included. This is the work most teams spend months getting right, and you do not draw a single node to get it.

You write
Instructions, scope, knowledge and tools
The platform compiles
A plan–execute–verify agent loop
Compiled pipeline
Planner
Breaks the request into numbered atomic steps
Agent loop
Repeats until done
Step executor
Takes the next step from the plan
Tool call
API, MCP or sub-agent
Reasoning
Analyses what was gathered
Verifier
Is the plan complete?
Not done — next step
Response synthesizer
Turns accumulated results into one clear answer
Context budget — applied between passes
Trim
Oversized tool results are cut down
Summarize
Older iterations collapse into short summaries
Keep recent
The latest passes stay intact
The loop stops when
The verifier says the plan is completeIt reaches the iteration limit you setIt stops making progressSteps keep failing

Observability

Full visibility into every conversation. See what happened at each step, track costs by tenant, collect user feedback scores, and analyze quality trends — with built-in timeline and optional Langfuse integration for advanced analytics.

Execution timeline
time →
Context assembly
Knowledge search
Guardrail check
Tool execution
→ API call: get_customer
→ API call: get_balance
Response generation
Memory extraction
2.3s
Total duration
1,847
Tokens used
2
Tool calls
6
Steps executed