Skip to main content

OverseeX integration for CrewAI - automatic trace capture for multi-agent workflows

Project description

AgentGuard CrewAI Integration

Automatic trace capture for CrewAI multi-agent workflows.

Installation

pip install agentguard-crewai

Quick Start

from crewai import Crew, Agent, Task
from agentguard_crewai import AgentGuardObserver

# Define your agents
researcher = Agent(
    role="Researcher",
    goal="Research and analyze topics",
    backstory="Expert researcher with deep analysis skills"
)

writer = Agent(
    role="Writer",
    goal="Write engaging content",
    backstory="Creative writer with storytelling expertise"
)

# Define tasks
research_task = Task(
    description="Research AI trends in 2026",
    agent=researcher,
    expected_output="Detailed research report"
)

writing_task = Task(
    description="Write article based on research",
    agent=writer,
    context=[research_task],
    expected_output="Published article"
)

# Create crew with AgentGuard observer
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, writing_task]
)

observer = AgentGuardObserver(api_key="ag_live_your_key")
observer.register_crew_agents(crew)

# Run crew - traces automatically captured!
result = crew.kickoff()

# View traces in AgentGuard dashboard
print("✅ Execution complete! View traces at http://localhost:3000/dashboard")

Features

  • Automatic agent registration - Agents registered in AgentGuard on first use
  • Task execution tracking - Capture every task execution with timing
  • Tool call monitoring - Track all tool uses by agents
  • Multi-agent coordination - Capture delegation and collaboration events
  • Error tracking - Automatic error capture and reporting
  • State drift detection - Monitor inter-agent state changes
  • PII redaction - Sensitive data automatically redacted

Advanced Usage

Custom Configuration

observer = AgentGuardObserver(
    api_key="ag_live_your_key",
    base_url="https://api.agentguard.io",  # Production API
    capture_tools=True,  # Capture tool calls
    capture_coordination=True,  # Capture agent coordination
    auto_register_agents=True  # Auto-register agents
)

Manual Event Tracking

# Track task start
observer.on_task_start(task, agent, crew)

# Track tool use
observer.on_tool_use(agent, tool, input_data, output_data)

# Track coordination
observer.on_agent_coordination(source_agent, target_agent, message, crew)

# Track completion
observer.on_task_complete(task, agent, output, crew)

# Track errors
observer.on_task_error(task, agent, error, crew)

Monkey-Patching (Automatic)

For automatic tracing without manual observer setup:

from agentguard_crewai import monkey_patch_crewai, AgentGuardObserver

# Patch CrewAI globally
observer = AgentGuardObserver(api_key="ag_live_...")
monkey_patch_crewai(observer)

# All Crew executions are now automatically traced
crew = Crew(agents=[...], tasks=[...])
crew.kickoff()  # Automatically traced!

What Gets Captured

Task Execution

{
    "task": "Research AI trends",
    "expected_output": "Research report",
    "context": ["Previous task outputs"],
    "tools": ["WebSearchTool", "ScraperTool"],
    "duration_ms": 12500,
    "status": "success"
}

Multi-Agent Coordination

{
    "coordination": {
        "allow_delegation": True,
        "crew_size": 3,
        "agent_role": "Researcher",
        "events": [
            {
                "from": "Researcher",
                "to": "Writer",
                "message": "Here's the research data",
                "timestamp": 1737645123.45
            }
        ]
    }
}

Tool Calls

{
    "tool_calls": [
        {
            "tool": "WebSearchTool",
            "input": "AI trends 2026",
            "output": "Found 100 articles...",
            "timestamp": 1737645120.12
        }
    ]
}

Dashboard Integration

View all captured traces in AgentGuard dashboard:

  • Timeline view - See task execution sequence
  • Coordination graph - Visualize agent interactions
  • Tool usage - Track which tools are used most
  • Error analysis - Identify failure patterns
  • Performance metrics - Optimize slow tasks

Support

License

MIT

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

overseex_crewai-0.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

overseex_crewai-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file overseex_crewai-0.1.0.tar.gz.

File metadata

  • Download URL: overseex_crewai-0.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for overseex_crewai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a7ac90654c0bf649fc9bb5f1d2c1e0e00d2bcf6aa94b14af3bed50dbb8330e2f
MD5 205c401728606499c62c80706a0cadb0
BLAKE2b-256 f9f34162a746e775d946c30a77430ecf189db0ac09ef03f15b173c719771794f

See more details on using hashes here.

File details

Details for the file overseex_crewai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for overseex_crewai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab8f989403548034f0a050d479fc9e097e59441c78d0292a23c66884765661a5
MD5 62d7683afb7f8f432aa55affe46e55ad
BLAKE2b-256 545808605d3bebdfe26c0daa5691dbfff4677475bbd51a07a11b35b655f406ad

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