Skip to main content

Multi-Agent AI System for automation

Project description

Ambivo Agents - Multi-Agent AI System

A minimalistic toolkit for AI-powered automation including media processing, knowledge base operations, web scraping, YouTube downloads, and more.

โš ๏ธ Alpha Release Disclaimer

This library is currently in alpha stage. While functional, it may contain bugs, undergo breaking changes, and lack complete documentation. Developers should thoroughly evaluate and test the library before considering it for production use. Use in production environments is at your own risk.

For production scenarios, we recommend:

  • Extensive testing in your specific environment
  • Implementing proper error handling and monitoring
  • Having rollback plans in place
  • Staying updated with releases for critical fixes

Development Roadmap: We are actively working toward a stable 1.0 release. Breaking changes may occur during the alpha phase as we refine the API and improve stability.

Table of Contents

Quick Start

Simple ModeratorAgent Example

The ModeratorAgent is the easiest way to get started. It automatically routes your queries to the right specialized agents:

from ambivo_agents import ModeratorAgent
import asyncio

async def main():
    # Create the moderator (one agent to rule them all!)
    moderator, context = ModeratorAgent.create(user_id="john")
    
    print(f"โœ… Moderator: {moderator.agent_id}")
    print(f"๐Ÿ“‹ Session: {context.session_id}")
    
    # Just chat! The moderator routes automatically:
    
    # This will go to YouTubeDownloadAgent
    response1 = await moderator.chat("Download audio from https://youtube.com/watch?v=dQw4w9WgXcQ")
    print(f"๐ŸŽต {response1}")
    
    # This will go to WebSearchAgent  
    response2 = await moderator.chat("Search for latest AI trends")
    print(f"๐Ÿ” {response2}")
    
    # This will go to MediaEditorAgent
    response3 = await moderator.chat("Extract audio from video.mp4 as MP3")
    print(f"๐ŸŽฌ {response3}")
    
    # This will go to AssistantAgent
    response4 = await moderator.chat("What is machine learning?")
    print(f"๐Ÿ’ฌ {response4}")
    
    # Check what agents are available
    status = await moderator.get_agent_status()
    print(f"๐Ÿค– Available agents: {list(status['active_agents'].keys())}")
    
    # Cleanup when done
    await moderator.cleanup_session()

# Run it
asyncio.run(main())

That's it! The ModeratorAgent automatically:

  • โœ… Routes your queries to the right specialist
  • โœ… Maintains conversation context
  • โœ… Manages all the underlying agents
  • โœ… Handles configuration and setup

Even Simpler - Command Line

# Install and run
pip install ambivo-agents

# Interactive mode (auto-routing)
ambivo-agents

# Or single commands
ambivo-agents -q "Download audio from https://youtube.com/watch?v=example"
ambivo-agents -q "Search for Python tutorials"
ambivo-agents -q "Extract audio from video.mp4"

Simple ModeratorAgent Example

Basic ModeratorAgent Usage

from ambivo_agents import ModeratorAgent
import asyncio

async def simple_example():
    # Create moderator with auto-configuration
    moderator, context = ModeratorAgent.create(user_id="alice")
    
    print(f"๐Ÿš€ Session {context.session_id} started")
    
    # The moderator routes these automatically:
    tasks = [
        "Download https://youtube.com/watch?v=example",           # โ†’ YouTube Agent
        "Search for latest Python frameworks",                   # โ†’ Web Search Agent  
        "Convert video.mp4 to audio",                           # โ†’ Media Editor Agent
        "What's the capital of France?",                        # โ†’ Assistant Agent
        "Scrape https://example.com for content",               # โ†’ Web Scraper Agent
    ]
    
    for task in tasks:
        print(f"\n๐Ÿ‘ค User: {task}")
        response = await moderator.chat(task)
        print(f"๐Ÿค– Bot: {response[:100]}...")  # First 100 chars
    
    # Check routing info
    status = await moderator.get_agent_status()
    print(f"\n๐Ÿ“Š Processed via {status['total_agents']} specialized agents")
    
    await moderator.cleanup_session()

asyncio.run(simple_example())

Context-Aware Conversations

The ModeratorAgent maintains conversation context:

async def context_example():
    moderator, context = ModeratorAgent.create(user_id="bob")
    
    # Initial request
    response1 = await moderator.chat("Download audio from https://youtube.com/watch?v=example")
    print(response1)
    
    # Follow-up (moderator remembers the YouTube URL)
    response2 = await moderator.chat("Actually, download the video instead")
    print(response2)
    
    # Another follow-up (still remembers context)
    response3 = await moderator.chat("Get information about that video")
    print(response3)
    
    await moderator.cleanup_session()

Custom Agent Configuration using enabled_agents

async def custom_moderator():
    # Enable only specific agents
    moderator, context = ModeratorAgent.create(
        user_id="charlie",
        enabled_agents=['youtube_download', 'web_search', 'assistant']
    )
    
    # Only these agents will be available for routing
    status = await moderator.get_agent_status()
    print(f"Enabled: {list(status['active_agents'].keys())}")
    
    await moderator.cleanup_session()

Integration with Existing Code

class ChatBot:
    def __init__(self):
        self.moderator = None
        self.context = None
    
    async def start_session(self, user_id: str):
        self.moderator, self.context = ModeratorAgent.create(user_id=user_id)
        return self.context.session_id
    
    async def process_message(self, message: str) -> str:
        if not self.moderator:
            raise ValueError("Session not started")
        
        return await self.moderator.chat(message)
    
    async def end_session(self):
        if self.moderator:
            await self.moderator.cleanup_session()

# Usage
bot = ChatBot()
session_id = await bot.start_session("user123")
response = await bot.process_message("Download audio from YouTube")
await bot.end_session()

Agent Creation

ModeratorAgent

from ambivo_agents import ModeratorAgent

# Create moderator with auto-routing to specialized agents
moderator, context = ModeratorAgent.create(user_id="john")
print(f"Session: {context.session_id}")

# Just chat - moderator handles the routing!
result = await moderator.chat("Download audio from https://youtube.com/watch?v=example")
print(result)

# Cleanup when done
await moderator.cleanup_session()

When to use ModeratorAgent:

  • โœ… Most applications (recommended default)
  • โœ… Multi-purpose chatbots and assistants
  • โœ… Intelligent routing between different capabilities
  • โœ… Context-aware conversations
  • โœ… Simplified development - one agent does everything

Direct Agent Creation

Use direct creation for specific, single-purpose applications:

from ambivo_agents import YouTubeDownloadAgent

# Create agent with explicit context
agent, context = YouTubeDownloadAgent.create(user_id="john")
print(f"Session: {context.session_id}")

# Use agent directly for specific task
result = await agent._download_youtube_audio("https://youtube.com/watch?v=example")

# Cleanup when done
await agent.cleanup_session()

When to use Direct Creation:

  • โœ… Single-purpose applications (only YouTube, only search, etc.)
  • โœ… Specific workflows with known agent requirements
  • โœ… Performance-critical applications (no routing overhead)
  • โœ… Custom integrations with existing systems

Service-Based Creation

Use the service method for production multi-user systems:

from ambivo_agents.services import create_agent_service

service = create_agent_service()
session_id = service.create_session()

# Service automatically routes to the appropriate agent
result = await service.process_message(
    message="download audio from youtube.com/watch?v=example",
    session_id=session_id,
    user_id="user123"
)

When to use Service:

  • โœ… Production systems with multiple users - manage sessions
  • โœ… Session management across users
  • โœ… Scalable architectures with load balancing
  • โœ… Advanced monitoring and analytics

Features

Core Capabilities

  • ๐Ÿค– ModeratorAgent: Intelligent multi-agent orchestrator with automatic routing
  • ๐Ÿ”„ Smart Routing: Automatically routes queries to the most appropriate specialized agent
  • ๐Ÿง  Context Memory: Maintains conversation history and context across interactions
  • ๐Ÿณ Docker Integration: Secure, isolated execution environment for code and media processing
  • ๐Ÿ“ฆ Redis Memory: Persistent conversation memory with compression and caching
  • ๐Ÿ”€ Multi-Provider LLM: Automatic failover between OpenAI, Anthropic, and AWS Bedrock
  • โš™๏ธ Configuration-Driven: All features controlled via agent_config.yaml

Available Agents

๐ŸŽ›๏ธ ModeratorAgent

  • Intelligent orchestrator that routes to specialized agents
  • Context-aware multi-turn conversations
  • Automatic agent selection based on query analysis
  • Session management and cleanup

๐Ÿค– Assistant Agent

  • General purpose conversational AI
  • Context-aware responses
  • Multi-turn conversations

๐Ÿ’ป Code Executor Agent

  • Secure Python and Bash execution in Docker
  • Isolated environment with resource limits
  • Real-time output streaming

๐Ÿ” Web Search Agent

  • Multi-provider search (Brave, AVES APIs)
  • Academic search capabilities
  • Automatic provider failover

๐Ÿ•ท๏ธ Web Scraper Agent

  • Proxy-enabled scraping (ScraperAPI compatible)
  • Playwright and requests-based scraping
  • Batch URL processing with rate limiting

๐Ÿ“š Knowledge Base Agent

  • Document ingestion (PDF, DOCX, TXT, web URLs)
  • Vector similarity search with Qdrant
  • Semantic question answering

๐ŸŽฅ Media Editor Agent

  • Audio/video processing with FFmpeg
  • Format conversion, resizing, trimming
  • Audio extraction and volume adjustment

๐ŸŽฌ YouTube Download Agent

  • Download videos and audio from YouTube
  • Docker-based execution with pytubefix
  • Automatic title sanitization and metadata extraction

Prerequisites

Required

  • Python 3.11+
  • Docker (for code execution, media processing, YouTube downloads)
  • Redis (Cloud Redis recommended: Redis Cloud)

Recommended Cloud Services

  • Redis Cloud
  • Qdrant Cloud for knowledge base operations
  • AWS Bedrock, OpenAI, or Anthropic for LLM services

API Keys (Optional - based on enabled features)

  • OpenAI API Key (for GPT models)
  • Anthropic API Key (for Claude models)
  • AWS Credentials (for Bedrock models)
  • Brave Search API Key (for web search)
  • AVES API Key (for web search)
  • ScraperAPI/Proxy credentials (for web scraping)
  • Qdrant Cloud API Key (for Knowledge Base operations)
  • Redis Cloud credentials (for memory management)

Installation

1. Install Dependencies

# Install requirements
pip install -r requirements.txt

2. Setup Docker Images

# Pull the multi-purpose container image
docker pull sgosain/amb-ubuntu-python-public-pod

3. Setup Redis

**Recommended: Cloud Redis **

# In agent_config.yaml
redis:
  host: "your-redis-cloud-endpoint.redis.cloud"
  port: 6379
  password: "your-redis-password"

Alternative: Local Redis

# Using Docker (for development)
docker run -d --name redis -p 6379:6379 redis:latest

# Or install locally
# sudo apt-get install redis-server  # Ubuntu/Debian
# brew install redis                 # macOS

Configuration

Create agent_config.yaml in your project root:

# Redis Configuration (Required)
redis:
  host: "your-redis-cloud-endpoint.redis.cloud"  # Recommended: Cloud Redis
  port: 6379
  db: 0
  password: "your-redis-password"  # Required for cloud
  # Alternative local: host: "localhost", password: null

# LLM Configuration (Required - at least one provider)
llm:
  preferred_provider: "openai"  # openai, anthropic, or bedrock
  temperature: 0.7
  
  # Provider API Keys
  openai_api_key: "your-openai-key"
  anthropic_api_key: "your-anthropic-key"
  
  # AWS Bedrock (optional)
  aws_access_key_id: "your-aws-key"
  aws_secret_access_key: "your-aws-secret"
  aws_region: "us-east-1"

# Agent Capabilities (Enable/disable features)
agent_capabilities:
  enable_knowledge_base: true
  enable_web_search: true
  enable_code_execution: true
  enable_file_processing: true
  enable_web_ingestion: true
  enable_api_calls: true
  enable_web_scraping: true
  enable_proxy_mode: true
  enable_media_editor: true
  enable_youtube_download: true

# used by the ModeratorAgent to determine which agents to enable if not explicitly specified in code
# by default all agents are enabled
moderator:
  default_enabled_agents:
    - knowledge_base
    - web_search
    - assistant
    - media_editor
    - youtube_download
    - code_executor  # Enable only if needed for security
    - web_scraper    # Enable only if needed

# Web Search Configuration (if enabled)
web_search:
  brave_api_key: "your-brave-api-key"
  avesapi_api_key: "your-aves-api-key"

# Web Scraping Configuration (if enabled)
web_scraping:
  proxy_enabled: true
  proxy_config:
    http_proxy: "http://scraperapi:your-key@proxy-server.scraperapi.com:8001"
  default_headers:
    User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
  timeout: 60
  max_links_per_page: 100

# Knowledge Base Configuration (if enabled)
knowledge_base:
  qdrant_url: "https://your-cluster.qdrant.tech"  # Recommended: Qdrant Cloud
  qdrant_api_key: "your-qdrant-api-key"           # Required for cloud
  # Alternative local: "http://localhost:6333"
  chunk_size: 1024
  chunk_overlap: 20
  similarity_top_k: 5

# Media Editor Configuration (if enabled)
media_editor:
  docker_image: "sgosain/amb-ubuntu-python-public-pod"
  input_dir: "./media_input"
  output_dir: "./media_output" 
  timeout: 300
  memory_limit: "2g"

# YouTube Download Configuration (if enabled)
youtube_download:
  docker_image: "sgosain/amb-ubuntu-python-public-pod"
  download_dir: "./youtube_downloads"
  timeout: 600
  memory_limit: "1g"
  default_audio_only: true

# Docker Configuration
docker:
  timeout: 60
  memory_limit: "512m"
  images: ["sgosain/amb-ubuntu-python-public-pod"]

# Service Configuration
service:
  max_sessions: 100
  session_timeout: 3600
  log_level: "INFO"
  log_to_file: false

# Memory Management
memory_management:
  compression:
    enabled: true
    algorithm: "lz4"
  cache:
    enabled: true
    max_size: 1000
    ttl_seconds: 300

Project Structure

ambivo_agents/
โ”œโ”€โ”€ agents/          # Agent implementations
โ”‚   โ”œโ”€โ”€ assistant.py
โ”‚   โ”œโ”€โ”€ code_executor.py
โ”‚   โ”œโ”€โ”€ knowledge_base.py
โ”‚   โ”œโ”€โ”€ media_editor.py
โ”‚   โ”œโ”€โ”€ moderator.py     # ๐ŸŽ›๏ธ ModeratorAgent (main orchestrator)
โ”‚   โ”œโ”€โ”€ simple_web_search.py
โ”‚   โ”œโ”€โ”€ web_scraper.py
โ”‚   โ”œโ”€โ”€ web_search.py
โ”‚   โ””โ”€โ”€ youtube_download.py
โ”œโ”€โ”€ config/          # Configuration management
โ”œโ”€โ”€ core/            # Core functionality
โ”‚   โ”œโ”€โ”€ base.py
โ”‚   โ”œโ”€โ”€ llm.py
โ”‚   โ””โ”€โ”€ memory.py
โ”œโ”€โ”€ executors/       # Execution environments
โ”œโ”€โ”€ services/        # Service layer
โ”œโ”€โ”€ __init__.py      # Package initialization
โ””โ”€โ”€ cli.py          # Command line interface

Usage Examples

๐ŸŽ›๏ธ ModeratorAgent Examples

Basic Usage with Auto-Routing

from ambivo_agents import ModeratorAgent
import asyncio

async def basic_moderator():
    # Create the moderator
    moderator, context = ModeratorAgent.create(user_id="demo_user")
    
    print(f"โœ… Session: {context.session_id}")
    
    # Auto-routing examples
    examples = [
        "Download audio from https://youtube.com/watch?v=dQw4w9WgXcQ",
        "Search for latest artificial intelligence news",  
        "Extract audio from video.mp4 as high quality MP3",
        "What is machine learning and how does it work?",
        "Scrape https://example.com for content"
    ]
    
    for query in examples:
        print(f"\n๐Ÿ‘ค User: {query}")
        response = await moderator.chat(query)
        print(f"๐Ÿค– Bot: {response[:150]}...")
    
    # Check which agents handled the requests
    status = await moderator.get_agent_status()
    print(f"\n๐Ÿ“Š Used {status['total_agents']} specialized agents")
    for agent_type in status['active_agents']:
        print(f"   โ€ข {agent_type}")
    
    await moderator.cleanup_session()

asyncio.run(basic_moderator())

Context-Aware Conversations

async def context_conversation():
    moderator, context = ModeratorAgent.create(user_id="context_demo")
    
    # Initial request  
    response1 = await moderator.chat("Download audio from https://youtube.com/watch?v=example")
    print(f"๐ŸŽต {response1}")
    
    # Follow-up using context (moderator remembers the YouTube URL)
    response2 = await moderator.chat("Actually, download the video instead of just audio")
    print(f"๐ŸŽฌ {response2}")
    
    # Another follow-up
    response3 = await moderator.chat("Get information about that video")
    print(f"๐Ÿ“Š {response3}")
    
    await moderator.cleanup_session()

Custom Agent Selection

async def custom_agents():
    # Only enable specific capabilities
    moderator, context = ModeratorAgent.create(
        user_id="custom_user",
        enabled_agents=['youtube_download', 'web_search', 'assistant']
    )
    
    # Only these agents will be available
    status = await moderator.get_agent_status()
    print(f"Available agents: {list(status['active_agents'].keys())}")
    
    response = await moderator.chat("Download https://youtube.com/watch?v=example")
    print(response)
    
    await moderator.cleanup_session()

๐ŸŽฌ YouTube Downloads

from ambivo_agents import YouTubeDownloadAgent

async def download_youtube():
    agent, context = YouTubeDownloadAgent.create(user_id="media_user")
    
    # Download audio
    result = await agent._download_youtube_audio(
        "https://youtube.com/watch?v=example"
    )
    
    if result['success']:
        print(f"โœ… Audio downloaded: {result['filename']}")
        print(f"๐Ÿ“ Path: {result['file_path']}")
        print(f"๐Ÿ“Š Size: {result['file_size_bytes']:,} bytes")
    
    # Get video info
    info = await agent._get_youtube_info(
        "https://youtube.com/watch?v=example"
    )
    
    if info['success']:
        video_info = info['video_info']
        print(f"๐Ÿ“น Title: {video_info['title']}")
        print(f"โฑ๏ธ Duration: {video_info['duration']} seconds")
    
    await agent.cleanup_session()

๐Ÿ“š Knowledge Base Operations

from ambivo_agents import KnowledgeBaseAgent

async def knowledge_base_demo():
    agent, context = KnowledgeBaseAgent.create(
        user_id="kb_user",
        session_metadata={"project": "company_docs"}
    )
    
    print(f"Session: {context.session_id}")
    
    # Ingest document
    result = await agent._ingest_document(
        kb_name="company_kb",
        doc_path="/path/to/document.pdf",
        custom_meta={"department": "HR", "type": "policy"}
    )
    
    if result['success']:
        print("โœ… Document ingested")
        
        # Query the knowledge base
        answer = await agent._query_knowledge_base(
            kb_name="company_kb",
            query="What is the remote work policy?"
        )
        
        if answer['success']:
            print(f"๐Ÿ“ Answer: {answer['answer']}")
    
    # View conversation history
    history = await agent.get_conversation_history(limit=5)
    print(f"๐Ÿ’ฌ Messages in session: {len(history)}")
    
    await agent.cleanup_session()

๐Ÿ” Web Search

from ambivo_agents import WebSearchAgent

async def search_demo():
    agent, context = WebSearchAgent.create(user_id="search_user")
    
    # Search the web
    results = await agent._search_web(
        "artificial intelligence trends 2024",
        max_results=5
    )
    
    if results['success']:
        print(f"๐Ÿ” Found {len(results['results'])} results")
        
        for i, result in enumerate(results['results'], 1):
            print(f"{i}. {result['title']}")
            print(f"   {result['url']}")
            print(f"   {result['snippet'][:100]}...")
    
    await agent.cleanup_session()

๐ŸŽต Media Processing

from ambivo_agents import MediaEditorAgent

async def media_demo():
    agent, context = MediaEditorAgent.create(user_id="media_user")
    
    # Extract audio from video
    result = await agent._extract_audio_from_video(
        input_video="/path/to/video.mp4",
        output_format="mp3",
        audio_quality="high"
    )
    
    if result['success']:
        print(f"โœ… Audio extracted: {result['output_file']}")
    
    await agent.cleanup_session()

Context Manager Pattern (Auto-Cleanup)

from ambivo_agents import ModeratorAgent, AgentSession
import asyncio

async def main():
    # Auto-cleanup with context manager
    async with AgentSession(ModeratorAgent, user_id="sarah") as moderator:
        print(f"Session: {moderator.context.session_id}")
        
        # Use moderator - cleanup happens automatically
        response = await moderator.chat("Download audio from https://youtube.com/watch?v=example")
        print(response)
        
        # Check agent status
        status = await moderator.get_agent_status()
        print(f"Active agents: {list(status['active_agents'].keys())}")
    # Moderator automatically cleaned up here

asyncio.run(main())

Command Line Interface

The CLI provides full command line access to all agent capabilities, allowing you to interact with the system without writing code. reads from the agent_config.yaml file for configuration.:

# Install the CLI
pip install ambivo-agents

# Interactive mode with auto-routing
ambivo-agents

# Single queries (auto-routed)
ambivo-agents -q "Download audio from https://youtube.com/watch?v=example"
ambivo-agents -q "Search for latest AI trends"
ambivo-agents -q "Extract audio from video.mp4"

# Check agent status
ambivo-agents status

# Test all agents
ambivo-agents --test

Command Line Examples

# ModeratorAgent routes these automatically:

# YouTube downloads
ambivo-agents -q "Download https://youtube.com/watch?v=example --audio-only"
ambivo-agents -q "Get info about https://youtube.com/watch?v=example"

# Web search
ambivo-agents -q "Search for latest Python frameworks"
ambivo-agents -q "Find news about artificial intelligence"

# Media processing  
ambivo-agents -q "Extract audio from video.mp4 as high quality mp3"
ambivo-agents -q "Convert video.avi to mp4"

# General assistance
ambivo-agents -q "What is machine learning?"
ambivo-agents -q "Explain quantum computing"

# Interactive mode with smart routing
ambivo-agents
> Download audio from YouTube
> Search for AI news
> Extract audio from my video file
> What's the weather like?

CLI Status and Debugging

# Check agent status
ambivo-agents status

# View configuration
ambivo-agents config  

# Debug mode
ambivo-agents --debug -q "test query"

# Test all capabilities
ambivo-agents --test

Architecture

ModeratorAgent Architecture

The ModeratorAgent acts as an intelligent orchestrator:

[User Query] 
     โ†“
[ModeratorAgent] โ† Analyzes intent and context
     โ†“
[Intent Analysis] โ† Uses LLM + patterns + keywords
     โ†“
[Route Selection] โ† Chooses best agent(s)
     โ†“
[Specialized Agent] โ† YouTubeAgent, SearchAgent, etc.
     โ†“
[Response] โ† Combined and contextualized
     โ†“
[User]

Agent Capabilities

Each agent provides specialized functionality:

  • ๐ŸŽ›๏ธ ModeratorAgent โ†’ Intelligent routing and orchestration
  • ๐ŸŽฌ YouTube Download Agent โ†’ Video/audio downloads with pytubefix
  • ๐ŸŽฅ Media Editor Agent โ†’ FFmpeg-based processing
  • ๐Ÿ“š Knowledge Base Agent โ†’ Qdrant vector search
  • ๐Ÿ” Web Search Agent โ†’ Multi-provider search
  • ๐Ÿ•ท๏ธ Web Scraper Agent โ†’ Proxy-enabled scraping
  • ๐Ÿ’ป Code Executor Agent โ†’ Docker-based execution

Memory System

  • Redis-based persistence with compression and caching
  • Built-in conversation history for every agent
  • Session-aware context with automatic cleanup
  • Multi-session support with isolation

LLM Provider Management

  • Automatic failover between OpenAI, Anthropic, AWS Bedrock
  • Rate limiting and error handling
  • Provider rotation based on availability and performance

Docker Setup

Custom Docker Image

If you need additional dependencies, extend the base image:

FROM sgosain/amb-ubuntu-python-public-pod

# Install additional packages
RUN pip install your-additional-packages

# Add custom scripts
COPY your-scripts/ /opt/scripts/

Volume Mounting

The agents automatically handle volume mounting for:

  • Media input/output directories
  • YouTube download directories
  • Code execution workspaces

Troubleshooting

Common Issues

  1. ModeratorAgent Routing Issues

    # Check available agents
    status = await moderator.get_agent_status()
    print(f"Available: {list(status['active_agents'].keys())}")
    
    # Check configuration
    print(f"Enabled: {moderator.enabled_agents}")
    
  2. Redis Connection Failed

    # For cloud Redis: Check connection details in agent_config.yaml
    # For local Redis: Check if running
    redis-cli ping  # Should return "PONG"
    
  3. Docker Not Available

    # Check Docker is running
    docker ps
    # Install if missing: https://docs.docker.com/get-docker/
    
  4. Agent Creation Errors

    # Check moderator can be created
    from ambivo_agents import ModeratorAgent
    try:
        moderator, context = ModeratorAgent.create(user_id="test")
        print(f"โœ… Success: {context.session_id}")
        await moderator.cleanup_session()
    except Exception as e:
        print(f"โŒ Error: {e}")
    
  5. Import Errors

    # Ensure clean imports work
    python -c "from ambivo_agents import ModeratorAgent; print('โœ… Import success')"
    

Debug Mode

Enable verbose logging:

service:
  log_level: "DEBUG"
  log_to_file: true

Security Considerations

  • Docker Isolation: All code execution happens in isolated containers
  • Network Restrictions: Containers run with network_disabled=True by default
  • Resource Limits: Memory and CPU limits prevent resource exhaustion
  • API Key Management: Store sensitive keys in environment variables
  • Input Sanitization: All user inputs are validated and sanitized
  • Session Isolation: Each agent session is completely isolated

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

# Clone repository
git clone https://github.com/ambivo-corp/ambivo-agents.git
cd ambivo-agents

# Install in development mode
pip install -e .

# Test ModeratorAgent
python -c "
from ambivo_agents import ModeratorAgent
import asyncio

async def test():
    moderator, context = ModeratorAgent.create(user_id='test')
    response = await moderator.chat('Hello!')
    print(f'Response: {response}')
    await moderator.cleanup_session()

asyncio.run(test())
"

License

MIT License - see LICENSE file for details.

Alpha Release: This software is provided "as is" without warranty. Users assume all risks associated with its use, particularly in production environments.

Author

Hemant Gosain 'Sunny'

Support

Alpha Support: As an alpha release, support is provided on a best-effort basis. Response times may vary, and some issues may require significant investigation.


Developed by the Ambivo team.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ambivo_agents-1.0.1.tar.gz (111.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ambivo_agents-1.0.1-py3-none-any.whl (118.0 kB view details)

Uploaded Python 3

File details

Details for the file ambivo_agents-1.0.1.tar.gz.

File metadata

  • Download URL: ambivo_agents-1.0.1.tar.gz
  • Upload date:
  • Size: 111.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for ambivo_agents-1.0.1.tar.gz
Algorithm Hash digest
SHA256 af68a6ec555a10fabb1cb0f39ca2f09ba58bf70282145d5814e0911dbe828be2
MD5 a15c39733ffe9e746979445fa1bb73ec
BLAKE2b-256 981f72b226785188d2e4818f6622d60ae20fb539bc63a0d82ca57c29c00fca5f

See more details on using hashes here.

File details

Details for the file ambivo_agents-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ambivo_agents-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 118.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for ambivo_agents-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8452d26eadafe3f9b31631227b418f2d02750bfd239a2e190ba410ae982de522
MD5 3ea2be37e62130f73d9d00f27f84f1a1
BLAKE2b-256 bef8554026f9d2297fca746e910f5efce028d4fe7e7423f8231e4ec9f820b09b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page