Hugging Face Spaces
Deploy CUGA as an interactive demo on Hugging Face Spaces
CUGA can be deployed to Hugging Face Spaces as an interactive demo, allowing users to experience the agent's capabilities without local installation.
Live Demo
Try CUGA now on Hugging Face Spaces:
https://huggingface.co/spaces/ibm-research/cuga-agent
Overview
The Hugging Face Spaces deployment provides:
- Interactive Demo: Try CUGA in your browser without setup
- Guided Tour: Step-by-step walkthrough of CUGA capabilities
- Sample Data: Pre-configured CRM and file tools for exploration
- Knowledge Base: Built-in CUGA documentation for the agent
Demo Features
UI Layout
The CUGA Spaces demo includes:
- Center Panel: Chat interface for interacting with CUGA
- Left Panel: Variables view showing stored intermediate results
- Right Panel: Workspace files (e.g.,
contacts.txt) - Top-Right: Tools panel showing available CRM + File MCP servers
Pre-configured Tools
The demo comes with:
- CRM API: Full CRM system with Accounts, Contacts, Leads, and Opportunities
- File MCP Server: Access to workspace files under
./workspace
Sample Data
- CRM Records: Comprehensive test data with accounts, contacts, and opportunities
- contacts.txt: Sample email list for multi-tool demo tasks
- email_template.md: Template for account performance reports
Guided Tour
The demo includes an interactive guided tour. Here's what to expect:
Step 1: Introduction
CUGA explains the UI layout and waits for you to say "start tour" or similar.
Step 2: CRM Basics
Learn about CRM concepts:
- Accounts: Companies in the CRM
- Contacts: People at those companies
- Leads: Potential prospects
- Opportunities: Deals in progress
Try: Find the top 3 accounts by revenue
Step 3: Understanding Code Execution
After the task completes:
- CUGA explains how it used Python code to call paginated APIs
- Click "Reasoning Process" to see the generated code
- Ask:
What variables do you have?
Step 4: Variables & Chaining
Learn how CUGA:
- Stores intermediate results in variables
- Names variables intelligently
- Uses variables for reasoning and chaining tasks
Try: Who is the contact of Monetized Corp?
Step 5: Multi-Tool Tasks
Open contacts.txt in the workspace panel, then try a complex multi-tool task:
Try: From the list of emails in contacts.txt, which contacts exist in the CRM? Show me the matching contacts sorted by the annual revenue of their accounts.
This demonstrates:
- Reading files via File MCP server
- Parsing email lists
- Querying CRM with pagination
- Matching and sorting data
- Combining results across tools
Step 6: Free Exploration
After the tour, explore on your own with tasks like:
List all opportunities worth more than $10,000Find accounts in the Technology industryWho are the contacts for our top 5 accounts?
Deployment Architecture
Knowledge Base
The deployment includes a knowledge base (cuga_knowledge.md) that provides CUGA with:
- Framework overview and core concepts
- Architecture explanation (Planner, Executor, Code-Act)
- Capabilities and configuration options
- Tool types and integrations
- Benchmark performance information
- Policy and safety features
- Memory capabilities
This enables CUGA to answer questions about itself accurately.
Playbook
The cuga_playbook.md file defines the guided tour behavior:
- Step-by-step instructions for the demo
- Expected user actions and CUGA responses
- Explanations for each feature demonstration
- Progress tracking through the tour
Sample Files
The deployment includes sample files for demonstration:
contacts.txt:
sarah.bell@gammadeltainc.partners.org
sharon.jimenez@upsiloncorp.innovation.org
ruth.ross@sigmasystems.operations.com
dorothy.richardson@nextgencorp.gmail.com
james.richardson@technovate.com
michael.torres@pinnacle-solutions.net
emma.larsson@nexus-digital.coemail_template.md: Template for generating account performance emails.
Creating Your Own HF Spaces Deployment
To deploy your own CUGA instance on Hugging Face Spaces:
Step 1: Fork or Clone
Start with the CUGA repository or create a new Space.
Step 2: Configure Space Settings
In your Space settings:
title: CUGA Agent
emoji: owl
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.x
app_file: app.py
pinned: falseStep 3: Add Environment Variables
In Space settings, add secrets:
OPENAI_API_KEY=your-api-key
# Or other LLM provider credentialsStep 4: Customize Knowledge Base
Edit cuga_knowledge.md to add:
- Your domain-specific information
- Custom tool documentation
- Organization-specific policies
- Relevant examples and use cases
Step 5: Customize Playbook
Edit cuga_playbook.md to create:
- Custom guided tours for your use case
- Domain-specific demo scenarios
- Onboarding flows for your tools
Step 6: Add Your Tools
Configure your tools in the MCP server configuration:
# mcp_servers.yaml
servers:
- name: your_api
type: openapi
spec_url: https://your-api.com/openapi.json
- name: your_mcp
type: mcp
command: your-mcp-serverStep 7: Deploy
Push to Hugging Face Spaces:
git remote add space https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE
git push space mainCustomization Options
Custom Branding
Modify the Gradio interface for your branding:
- Logo and colors
- Welcome messages
- Footer links
Custom Demo Data
Replace sample data with your domain:
- CRM records matching your industry
- Relevant file examples
- Domain-specific templates
Custom Tour
Create tours for your specific use case:
- Define tour steps in playbook
- Add expected user actions
- Include explanations for each feature
- Test the full flow
Best Practices
For Public Demos
- Use rate limiting to prevent abuse
- Don't expose sensitive API keys
- Provide clear usage guidelines
- Monitor for inappropriate usage
For Internal Demos
- Connect to test/sandbox APIs only
- Use demo data, not production data
- Limit tool permissions appropriately
- Add authentication if needed
For Customer Demos
- Customize for their industry/domain
- Pre-load relevant sample data
- Create guided tours for their use cases
- Provide clear next steps after demo
Troubleshooting
Space Won't Start
Problem: Hugging Face Space fails to launch
Solutions:
- Check build logs for errors
- Verify all dependencies are in
requirements.txt - Ensure environment variables are set
- Check memory/CPU limits aren't exceeded
Tools Not Available
Problem: CRM or other tools not showing in demo
Solutions:
- Verify tool configuration in MCP servers config
- Check that tool endpoints are accessible
- Review logs for connection errors
- Ensure API credentials are valid
Slow Performance
Problem: Demo responses are slow
Solutions:
- Use faster LLM models for demo
- Enable caching where possible
- Reduce tool response sizes
- Consider upgrading Space hardware
