Skip to main content

Agent Builder

Location: apps/agent_builder/
Tech Stack: Streamlit, YAML
Purpose: No-code visual tool for configuring and testing agents

🎯 Overview

Agent Builder is a no-code visual interface for creating, configuring, and testing RecoAgent instances. Perfect for business users, product managers, and anyone who wants to build agents without writing code.

Use this when:

  • You don't want to write code
  • Rapid prototyping and testing
  • Configuring production agents
  • Exploring different configurations
  • Training non-technical team members

⚡ Quick Start

cd apps/agent_builder
pip install -r requirements.txt
python app.py

# Open: http://localhost:8502

🎨 Interface Overview

1. Agent Configuration

  • Name & Description: Label your agent
  • LLM Selection: Choose GPT-4, GPT-3.5, Claude, etc.
  • Temperature: Control creativity (0.0 - 1.0)
  • Max Tokens: Set response length limits

2. Retrieval Settings

  • Vector Store: Select Chroma, Pinecone, Weaviate, etc.
  • Retrieval Mode: BM25, Vector, or Hybrid
  • Top K: Number of documents to retrieve
  • Reranking: Enable cross-encoder reranking

3. Tools Configuration

  • Select Tools: Check boxes for available tools
  • Custom Tools: Upload Python tool definitions
  • Tool Parameters: Configure tool-specific settings

4. Guardrails

  • Input Filters: PII detection, profanity filter
  • Output Validators: Faithfulness checks
  • Escalation Rules: Define when to escalate

5. Test Panel

  • Test Questions: Try your agent live
  • View Sources: See retrieved documents
  • Debug Mode: Inspect reasoning steps

📋 Configuration Export

Export as YAML

# agent_config.yaml
agent:
name: "Customer Support Agent"
description: "Answers customer questions about products"

llm:
provider: "openai"
model: "gpt-4"
temperature: 0.7
max_tokens: 500

retrieval:
mode: "hybrid"
vector_store: "chroma"
top_k: 5
alpha: 0.5
reranking: true

tools:
- name: "search_knowledge_base"
enabled: true
- name: "create_ticket"
enabled: true
- name: "check_order_status"
enabled: false

guardrails:
input_filters:
- pii_detection
- profanity_filter
output_validators:
- faithfulness_check
escalation_triggers:
- sensitive_topic
- low_confidence

Export as Python

# agent_config.py
from recoagent import RecoAgent

agent = RecoAgent(
name="Customer Support Agent",
llm_model="gpt-4",
temperature=0.7,
retrieval_mode="hybrid",
top_k=5,
tools=["search_knowledge_base", "create_ticket"],
guardrails=["pii_detection", "faithfulness_check"]
)

🔧 Features in Detail

Visual Agent Designer

┌─────────────────────────────────────────────┐
│ Agent Builder │
├─────────────────────────────────────────────┤
│ │
│ 📝 Basic Info │
│ Name: [Customer Support Agent ] │
│ Description: [Answers product questions] │
│ │
│ 🤖 LLM Configuration │
│ Model: [GPT-4 ▼] │
│ Temperature: ━━━━━◉━━━━━ 0.7 │
│ Max Tokens: 500 │
│ │
│ 🔍 Retrieval │
│ Mode: ⚪ BM25 ⚪ Vector ⚫ Hybrid │
│ Top K: ━━━◉━━━━━━ 5 │
│ Reranking: ☑ Enabled │
│ │
│ 🛠️ Tools │
│ ☑ Search Knowledge Base │
│ ☑ Create Ticket │
│ ☐ Check Order Status │
│ │
│ 🛡️ Guardrails │
│ ☑ PII Detection │
│ ☑ Faithfulness Check │
│ ☑ Low Confidence Escalation │
│ │
│ [Test Agent] [Export Config] [Save] │
└─────────────────────────────────────────────┘

Live Testing

Test your agent configuration in real-time:

  1. Type a question
  2. Click "Ask"
  3. See response with:
    • Answer
    • Sources used
    • Confidence score
    • Tools called
    • Reasoning steps (debug mode)

Configuration Templates

Pre-built Templates:

  • Customer Support: Product Q&A with ticket creation
  • IT Helpdesk: Technical troubleshooting
  • Research Assistant: Academic paper analysis
  • Sales Assistant: Product recommendations
  • HR Bot: Employee handbook Q&A

Select a template and customize!

💾 Saving & Loading

Save Configuration

# Saves to apps/agent_builder/saved_configs/
save_config("customer_support_v1.yaml")

Load Configuration

# Load previously saved config
load_config("customer_support_v1.yaml")

Version Control

# Track config changes
configs/
├── customer_support_v1.yaml
├── customer_support_v2.yaml # Added tools
└── customer_support_v3.yaml # Adjusted temperature

🚀 Deployment Workflow

  1. Build in Agent Builder
  2. Test with sample queries
  3. Export configuration
  4. Deploy using exported code
# Export from Agent Builder
export_config("production_agent.yaml")

# Use in production
from recoagent import RecoAgent

agent = RecoAgent.from_config("production_agent.yaml")

📊 Configuration Comparison

Compare different configurations side-by-side:

SettingConfig AConfig BWinner
ModelGPT-4GPT-3.5A (quality)
Cost/query$0.05$0.01B (cost)
Latency1.2s0.8sB (speed)
Quality0.880.82A

🎓 Tutorial Mode

Agent Builder includes an interactive tutorial:

  1. Step 1: Configure basic settings
  2. Step 2: Select retrieval mode
  3. Step 3: Add tools
  4. Step 4: Set up guardrails
  5. Step 5: Test your agent
  6. Step 6: Export and deploy

🔌 Integration

With Production API

Export config and use in Production API:

# production API uses exported config
agent = RecoAgent.from_config("agent_builder_export.yaml")

With Other Apps

Configurations work across all apps:

  • Export from Agent Builder
  • Import in Chainlit UI, Gradio UI, etc.

🆘 Troubleshooting

IssueSolution
Can't connect to vector storeCheck vector store is running
Tool not workingVerify tool dependencies installed
Export failsCheck write permissions in config directory

No code required! Build your agent in minutes! 🛠️