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:
- Type a question
- Click "Ask"
- 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
- Build in Agent Builder
- Test with sample queries
- Export configuration
- 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:
Setting | Config A | Config B | Winner |
---|---|---|---|
Model | GPT-4 | GPT-3.5 | A (quality) |
Cost/query | $0.05 | $0.01 | B (cost) |
Latency | 1.2s | 0.8s | B (speed) |
Quality | 0.88 | 0.82 | A |
🎓 Tutorial Mode
Agent Builder includes an interactive tutorial:
- Step 1: Configure basic settings
- Step 2: Select retrieval mode
- Step 3: Add tools
- Step 4: Set up guardrails
- Step 5: Test your agent
- 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
Issue | Solution |
---|---|
Can't connect to vector store | Check vector store is running |
Tool not working | Verify tool dependencies installed |
Export fails | Check write permissions in config directory |
📚 Related Docs
- Tutorials - Learn agent concepts
- Add Custom Tools
- Implement Guardrails
No code required! Build your agent in minutes! 🛠️