Skip to main content

Domain-agnostic agent framework for integrating AI agents into data pipelines

Project description

PyPI

SOTA Agent - Universal Agent Workflow Template

A generic, production-ready template for integrating AI agents into any application or data pipeline.

๐ŸŽฏ This is a TEMPLATE - Use it to build agent workflows for any domain!

Originally designed for fraud detection, this architecture template applies to any domain requiring AI agent integration:

  • ๐Ÿ”’ Fraud Detection & Risk Analysis
  • ๐Ÿ’ฌ Customer Support & Chatbots
  • ๐Ÿ“ Content Moderation & Policy Enforcement
  • ๐Ÿฅ Healthcare & Diagnosis Support
  • ๐Ÿ” Data Quality & Anomaly Detection
  • ๐Ÿ“Š Analytics & Report Generation
  • ๐Ÿค– Any Agent-Powered Workflow

๐Ÿš€ Quick Start

Installation

# Basic installation
pip install sota-agent-framework

# With optional features
pip install sota-agent-framework[mcp]          # MCP tool calling
pip install sota-agent-framework[ray]          # Distributed execution
pip install sota-agent-framework[databricks]    # Databricks integration
pip install sota-agent-framework[optimization]  # DSPy + TextGrad
pip install sota-agent-framework[all]          # Everything

# Or install from GitHub
pip install git+https://github.com/somasekar278/universal-agent-template.git

Generate Your First Project

# Generate a complete project for your domain
sota-generate --domain "your_domain" --output ./your-project

# Navigate and run
cd your-project
python examples/example_usage.py  # Works immediately! โœ…

For Contributors/Development

If you're cloning the repo to contribute:

git clone https://github.com/somasekar278/universal-agent-template.git
cd universal-agent-template
./setup.sh  # or setup.bat on Windows
python template_generator.py --domain "test"

Path 2: Integrate Into Existing Code (3 lines)

from agents import AgentRouter

router = AgentRouter.from_yaml("config/agents.yaml")  # 1. Load
result = await router.route("your_agent", input_data)  # 2. Execute
# That's it! ๐ŸŽ‰

๐Ÿ“– See Getting Started Guide for detailed 5-minute guide

Why Use This Template?

โœจ Universal Design - Works for any domain, not just fraud detection
๐Ÿ”Œ Plug-and-Play - 3 lines to integrate into existing pipelines
โš™๏ธ Configuration-Driven - Enable/disable agents via YAML, zero code changes
๐ŸŽฏ SLA-Aware - Control inline vs async execution based on your requirements
๐Ÿ—๏ธ Production-Ready - Battle-tested patterns, not toy examples
๐Ÿ“ฆ Complete Stack - Includes telemetry, evaluation, optimization, deployment
๐Ÿš€ Template Generator - Scaffold new projects in seconds

Architecture Overview

This project implements a domain-agnostic, plug-and-play agent framework that integrates into existing data pipelines with minimal code changes. The architecture leverages:

  • Ephemeral Agents: Task-specific narrative agents that spin up on-demand
  • Hot LLM Pools: Always-on GPU endpoints via Databricks Model Serving
  • Prompt Optimization: DSPy for task prompts, TextGrad for system prompts
  • Memory & Context: Lakebase for conversation history and embeddings
  • MCP Tool Calling: Standardized tool interfaces via Model Context Protocol
  • Observability: OTEL โ†’ Zerobus โ†’ Delta Lake telemetry pipeline
  • Evaluation: MLflow custom scorers and continuous feedback loops

Key Features

๐Ÿ”Œ Plug-and-Play Integration - Add to existing pipelines with 3 lines of code
โš™๏ธ Configuration-Driven - Enable/disable agents via YAML, no code changes
๐ŸŽฏ SLA-Aware Execution - Control inline vs offline based on requirements
๐Ÿ”’ Type-Safe - Pydantic schemas validate all data at runtime
๐ŸŒ ASGI Support - FastAPI endpoints, SSE streaming, async HTTP
๐Ÿ”„ Agent-to-Agent (A2A) - Event-driven agent communication via NATS/Redis (optional)
โœจ Domain-Agnostic - Works for fraud, risk, support, compliance, or any use case
๐Ÿ“ˆ Prompt Optimization - DSPy for task prompts, TextGrad for system prompts
๐Ÿ“Š Comprehensive Telemetry - All events streamed to Delta Lake via Zerobus
๐Ÿง  Memory Management - Lakebase for vector embeddings and conversation history
๐Ÿ”ง MCP Tool Integration - Standardized external tool calling
๐Ÿ“‰ MLflow Tracking - Experiment tracking, evaluation, and model registry
๐Ÿ›๏ธ Unity Catalog - Centralized prompt and model versioning
๐Ÿข Multi-Tenant Ready - Schema adapters handle any customer format

Project Structure

.
โ”œโ”€โ”€ agents/                     # ๐Ÿค– Agent framework (CORE)
โ”‚   โ”œโ”€โ”€ base.py                #    - Base agent interfaces
โ”‚   โ”œโ”€โ”€ config.py              #    - Configuration loader
โ”‚   โ”œโ”€โ”€ registry.py            #    - Agent registry + router
โ”‚   โ””โ”€โ”€ execution/             #    - Pluggable execution backends
โ”œโ”€โ”€ shared/                    # ๐Ÿ“ฆ Shared libraries
โ”‚   โ”œโ”€โ”€ schemas/               #    - Pydantic data models (type-safe)
โ”‚   โ””โ”€โ”€ adapters/              #    - Schema adaptation framework
โ”œโ”€โ”€ config/                    # โš™๏ธ  Configuration (plug-and-play)
โ”‚   โ”œโ”€โ”€ agents/                #    - Agent configurations (YAML)
โ”‚   โ””โ”€โ”€ adapters/              #    - Customer schema adapters
โ”œโ”€โ”€ services/                  # ๐Ÿš€ Deployable services
โ”œโ”€โ”€ optimization/              # ๐ŸŽ“ Prompt optimization (DSPy/TextGrad)
โ”œโ”€โ”€ memory/                    # ๐Ÿง  Lakebase integration
โ”œโ”€โ”€ orchestration/             # ๐Ÿ”„ Databricks Workflows + LangGraph
โ”œโ”€โ”€ mcp-servers/               # ๐Ÿ”ง Model Context Protocol tools
โ”œโ”€โ”€ evaluation/                # ๐Ÿ“Š MLflow scorers and metrics
โ”œโ”€โ”€ telemetry/                 # ๐Ÿ“ˆ OTEL โ†’ Zerobus โ†’ Delta
โ”œโ”€โ”€ uc-registry/               # ๐Ÿ—ƒ๏ธ  Unity Catalog integration
โ”œโ”€โ”€ data/                      # ๐Ÿ“Š Synthetic testbed
โ”œโ”€โ”€ infrastructure/            # ๐Ÿ—๏ธ  Deployment configs (DABS)
โ”œโ”€โ”€ experiments/               # ๐Ÿ”ฌ Notebooks + MLflow tracking
โ”œโ”€โ”€ tests/                     # ๐Ÿงช Unit, integration, load tests
โ””โ”€โ”€ docs/                      # ๐Ÿ“– Documentation

See Project Structure for detailed breakdown with key concepts.

Data Schemas

All data structures are defined using Pydantic models in shared/schemas/:

  • transactions.py - Transaction records and payment data
  • fraud_signals.py - Velocity, amount, location, device signals
  • contexts.py - Merchant and customer profiles
  • agent_io.py - Agent inputs, outputs, tool calls (MCP-ready)
  • evaluation.py - Evaluation records and scorer metrics
  • telemetry.py - OTEL traces for Zerobus ingestion

See shared/schemas/README.md for detailed documentation.

Quick Start (Plug-and-Play)

Add agents to your existing pipeline in 3 lines:

from agents import AgentRouter
from shared.schemas import AgentInput

# 1. Load agents from config (one line!)
router = AgentRouter.from_yaml("config/agents.yaml")

# 2. Convert your data to AgentInput (Pydantic validates!)
agent_input = AgentInput(
    request_id=record.id,
    data=YourDomainData(**record.dict()),  # Your domain-specific data
    # ... your contexts
)

# 3. Route to agent (inline or offline based on config!)
result = await router.route("your_agent", agent_input)

# That's it! Agent runs according to your config.
# No code changes to enable/disable or switch execution modes.

Configuration controls everything:

# config/agents.yaml
agents:
  your_agent:
    class: "your_package.YourAgent"
    execution_mode: "offline"  # or "inline" if SLA allows
    enabled: true              # Change to false to disable
    timeout: 30

Works for any domain: Fraud detection, risk analysis, customer support, compliance, content moderation, etc.

See Configuration System for details.


Getting Started

Prerequisites

  • Python 3.9+
  • Databricks workspace with:
    • Model Serving endpoint
    • Unity Catalog
    • Lakebase access
  • Zerobus server endpoint (for telemetry)

Installation

# Clone the repository
git clone <repo-url>
cd "SOTA Agent"

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Or install in development mode
pip install -e ".[dev]"

Configuration

# Copy example config
cp .env.example .env

# Edit .env with your Databricks credentials
# - DATABRICKS_HOST
# - DATABRICKS_TOKEN
# - MODEL_SERVING_ENDPOINT
# - UNITY_CATALOG_NAME
# - ZEROBUS_ENDPOINT

Databricks Stack

Component Technology
LLM Inference Databricks Model Serving
Orchestration LangGraph + Databricks Workflows
Tracing & Evaluation Databricks MLflow
Memory/Vector Store Lakebase
Telemetry Sink Zerobus โ†’ Delta Lake
Prompt Registry Unity Catalog
Dashboards Databricks SQL
Compute Databricks Clusters / Serverless

Development

Run Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=. --cov-report=html

# Run specific test suite
pytest tests/unit/
pytest tests/integration/

Code Quality

# Format code
black .

# Lint
ruff check .

# Type check
mypy .

Architecture Flows

Realtime Path (Low-latency)

Transaction โ†’ Event Collector โ†’ Ephemeral Narrative Agent โ†’ MCP Tool Calls โ†’ LLM Pool โ†’ Risk Narrative โ†’ Dashboard/Alerts

Async Path (Optimization)

MLflow Scorers โ†’ Evaluate High-Risk Txns โ†’ Log Metrics โ†’ DSPy/TextGrad Optimization โ†’ Update Prompts in UC โ†’ Deploy to Agents

MCP Integration

All tool calls use Model Context Protocol for standardization:

# Tool call schema (MCP-ready)
tool_call = ToolCall(
    tool_id="call_123",
    tool_name="merchant_context",
    tool_server="uc-query-server",
    arguments={"merchant_id": "mch_001"}
)

# Tool result
tool_result = ToolResult(
    tool_call_id="call_123",
    success=True,
    result=merchant_data,
    latency_ms=45.2
)

See mcp-servers/ for tool implementations.

Telemetry

All events flow through OTEL โ†’ Zerobus โ†’ Delta Lake:

  • Agent start/complete/error
  • MCP tool calls
  • LLM requests/responses
  • Stream chunks
  • Evaluation results

Query telemetry in Unity Catalog:

SELECT * FROM main.telemetry.agent_traces
WHERE transaction_id = 'txn_123'
ORDER BY timestamp DESC;

Prompt Optimization

DSPy (Task Prompts)

# Optimize reasoning pipeline
from optimization.dspy import MIPROOptimizer

optimizer = MIPROOptimizer(training_data)
optimized_prompt = optimizer.optimize(baseline_prompt)

TextGrad (System Prompts)

# Optimize system prompt with guardrails
from optimization.textgrad import SystemPromptOptimizer

optimizer = SystemPromptOptimizer(feedback_data)
optimized_system = optimizer.optimize(system_prompt)

Synthetic Data

Generate idempotent test data:

# Generate synthetic transactions
python -m data.synthetic.generate --seed 42 --count 5000

# Output: data/synthetic/raw/transactions.parquet

Contributing

  1. Create a feature branch
  2. Make changes with tests
  3. Run linters and tests
  4. Submit pull request

License

MIT

Documentation

๐ŸŽฏ Start Here

๐Ÿ“š Core Documentation

๐Ÿ› ๏ธ Tools

  • Template Generator - python template_generator.py --help
  • Example Integrations - examples/plug_and_play_integration.py

Contact

For questions, see docs/ or contact the 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

sota_agent_framework-0.1.6.tar.gz (66.3 kB view details)

Uploaded Source

Built Distribution

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

sota_agent_framework-0.1.6-py3-none-any.whl (74.3 kB view details)

Uploaded Python 3

File details

Details for the file sota_agent_framework-0.1.6.tar.gz.

File metadata

  • Download URL: sota_agent_framework-0.1.6.tar.gz
  • Upload date:
  • Size: 66.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for sota_agent_framework-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d2776e95bc63689659ab08fd05b4e5901493b617c69a987e31901ffe84534d81
MD5 4071819f7924b1a47c37a5845201b3e2
BLAKE2b-256 f2eb8efeee71eb8634d623e857333a8499a19f50b5b8d6ebf676d53c49b010e7

See more details on using hashes here.

File details

Details for the file sota_agent_framework-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for sota_agent_framework-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 02544861094b550009bf76b103e65b93bd510c340ff1239b641ba1f42da1c78d
MD5 00614fadd79c3635b2a12e4875fde0f9
BLAKE2b-256 e034434eb3c05868935f37d86ae402820cefd7db693723d5bfb56ede0a083c63

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