Skip to main content

Plug-and-play agentic framework with multi-backend, guardrails, and Azure AD support

Project description

RapidAgent

Plug-and-play agentic framework with multi-backend support, native multi-LLM support, Azure OpenAI + Azure AD auth, and built-in security guardrails (PII/PHI redaction, prompt injection prevention, tool authorization).

Installation

pip install rapidagent                  # Core (Direct backend — all Python 3.10+)
pip install rapidagent[langgraph]       # + LangGraph backend
pip install rapidagent[azure]           # + Azure AD auth
pip install rapidagent[anthropic]       # + Anthropic Claude SDK
pip install rapidagent[google]          # + Google Gemini SDK
pip install rapidagent[litellm]         # + LiteLLM (100+ providers — see note below)
pip install rapidagent[cli]             # + CLI commands
pip install rapidagent[all]             # Everything

Quickstart

from rapidagent import RapidAgent, tool

@tool
def get_weather(city: str) -> str:
    """Get current weather."""
    return f"Weather in {city}: 72F, sunny"

agent = RapidAgent(model="openai:gpt-4o-mini", tools=[get_weather])
result = agent.invoke("Weather in SF?")
print(result["content"])

Or from YAML:

name: my-agent
model: openai:gpt-4o-mini
system_prompt: "You are helpful."
tools:
  - name: current_time
    description: Get the current time
    function: rapidagent.tools.builtins:current_time
agent = RapidAgent.from_config("agent.yaml")

LLM Provider Support

RapidAgent supports 40+ LLM providers natively using their official SDKs. No single point of compromise.

Native providers (official SDKs — recommended)

Provider Model String SDK Auth Env Var
OpenAI openai:gpt-4o-mini openai (core) OPENAI_API_KEY
Azure OpenAI (dict config) openai (core) AZURE_OPENAI_ENDPOINT
Anthropic Claude anthropic:claude-3-5-sonnet-latest anthropic ANTHROPIC_API_KEY
Google Gemini google:gemini-2.0-flash google-genai GEMINI_API_KEY

OpenAI-compatible providers (no extra SDKs)

Uses the same openai SDK (already installed) with a custom base_url. Zero additional dependencies, zero additional risk.

Provider Config
Groq provider: openai_compatible, endpoint: https://api.groq.com/openai/v1
Together AI provider: openai_compatible, endpoint: https://api.together.xyz/v1
Ollama (local) provider: openai_compatible, endpoint: http://localhost:11434/v1
OpenRouter provider: openai_compatible, endpoint: https://openrouter.ai/api/v1
DeepSeek provider: openai_compatible, endpoint: https://api.deepseek.com
Perplexity provider: openai_compatible, endpoint: https://api.perplexity.ai
Fireworks provider: openai_compatible, endpoint: https://api.fireworks.ai/inference/v1
+ 30 more Any OpenAI-compatible endpoint
model:
  provider: openai_compatible
  model: llama-3.3-70b-versatile
  endpoint: https://api.groq.com/openai/v1
agent = RapidAgent(model="anthropic:claude-3-5-sonnet-latest")
agent = RapidAgent(model="google:gemini-2.0-flash")

LiteLLM (explicit opt-in — for providers not covered above)

LiteLLM can route through 100+ providers via a single package. Has had past security incidents (supply-chain attacks exfiltrating credentials). Use only if your provider isn't covered by the native providers above.

# Explicit opt-in — only works if you set this
agent = RapidAgent(model="litellm:bedrock/anthropic.claude-v2")

Installing rapidagent[litellm] shows a runtime warning every time it's used.


Multi-Backend Architecture

Python Default Backend Features
3.10 – 3.13 LangGraph Full durability, checkpointing, HITL, multi-agent, LangSmith.
3.14+ Direct Pure Python ReAct loop. Tools, streaming, memory, checkpointing included.
agent = RapidAgent(model="openai:gpt-4o-mini", backend="direct")

Security Guardrails

Six built-in guardrails + audit trail. Enable via YAML or code.

guardrails:
  input_filter:
    enabled: true
    block_patterns:
      - "ignore all instructions"
  tool_auth:
    enabled: true
    allowlist: [get_weather, current_time]
    denylist: [rm.*, exec.*]
  pii:
    enabled: true
    patterns:
      email: redact
      ssn: block
  phi:
    enabled: false           # HIPAA — opt-in
    include_pii: true
  output_filter:
    enabled: true
  audit_log:
    enabled: true
    path: ./audit/audit.jsonl

What each guardrail does

Guardrail Hook Points Default
InputGuardrail Input → LLM Blocks prompt injection, jailbreaks
ToolAuthGuardrail Before tool exec Denylist: exec, eval, rm, subprocess, drop table, shutdown
PIIScanner All I/O points Redacts email, phone, API keys. Blocks 9-digit SSNs
PHIScanner Same as PII 14 HIPAA patterns: MRN, Medicare IDs, VINs, IPs, health dates. Opt-in
OutputGuardrail Response → user Blocks hate speech, violent content
RateLimiter Input Sliding window (100 req / 60s)

Every decision logged to JSONL audit file. Supports custom sinks (Datadog, Splunk).

agent = RapidAgent(
    model="openai:gpt-4o-mini",
    guardrails={
        "input_filter": {"block_patterns": ["BADWORD"]},
        "phi": {"enabled": True},
    },
)

CLI

rapidagent doctor              # Diagnose environment
rapidagent init my-project     # Interactive setup with prereq checks
rapidagent new my-project      # Quick scaffold
rapidagent run agent.yaml      # Interactive chat
rapidagent ask agent.yaml "Hi" # Single question
rapidagent list                # Available blueprints

Features

Feature Description
Multi-backend LangGraph (3.10-3.13) or Direct (3.14+) — auto-selected
40+ LLM providers OpenAI, Anthropic, Google, Groq, Together, Ollama, OpenRouter, DeepSeek, ...
Azure OpenAI + AD API key, service principal, or DefaultAzureCredential
Security guardrails PII/PHI redaction, prompt injection, tool auth, rate limiter, audit trail
Crash recovery SQLite checkpointing after every LLM + tool step
Structured output Pass any Pydantic model for JSON output
Token/cost tracking Token counts and cost per invocation
Retry with backoff Exponential backoff on API errors (rate limits, timeouts)
@tool decorator Auto-generates LLM tool schemas from type hints
Multi-agent Supervisor/worker, swarm, and sequential patterns
CLI Scaffold, init, doctor, run, chat
128 tests Completely covered

Configuration

name: customer-support
model:
  provider: azure_openai
  deployment: gpt-4o
  endpoint: https://my-resource.openai.azure.com
  auth_type: default_credential
backend: direct
system_prompt: "You are a helpful support agent."
max_iterations: 10

tools:
  - name: lookup_order
    description: Look up an order
    function: tools.orders:lookup_order

guardrails:
  input_filter:
    enabled: true
  tool_auth:
    enabled: true
  pii:
    enabled: true
  audit_log:
    path: ./audit/audit.jsonl

human_in_the_loop:
  enabled: true
  require_approval_for:
    - process_refund

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

rapidagent-1.0.0.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

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

rapidagent-1.0.0-py3-none-any.whl (64.4 kB view details)

Uploaded Python 3

File details

Details for the file rapidagent-1.0.0.tar.gz.

File metadata

  • Download URL: rapidagent-1.0.0.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for rapidagent-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fd4b79b6cd9906e4c6681a3b003462b1bfafbb8d79ceca1c2b72c8ec099908a7
MD5 1caf0d6ec1cf739287b2771a15972926
BLAKE2b-256 14614acc1542a35563ef4d2ccc55ab6872459090e9b8feda036b4e92ef815cad

See more details on using hashes here.

File details

Details for the file rapidagent-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: rapidagent-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 64.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for rapidagent-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eabb1b5f1510e1576c1fe598234c098a5e83de766c32e802cdd02f4ea5548cd1
MD5 48974730a4b1b5a095e5c59e55f7f4ef
BLAKE2b-256 26eb16171f29a1231d207ef4ddf1c9281cea7a8331fd186342cb23d9d84daacc

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