Usage
Demo Mode
Learn how to use CUGA in demo mode with the Digital Sales API
Get started with CUGA using the pre-configured demo environment featuring the Digital Sales API.
๐ Getting Started
Prerequisites
Before running demo mode, ensure you have:
- โ CUGA installed and configured
- โ Environment variables set up
- โ API key configured
- โ Ports 8001 and 8005 available
Quick Start
# Start the demo
cuga start demo
# Try this example query:
"get my top account by revenue from digital sales"๐๏ธ Demo Architecture
The demo consists of two main components:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ API Registry โ โ CUGA Demo โ โ Digital Sales โ
โ (Port 8001) โโโโโบโ (Port 8005) โโโโโบโ API โ
โ โ โ โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโComponent Details
| Component | Port | Purpose | Configuration |
|---|---|---|---|
| API Registry | 8001 | Tool registration | mcp_servers.yaml |
| CUGA Demo | 8005 | Main application | settings.toml |
| Digital Sales API | External | Demo data source | Pre-configured |
๐ฏ Demo Features
Pre-configured Tools
The demo includes several pre-configured tools:
- Account Management: Create, read, update, delete accounts
- Revenue Analysis: Query revenue data and rankings
- Contact Management: Manage customer contacts
- Sales Pipeline: Track sales opportunities
Available Queries
Try these example queries to explore CUGA's capabilities:
Account Queries
"get my top account by revenue from digital sales"
"show me the top 5 accounts by revenue"
"list all accounts with revenue above $100,000"
"find accounts in the technology sector"Contact Queries
"get contacts for the top revenue account"
"show me all contacts in the sales department"
"find contacts with email addresses"Revenue Queries
"calculate total revenue for all accounts"
"show revenue breakdown by industry"
"find accounts with declining revenue"๐ Running the Demo
Step 1: Start Services
# Start API Registry first
cuga start api-registry
# Then start CUGA Demo
cuga start demoStep 2: Verify Services
# Check service status
cuga status
# Expected output:
# โ
API Registry Demo: Running (Port 8001)
# โ
Cuga Demo: Running (Port 8005)Step 3: Access Demo
- Chat Interface: http://localhost:8005
- API Endpoints: http://localhost:8005/docs
- Health Check: http://localhost:8005/health
๐ฌ Using the Chat Interface
Basic Interaction
-
Open Chat Interface
- Navigate to http://localhost:8005
- You'll see a chat interface similar to ChatGPT
-
Ask Questions
- Type natural language queries
- CUGA will understand and execute them
- Example: "get my top account by revenue"
-
View Results
- Results appear in the chat
- Click on results to expand details
- Use the interface to explore data
Advanced Queries
Complex Queries
"analyze the revenue trends for technology accounts over the last quarter"
"find accounts with high revenue but low contact engagement"
"show me a summary of all sales opportunities by stage"Multi-step Queries
"first get my top account, then show me all contacts for that account"
"analyze revenue by industry and then drill down into the top performing sector"๐ API Usage
REST API Endpoints
The demo provides REST API endpoints for programmatic access:
# Health check
curl http://localhost:8005/health
# Chat endpoint
curl -X POST http://localhost:8005/chat \
-H "Content-Type: application/json" \
-d '{"message": "get my top account by revenue"}'
# Status endpoint
curl http://localhost:8005/statusPython Client
import requests
# Initialize client
base_url = "http://localhost:8005"
# Send query
response = requests.post(f"{base_url}/chat", json={
"message": "get my top account by revenue from digital sales"
})
# Process response
result = response.json()
print(result["response"])๐ Understanding Results
Response Format
CUGA responses include:
{
"response": "Here are your top accounts by revenue...",
"data": {
"accounts": [...],
"summary": {...}
},
"metadata": {
"execution_time": 2.5,
"tools_used": ["account_query", "revenue_analysis"],
"confidence": 0.95
}
}Data Interpretation
- Response: Human-readable summary
- Data: Structured data for programmatic use
- Metadata: Execution details and confidence scores
๐ง Demo Configuration
Customizing Demo Behavior
Edit configurations/demo.toml:
[demo]
# Demo Settings
enabled = true
auto_start = true
port = 8005
# API Configuration
api_registry_port = 8001
digital_sales_url = "https://digitalsales.19pc1vtv090u.us-east.codeengine.appdomain.cloud"
# Behavior Settings
max_results = 10
default_timeout = 30
enable_logging = trueEnvironment Variables
# Demo-specific environment variables
export CUGA_DEMO_PORT=8005
export CUGA_API_REGISTRY_PORT=8001
export CUGA_DEMO_TIMEOUT=30๐งช Testing the Demo
Basic Functionality Test
# Test basic functionality
curl -X POST http://localhost:8005/chat \
-H "Content-Type: application/json" \
-d '{"message": "hello"}'
# Expected: Welcome message and available featuresAPI Integration Test
# Test API connectivity
curl http://localhost:8005/health
# Expected: {"status": "healthy", "timestamp": "..."}End-to-End Test
# Test complete workflow
curl -X POST http://localhost:8005/chat \
-H "Content-Type: application/json" \
-d '{"message": "get my top account by revenue"}'
# Expected: Account data with revenue information๐ Troubleshooting
Common Demo Issues
| Issue | Solution |
|---|---|
| ๐ด Port 8005 in use | Stop conflicting service or change port |
| ๐ด API Registry not found | Start API Registry first |
| ๐ด Digital Sales API down | Check external API status |
| ๐ด Slow responses | Check network and API key configuration |
| ๐ด No results returned | Verify query format and API connectivity |
Debug Commands
# Check service status
cuga status
# View logs
tail -f logs/demo.log
# Test API connectivity
curl -v http://localhost:8005/health
# Check port usage
lsof -i :8005
lsof -i :8001Service Recovery
# Restart services
cuga stop all
cuga start api-registry
cuga start demo
# Verify recovery
cuga status
curl http://localhost:8005/health๐ Performance Monitoring
Demo Metrics
Monitor demo performance:
# Check response times
curl -w "@curl-format.txt" -X POST http://localhost:8005/chat \
-H "Content-Type: application/json" \
-d '{"message": "get top account"}'
# Monitor resource usage
top -p $(pgrep -f "cuga.*demo")Performance Optimization
# Optimize for demo performance
[demo.performance]
cache_enabled = true
cache_ttl = 300
max_workers = 2
timeout = 30๐ Demo Workflows
Example Workflows
Revenue Analysis Workflow
- Query: "get my top account by revenue"
- Analysis: "analyze revenue trends for this account"
- Drill-down: "show me contacts for this account"
- Summary: "provide a summary of findings"
Account Management Workflow
- Discovery: "find accounts in the technology sector"
- Analysis: "analyze revenue performance by account size"
- Action: "identify accounts needing attention"
- Planning: "suggest next steps for underperforming accounts"
๐ Next Steps
After exploring demo mode:
- Control Commands: Learn CUGA management commands
- API Integration: Add your own APIs
- Save & Reuse: Explore workflow persistence
- Evaluation: Test with benchmarks
๐ Getting Help
- ๐ Issues: GitHub Issues
- ๐ Documentation: Full Documentation
Demo working? Explore Control Commands next!
