### Makefile Commands for Setup Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/quick-reference.md Commands to install Python and frontend dependencies, and perform a full development setup. These commands use `uv` for Python package management. ```bash make install # Install Python dependencies with uv make frontend-install # Install frontend npm dependencies make dev-setup # Full setup (install + frontend + pre-commit) ``` -------------------------------- ### Python Virtual Environment Setup and Dependency Installation Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/contributing.md Steps to set up a Python virtual environment using `uv` and install project dependencies. This ensures a consistent development environment. It also shows how to verify the CLI is accessible. ```bash uv python -m venv venv && source venv/bin/activate uv sync uv run agentic-fleet --help ``` -------------------------------- ### Agentic Fleet Development Server Setup Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/system-overview.md Instructions for starting the Agentic Fleet development server, which includes both the FastAPI backend and the React frontend. It also outlines separate commands to start each component independently. ```bash # Start both backend (8000) and frontend (5173) agentic-fleet dev # Or separately make backend # FastAPI on :8000 make frontend # React on :5173 ``` -------------------------------- ### Start Agentic Fleet Frontend (Make) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/frontend.md Utilizes Make commands to manage the Agentic Fleet development servers. Provides options to start both servers simultaneously or individually. ```bash make dev # Both servers make backend # Backend only (port 8000) make frontend-dev # Frontend only (port 5173) ``` -------------------------------- ### Implement Quality Gates for Handoffs Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/internals/handoffs.md Shows how to add checkpoints before critical handoffs to verify quality. This example checks research quality before handing off to an analyst, ensuring data integrity. ```python # Add checkpoints before critical handoffs if handoff.from_agent == "Researcher": # Verify data quality before analyst handoff if not self._validate_research_quality(handoff): return await self._request_refinement(handoff) # Proceed with handoff only if quality passes return handoff ``` -------------------------------- ### DSPy Configuration Example (YAML) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/user-guide.md Illustrates common path-related settings for DSPy optimization and logging within the framework's configuration files. It specifies paths for training examples and log directories. ```yaml dspy: optimization: examples_path: src/agentic_fleet/data/supervisor_examples.json gepa_log_dir: .var/logs/dspy/gepa logging: file: .var/logs/workflow.log history_file: .var/logs/execution_history.jsonl ``` -------------------------------- ### Verify AgenticFleet Installation Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/getting-started.md Verifies the AgenticFleet installation by running the test suite or a quick sanity check command. Successful execution should list the available agents. ```bash # Run the test suite to verify everything works make test ``` ```bash # Or run a quick sanity check agentic-fleet list-agents ``` -------------------------------- ### Install Frontend Dependencies (Make) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/frontend.md Installs the necessary Node.js dependencies for the frontend project. This can be done using a Make command or by navigating to the frontend directory and running npm install directly. ```bash # From project root make frontend-install # Or directly cd src/frontend && npm install ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/user-guide.md Instructions to clone the agentic-fleet repository and install its dependencies using either a Makefile with uv or directly with uv. ```bash git clone https://github.com/Qredence/agentic-fleet.git cd agentic-fleet make install ``` ```bash uv sync ``` -------------------------------- ### AgenticFleet Configuration Setup Source: https://context7.com/qredence/agentic-fleet/llms.txt Demonstrates the setup process for AgenticFleet, including copying and editing the environment file with API keys and settings, installing dependencies using uv or pip, verifying the configuration, and customizing workflow behavior via YAML. ```bash # 1. Copy example environment file cp .env.example .env # 2. Edit .env with required keys # .env contents: # Required OPENAI_API_KEY="sk-..." # Optional: Tavily enables web search for Researcher agent TAVILY_API_KEY="tvly-..." # Optional: Toggle DSPy compilation (true/false) DSPY_COMPILE=true # Optional: Custom OpenAI endpoint OPENAI_BASE_URL=https://... # Optional: OpenTelemetry tracing ENABLE_OTEL=true OTLP_ENDPOINT=http://localhost:4318 # Optional: Langfuse tracing LANGFUSE_PUBLIC_KEY=... LANGFUSE_SECRET_KEY=... # Optional: Azure Cosmos DB persistence AGENTICFLEET_USE_COSMOS=0 AZURE_COSMOS_ENDPOINT=https://.documents.azure.com:443/ AZURE_COSMOS_USE_MANAGED_IDENTITY=0 AZURE_COSMOS_KEY= AZURE_COSMOS_DATABASE=agentic-fleet # Optional: Azure AI Foundry integration AZURE_AI_PROJECT_ENDPOINT=https://... # 3. Install dependencies # Using uv (recommended) make install # or uv sync # Or using pip pip install agentic-fleet # 4. Verify configuration python -c "from agentic_fleet.api.settings import settings; print(settings.PROJECT_NAME)" # Output: Agentic Fleet # 5. Edit workflow_config.yaml for behavior customization # Key sections: dspy (models, optimization), agents (roster, tools), # workflow (max_rounds, streaming), quality (thresholds, refinement) ``` -------------------------------- ### AgenticFleet Quick Reference Commands Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/getting-started.md A collection of common AgenticFleet commands for various tasks, including running agents, starting development servers, listing agents, managing cache, running tests, and viewing execution history. ```bash # Run a task agentic-fleet run -m "Your task" # Start dev servers agentic-fleet dev # List agents agentic-fleet list-agents # Verbose output agentic-fleet run -m "Task" --verbose # Clear cache make clear-cache # Run tests make test # See history uv run python src/agentic_fleet/scripts/analyze_history.py ``` -------------------------------- ### Quick Start Bash Script for Tracing Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/TRACING_SETUP_COMPLETE.md This bash script demonstrates the sequence of commands to start the tracing collector, the AgenticFleet backend, run a workflow, and view the traces in the Jaeger UI. ```bash # Terminal 1: Start the tracing collector make tracing-start # Terminal 2: Start AgenticFleet backend make backend # Terminal 3: Run a workflow and see it trace! agentic-fleet run -m "Who is the CEO of Apple?" --verbose # Browser: View traces # Open http://localhost:16686 # Select service: agentic-fleet # Click "Find Traces" to see your workflow! ``` -------------------------------- ### GEPA Training Example for Handoffs (JSON) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/internals/handoffs.md This JSON structure defines a training example for GEPA, including task details, team roles, available tools, and specific handoff parameters. It highlights new fields for handoff strategy, points, and quality gates, crucial for training adaptive routing. ```json { "task": "Research market trends and create analysis report", "team": "Researcher: Web search expert\nAnalyst: Data analysis\nWriter: Content", "available_tools": "TavilySearchTool, HostedCodeInterpreterTool", "assigned_to": "Researcher,Analyst,Writer", "mode": "sequential", "tool_requirements": ["TavilySearchTool", "HostedCodeInterpreterTool"], "_comment": "NEW handoff fields", "handoff_strategy": "Research data → Analyst processes → Writer summarizes", "handoff_points": ["After data collection", "After analysis"], "quality_gates": [ "Verify data quality", "Validate analysis", "Review writing" ] } ``` -------------------------------- ### Makefile Commands for Development Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/quick-reference.md Commands to run the backend and frontend development servers, or run the CLI application. Allows for starting both simultaneously, individually, or with custom ports. ```bash make dev # Run backend (8000) + frontend (5173) together make backend # Backend only on port 8000 make frontend-dev # Frontend only on port 5173 make run # CLI application # Or use the CLI directly agentic-fleet dev # Start both servers agentic-fleet dev --backend-port 8080 # Custom backend port agentic-fleet dev --no-frontend # Backend only agentic-fleet dev --no-backend # Frontend only ``` -------------------------------- ### Clone AgenticFleet Repository Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/getting-started.md Clones the AgenticFleet GitHub repository and navigates into the project directory. This is the first step in setting up the project locally. ```bash git clone https://github.com/Qredence/agentic-fleet.git cd agentic-fleet ``` -------------------------------- ### AgenticFleet CLI Usage Examples Source: https://github.com/qredence/agentic-fleet/blob/main/README.md Provides various command-line examples for interacting with AgenticFleet, including running tasks, specifying execution modes, listing agents, and starting development servers. ```bash agentic-fleet # Interactive console agentic-fleet run -m "Your task" # Execute a task agentic-fleet run -m "Query" --mode handoff # Specific execution mode agentic-fleet list-agents # Show available agents agentic-fleet dev # Start dev servers ``` -------------------------------- ### Start Tracing and Backend Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/TRACING_SETUP_COMPLETE.md Commands to start the tracing infrastructure and the backend service for the agentic fleet. This is the primary command to initiate tracing. Ensure the backend is running before opening the Jaeger UI. ```bash make tracing-start && make backend # Then open http://localhost:16686 ``` -------------------------------- ### Training Example JSON Format Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/configuration.md Specifies the structure for training examples used to teach DSPy optimal routing patterns. This format includes fields for task definition, team roles, available tools, context, assignment, execution mode, and tool requirements. ```json { "task": "Research and analyze the impact of AI on healthcare", "team": "Researcher: Web research specialist\nAnalyst: Data analysis expert", "available_tools": "- TavilySearchTool (available to Researcher): ...", "context": "Initial research task", "assigned_to": "Researcher,Analyst", "mode": "sequential", "tool_requirements": ["TavilySearchTool"] } ``` -------------------------------- ### Custom Example File Integration (Python) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/self-improvement.md Demonstrates how to use a custom JSON file for self-improvement examples within the agentic fleet system using the `SelfImprovementEngine` class in Python. It also shows how to force recompilation. ```python engine = SelfImprovementEngine() # Use custom examples file engine.auto_improve( examples_file="src/agentic_fleet/data/custom_examples.json", force_recompile=True ) ``` -------------------------------- ### YAML Configuration for GEPA Fine-Tuning Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/dspy-optimizer.md Demonstrates enabling and configuring GEPA for fine-tuning optimization after BootstrapFewShot has been used. It suggests starting with conservative settings. ```yaml dspy: optimization: use_gepa: true gepa_auto: light # Start conservative gepa_use_history_examples: true ``` -------------------------------- ### YAML Configuration for BootstrapFewShot Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/dspy-optimizer.md Shows how to configure DSPy optimization to start with BootstrapFewShot, emphasizing its benefits for fast compilation and predictable improvements. ```yaml dspy: optimization: enabled: true use_gepa: false max_bootstrapped_demos: 4 ``` -------------------------------- ### Testing a Simple Query Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/quick-reference.md A basic example of running a query through the agentic-fleet system to test its functionality. This command executes a simple arithmetic question and enables verbose logging. ```bash uv run agentic-fleet run -m "What is 2+2?" --verbose ``` -------------------------------- ### Install AgenticFleet Dependencies Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/getting-started.md Installs project dependencies using `uv`, a fast Python package installer. It provides instructions for using `make` or directly with `uv`. Fallback options for installing `uv` and using `pip` are also included. ```bash # Recommended: Use Make (handles everything) make install ``` ```bash # Or directly with uv uv sync ``` ```bash # Install uv first curl -LsSf https://astral.sh/uv/install.sh | sh # Then restart your terminal and run uv sync ``` ```bash pip install -e . ``` -------------------------------- ### Install uv Package Manager Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/getting-started.md Installs the 'uv' package manager using a curl script. This is a prerequisite for using 'uv sync' and other uv commands. Ensure your terminal is restarted after installation for the changes to take effect. ```bash # Install uv curl -LsSf https://astral.sh/uv/install.sh | sh # Restart terminal, then uv sync ``` -------------------------------- ### Clone and Setup AgenticFleet Source: https://github.com/qredence/agentic-fleet/blob/main/docs/INDEX.md This snippet outlines the initial steps to clone the AgenticFleet repository, navigate into the directory, and set up the development environment using make commands. It assumes the user has git and make installed. ```bash git clone https://github.com/Qredence/agentic-fleet.git cd agentic-fleet make dev-setup ``` -------------------------------- ### Create and Execute Workflow Agent using Agent-Framework Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/architecture.md Illustrates the process of building a workflow from a builder and then creating a workflow agent. It shows how to execute the workflow synchronously using `run()` and asynchronously in a streaming fashion using `run_stream()`, yielding events during execution. ```python # 2. Create runtime agent workflow = workflow_builder.build() workflow_agent = workflow.as_agent() # 3. Execute workflow result = await workflow_agent.run(task_msg) async for event in workflow_agent.run_stream(task_msg): if isinstance(event, MagenticAgentMessageEvent): yield event ``` -------------------------------- ### Define Clear Agent Roles Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/internals/handoffs.md Contrasts good and bad examples of defining agent roles. Clear, specific, and non-overlapping roles improve agent selection and task execution. ```python # Good: Specific, non-overlapping "Researcher": "Web search and fact-finding specialist" "Analyst": "Data processing and statistical analysis expert" # Bad: Vague, overlapping "Researcher": "Finds information" "Analyst": "Analyzes things" ``` -------------------------------- ### Validate Configuration with Pydantic Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/configuration.md Validates the application configuration using Pydantic schemas at startup. It catches and reports `ConfigurationError` exceptions, indicating issues with specific configuration keys. This ensures the application starts with a valid setup. ```python from agentic_fleet.core.config import validate_config from agentic_fleet.workflows.exceptions import ConfigurationError try: schema = validate_config(config_dict) print("✓ Configuration is valid") except ConfigurationError as e: print(f"✗ Invalid configuration: {e}") if e.config_key: print(f" Problem with key: {e.config_key}") ``` -------------------------------- ### Profile Configuration Loading with `timed_operation` (Python) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/PROFILING_GUIDE.md This example demonstrates profiling the loading of configuration and the initialization of agents using the `timed_operation` context manager. It applies specific time thresholds to both operations, allowing for early detection of performance bottlenecks during application startup. ```python from agentic_fleet.utils import timed_operation, load_config def initialize_app(): with timed_operation("load_config", threshold_ms=50): config = load_config() with timed_operation("initialize_agents", threshold_ms=200): agents = initialize_agents(config) return config, agents ``` -------------------------------- ### Format Handoff Input for Context Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/internals/handoffs.md Provides a Python method signature for formatting handoff context to improve clarity for the next agent. It suggests adding structure, examples, and clear instructions to the handoff package. ```python def _format_handoff_input(self, handoff: HandoffContext) -> str: # Add more structure # Include examples # Provide clear instructions return formatted_input ``` -------------------------------- ### Initialization Procedures in Python Source: https://github.com/qredence/agentic-fleet/blob/main/docs/consolidation_analysis_report.md This Python snippet demonstrates the initialization process for the agentic fleet. It likely sets up necessary components, loads configurations, and prepares the environment for running workflows and agents. This ensures all prerequisites are met before operational tasks begin. ```python import os class AgenticFleetInitializer: def __init__(self, config_path="config.yaml"): self.config_path = config_path self.config = None def load_configuration(self): print(f"Loading configuration from {self.config_path}...") # Placeholder for actual configuration loading (e.g., using PyYAML) if os.path.exists(self.config_path): # with open(self.config_path, 'r') as f: # self.config = yaml.safe_load(f) self.config = {"default_agent": "generic_agent", "max_retries": 3} print("Configuration loaded successfully.") else: raise FileNotFoundError(f"Configuration file not found at {self.config_path}") def initialize_components(self): if not self.config: raise RuntimeError("Configuration not loaded. Call load_configuration first.") print("Initializing core components...") # Logic to initialize agents, executors, communication channels, etc. print(f"Using default agent: {self.config.get('default_agent')}") print(f"Max retries set to: {self.config.get('max_retries')}") def run_initialization(self): self.load_configuration() self.initialize_components() print("Agentic Fleet initialization complete.") ``` -------------------------------- ### Install Tracing Dependencies for Azure Monitor Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/tracing.md Commands to install necessary packages for Azure Monitor integration with agentic-fleet. Ensures the 'agentic-fleet' package with tracing capabilities is installed, or specifically 'azure-monitor-opentelemetry'. ```bash uv add agentic-fleet[tracing] ``` ```bash pip install azure-monitor-opentelemetry ``` -------------------------------- ### Install 'uv' Package Manager Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/troubleshooting.md Installs the 'uv' package manager using a curl script. This is a prerequisite for using 'uv' commands for dependency management and execution. A fallback to 'pip install -e .' is provided if 'uv' installation fails or is not desired. ```bash # Install uv first curl -LsSf https://astral.sh/uv/install.sh | sh # Or use pip as fallback pip install -e . ``` -------------------------------- ### Run Agentic Fleet CLI - Basic Usage Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/user-guide.md Demonstrates basic command-line usage for the agentic-fleet framework, including auto-mode for task detection and explicit mode selection (standard, handoff). Verbose logging is also shown. ```bash # Basic usage (Auto-mode detects best workflow) uv run agentic-fleet run -m "Your question here" # Explicitly force a mode uv run agentic-fleet run -m "Complex analysis" --mode standard uv run agentic-fleet run -m "Quick research" --mode handoff # With verbose logging (see all DSPy decisions) uv run agentic-fleet run -m "Your question here" --verbose ``` -------------------------------- ### Count Agentic Fleet Supervisor Examples Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/self-improvement.md This command counts the number of examples currently present in the supervisor's training data file (`supervisor_examples.json`). It's useful for verifying if new examples have been added or for troubleshooting issues related to example data. ```bash uv run python -c "import json; print(len(json.load(open('src/agentic_fleet/data/supervisor_examples.json'))))" ``` -------------------------------- ### Build Workflow Graph using Agent-Framework Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/architecture.md Demonstrates how to construct a workflow graph by defining the starting executor and adding edges to connect different executors. This is a fundamental step in setting up a workflow within the agent-framework. ```python workflow_builder = ( WorkflowBuilder() .set_start_executor(analysis_executor) .add_edge(analysis_executor, routing_executor) # ... more edges ) ``` -------------------------------- ### Start Agentic Fleet Frontend (CLI) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/frontend.md Launches the Agentic Fleet development server. This command can start both the backend and frontend, or be customized to start only one component. It defaults to backend on port 8000 and frontend on port 5173. ```bash # Start both backend and frontend agentic-fleet dev # Custom ports via CLI agentic-fleet dev --backend-port 8080 --frontend-port 3000 # Backend only (for API development) agentic-fleet dev --no-frontend # Frontend only (when backend is already running) agentic-fleet dev --no-backend ``` -------------------------------- ### Run First AgenticFleet Task Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/getting-started.md Executes a simple 'Hello World' task using AgenticFleet to write a haiku about artificial intelligence. This demonstrates the basic command structure for running tasks. ```bash agentic-fleet run -m "Write a haiku about artificial intelligence" ``` -------------------------------- ### Environment Variables Setup (Bash) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/quick-reference.md Configuration of essential environment variables for running the Agentic Fleet. Includes API keys for OpenAI and Tavily, and optional settings for DSPy compilation and logging. ```bash # Required OPENAI_API_KEY=sk-... # Required TAVILY_API_KEY=tvly-... # Optional DSPY_COMPILE=true # Enable/disable DSPy compilation LOG_LEVEL=INFO # Logging level ``` -------------------------------- ### JSON Example of a Good Training Task Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/dspy-optimizer.md Provides an example of a well-structured JSON object for a training task, detailing the task description, agent assignments, and execution mode. ```json { "task": "Research AI safety regulations in EU", "team": "Researcher: Web search\nAnalyst: Analysis\nWriter: Reports", "assigned_to": "Researcher,Analyst,Writer", "execution_mode": "sequential" } ``` -------------------------------- ### Agentic Fleet Self-Improvement - Add Examples Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/self-improvement.md This command initiates the self-improvement process, which analyzes the execution history and adds newly learned patterns as training examples. The output indicates how many new examples were added to the training set. ```bash # Add successful patterns uv run agentic-fleet self-improve ``` -------------------------------- ### Version Control Training Data and Tag Optimization Runs Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/dspy-optimizer.md This section demonstrates how to use Git for version control of training data, specifically adding and committing example files, and how to tag significant optimization runs with version information. ```bash # Version control your examples git add data/supervisor_examples.json git commit -m "Add 5 new sequential workflow examples" # Tag successful optimization runs git tag -a v1.0-optimized -m "GEPA optimization run 2025-11-07" ``` -------------------------------- ### AgenticFleet Configuration File Example Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/overview.md Demonstrates the structure and key parameters within the AgenticFleet configuration file (`config/workflow_config.yaml`). It covers DSPy settings, workflow constraints, and agent-specific overrides. ```yaml dspy: model: gpt-4.1 # Model for routing decisions enable_routing_cache: true # Cache routing for speed workflow: max_rounds: 15 # Prevent infinite loops enable_streaming: true # Real-time updates agents: researcher: model: gpt-4.1-mini # Per-agent model override tools: [TavilySearchTool] ``` -------------------------------- ### Install Tracing Extra for Microsoft AI Foundry Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/tracing.md Installs the necessary package for integrating AgenticFleet tracing with Microsoft AI Foundry, which can be done using pip or uv. ```bash uv add agentic-fleet[tracing] # or pip install azure-monitor-opentelemetry ``` -------------------------------- ### Python API: Create and Run Supervisor Workflow Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/system-overview.md Demonstrates how to create a supervisor workflow using the agentic_fleet library, run it synchronously or with streaming, and access its internal components like context, reasoner, and agents. Requires the agentic_fleet library and a configuration file. ```python from agentic_fleet.workflows import create_supervisor_workflow # Create workflow workflow = await create_supervisor_workflow( config_path="config/workflow_config.yaml", compile_dspy=False, # Use cached modules ) # Synchronous run result = await workflow.run("Your task") # Streaming run async for event in workflow.run_stream("Your task"): handle_event(event) # Access internals context = workflow.context reasoner = context.reasoner agents = context.agents ``` -------------------------------- ### Running the Agentic Fleet Demo Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/dspy-agent-framework-integration.md Provides instructions on how to set up the necessary environment variables and execute the main demo script for the agentic fleet. This allows users to see the framework in action and verify its functionality. Uses bash commands. ```bash # Set up environment export OPENAI_API_KEY=sk-... export TAVILY_API_KEY=tvly-... # Run demo python examples/dspy_agent_framework_demo.py ``` -------------------------------- ### Install and Use 'pytest-cov' for Coverage Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/troubleshooting.md Installs the 'pytest-cov' plugin using 'uv pip' to enable test coverage reporting. If 'pytest-cov' is not installed, it suggests running tests without the '--cov' argument. This addresses 'unrecognized arguments: --cov' errors during testing. ```bash # Install pytest-cov uv pip install pytest-cov # Or run without coverage uv run pytest -q tests/ ``` -------------------------------- ### Training Data JSON Example Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/dspy-optimizer.md An example of the JSON format for training data used by DSPy optimizers. It includes required fields like 'task', 'team', 'assigned_to', and 'execution_mode', along with optional fields. ```json [ { "task": "Research quantum computing applications", "team": "Researcher: Web search, citations\nAnalyst: Data analysis\nWriter: Documentation", "assigned_to": "Researcher,Analyst", "execution_mode": "sequential" }, { "task": "2+2", "team": "Researcher: Web search\nAnalyst: Math\nWriter: Docs", "assigned_to": "Analyst", "execution_mode": "delegated" } ] ``` -------------------------------- ### Basic Agent Initialization (Python) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/dspy-agent-framework-integration.md Shows the initial setup for using the agentic-fleet, including loading configuration and creating an agent factory. This serves as the entry point for interacting with the agent system. ```python from agentic_fleet.agents.coordinator import AgentFactory from agentic_fleet.utils.config_loader import load_config # Load configuration config = load_config("config/workflow_config.yaml") ``` -------------------------------- ### Build Frontend for Production (Make) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/users/frontend.md Compiles the frontend application for production deployment. The built assets are then copied to a location where the backend can serve them. ```bash make build-frontend ``` -------------------------------- ### Viewing and Processing Log Files Source: https://github.com/qredence/agentic-fleet/blob/main/docs/guides/quick-reference.md Demonstrates how to view live logs, recent log lines, and search within log files using standard Unix commands like `tail` and `grep`. Also shows how to pretty-print JSON log entries. ```bash # Live workflow log tail -f .var/logs/workflow.log # Last 50 lines tail -50 .var/logs/workflow.log # Search for specific phase grep "PHASE" .var/logs/workflow.log # View execution history tail -n 1 .var/logs/execution_history.jsonl | uv run python -m json.tool | less ``` -------------------------------- ### Example DSPy Supervisor Example Document Schema (JSON) Source: https://github.com/qredence/agentic-fleet/blob/main/docs/developers/cosmosdb_data_model.md Defines the schema for documents stored in the dspyExamples container. This includes core fields for identifying the example, user, and dataset, along with details about the task, team responsibilities, available tools, context, and labels for categorization. Cosmos-specific fields like 'id', 'exampleId', 'userId', 'dataset', and 'createdAt' are also present. ```json { "id": "ex_01HZYSAZ7V8KH3W3PM3N9DTHNQ", "exampleId": "ex_01HZYSAZ7V8KH3W3PM3N9DTHNQ", "userId": "user_123", "dataset": "supervisor_routing_examples", "task": "What is Gemini 3 Pro?", "team": "Researcher: search for 'Google Gemini 3 Pro AI model' to avoid confusion with other products\nWriter: summarize findings", "assigned_to": "Researcher,Writer", "mode": "sequential", "available_tools": "- TavilySearchTool (available to Researcher): Search the web for real-time information using Tavily. Provides accurate, up-to-date results with source citations. [Capabilities: web_search, real_time, citations]", "context": "Specific product query with potential ambiguity", "tool_requirements": ["TavilySearchTool"], "labels": { "difficulty": "medium", "category": "research" }, "createdAt": "2025-11-17T09:55:00.000Z" } ```