Reactive AI Agent Framework

by tylerjrbuell

Not rated
GitHub

About

A reactive AI agent framework for creating agents that use tools to perform tasks, with support for multiple LLM providers and MCP servers.

Details

Author
tylerjrbuell
Categories
Developer Tools, AI, Automation

Setup

Install Reactive AI Agent Framework in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/tylerjrbuell/reactive-agents

Follow the installation instructions in the repository README, then restart your MCP client.

A reactive AI agent framework for creating agents that use tools to perform tasks, with support for multiple LLM providers and MCP servers.

An Elegant, Powerful, and Flexible Framework for Building Reactive AI Agents

🏁 Quick Start•📖 Documentation•🎯 Features•🛠️ Installation•💡 Examples•🤝 Contributing

Reactive Agentsis a cutting-edge AI agent framework that makes building intelligent, autonomous agents as simple as Laravel makes web development. With its elegant builder pattern, comprehensive tooling ecosystem, and production-ready architecture, you can create sophisticated AI agents that think, plan, execute, and adapt.

🔎 Definition — "Reactive" (adj.)

- Promptly responsive to change or external stimuli; able to sense, interpret, and act in real time. - Architected for rapid feedback loops, context-aware adaptation, and low-latency decision-making.

Reactive agentsturn sensing into instant value — they detect shifts, call the right tools, and adjust plans on the fly. That means faster answers, fewer failures, better user experiences, and systems that scale gracefully under real-world uncertainty. In short: reactive = faster, smarter, and more reliable AI that drives reliable outcomes now.

- 🔬Research Automation- Intelligent web research and data analysis
- 📊Business Intelligence- Automated reporting and decision support
- 🛠️DevOps & Infrastructure- Intelligent monitoring and automation
- 💬Customer Support- Smart assistants with tool integration
- 📈Data Processing- Complex workflows with multiple data sources
- 🎮Interactive Applications- AI-powered user experiences
- 🤖Multi-Agent Systems- Orchestrated AI teams solving complex problems
- ⚙️Automation & Scripting- Intelligent task automation

Composable strategies with component-based architecture:Strategies are modular and pluggable, built from discrete components (planners, executors, reflectors, and goal evaluators) that you can mix-and-match to craft custom reasoning flows.

- Modular components— planners, executors, reflectors, and evaluators are independent and swappable.
- Pluggable strategies— implementBaseReasoningStrategyand register withStrategyManagerto add new strategies.
- Testable & reusable— small, well-typed components make unit testing and reuse simple.
- Designed for composition— use the Adaptive strategy or compose multiple strategies to handle complex, dynamic tasks.

- Reactive: Fast, direct problem-solving
- Plan-Execute-Reflect: Structured approach for complex tasks
- Reflect-Decide-Act: Adaptive strategy for dynamic environments
- Adaptive: AI-driven strategy selection based on task complexity

- Custom Python Toolswith@tool()decorator
- Model Context Protocol (MCP)integration
- Pre-built Tools: Web search, file operations, databases, and more
- Tool Compositionand validation system

- Event-Driven Designwith real-time monitoring
- Robust Error Recoverywith intelligent retry mechanisms
- Memory Managementwith vector storage and persistence
- Performance Monitoringwith detailed metrics and scoring
- Context Optimizationwith adaptive pruning strategies

- Multi-Agent Orchestrationwith dependency management
- A2A Communication(Agent-to-Agent) protocols
- Parallel Executionand synchronization
- Workflow Templatesfor common patterns

- Fluent Builder APIwith sensible defaults
- Type Safetywith Pydantic models throughout
- Comprehensive Loggingwith structured events
- 🚧 Plugin Systemfor extensibility
- Hot-reloadingfor development workflows

import asyncio from reactive_agents import ReactiveAgentBuilder, ReasoningStrategies async def main(): # Create an intelligent research agent agent = await ( ReactiveAgentBuilder() .with_name("Research Assistant") .with_model("ollama:llama3") # or "openai:gpt-4", "anthropic:claude-3-sonnet" .with_tools(["brave-search", "time"]) # Auto-detects MCP tools vs custom tools .with_instructions("Research thoroughly and provide detailed analysis") .with_reasoning_strategy(ReasoningStrategies.REACTIVE) .build() ) async with agent: result = await agent.run( "What are the latest developments in quantum computing this week?" ) print(result.final_answer) print(f"Status: {result.status_message}") asyncio.run(main())

That's it! You now have a fully functional AI agent that can search the web, analyze information, and provide comprehensive answers.

Reactive Agents uses acomponent-based architecturewhere each agent is composed of specialized, swappable components:

# The agent automatically manages these components: ExecutionEngine # Coordinates task execution and strategy selection ReasoningEngine # Handles different reasoning strategies ToolManager # Manages tool registration and execution MemoryManager # Handles persistent storage and retrieval EventBus # Coordinates real-time event communication MetricsManager # Tracks performance and provides insights

Choose the right strategy for your task:

from reactive_agents import ReactiveAgentBuilder, ReasoningStrategies # Reactive: Fast, direct execution agent = await ReactiveAgentBuilder().with_reasoning_strategy(ReasoningStrategies.REACTIVE).build() # Plan-Execute-Reflect: Structured approach agent = await ReactiveAgentBuilder().with_reasoning_strategy(ReasoningStrategies.PLAN_EXECUTE_REFLECT).build() # Adaptive: AI selects the best strategy agent = await ReactiveAgentBuilder().with_reasoning_strategy(ReasoningStrategies.ADAPTIVE).build() # Default

Multiple ways to add capabilities to your agents:

from reactive_agents import tool # 1. Custom Python functions with @tool decorator @tool() async def get_weather(city: str) -> str: """Get weather information for a city.""" return f"Weather in {city}: Sunny, 72°F" # 2. Mixed tools - auto-detection! # Strings = MCP servers, Functions = custom tools .with_tools([get_weather, "brave-search", "time", "filesystem"]) # 3. Or use explicit methods .with_mcp_tools(["brave-search", "sqlite"]) .with_custom_tools([get_weather])
from reactive_agents import ReactiveAgentBuilder, tool, ReasoningStrategies @tool() async def analyze_trends(data: str) -> str: """Analyze data trends and patterns.""" # Your analysis logic here return f"Trend analysis: {data}" async def create_research_agent(): return await ( ReactiveAgentBuilder() .with_name("Research Pro") .with_model("openai:gpt-4") .with_reasoning_strategy(ReasoningStrategies.PLAN_EXECUTE_REFLECT) .with_tools([analyze_trends, "brave-search", "time", "filesystem"]) .with_instructions(""" You are a professional research analyst. Always: 1. Search for the most recent information 2. Cross-reference multiple sources 3. Provide data-driven insights 4. Save important findings to files """) .with_max_iterations(15) .build() )
async def create_bi_agent(): return await ( ReactiveAgentBuilder() .with_name("BI Analyst") .with_model("anthropic:claude-3-sonnet") .with_tools(["sqlite", "filesystem", "brave-search"]) .with_vector_memory("bi_agent_memory") # Enable persistent vector memory .with_instructions(""" You are a business intelligence analyst. Create comprehensive reports with data visualizations and actionable insights. """) .with_response_format(""" ## Executive Summary [Key findings and recommendations] ## Data Analysis [Detailed analysis with charts/tables] ## Recommendations [Specific, actionable next steps] """) .build() )

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.