Skip to content

Repository files navigation

🤖 Multi-Agent AI Router

Python 3.9+TypeScriptDockerLicense: MIT

Modular AI agent platform with multi-provider LLM support.

📚 This is a demo project for learning and exploration purposes.

🇷🇺 Русская версия


🎯 What Makes It Cool

FeatureDescription
🔌 Plug & Play LLMsSwitch between Gemini, OpenRouter, or any OpenAI-compatible API
🧩 Modular AgentsEach agent is independent — add your own in minutes
🛠️ Real Tool ExecutionAgents don't just chat — they do things: search, code, analyze
📊 Live Crypto DataBinance API integration with real-time prices, orderbook, trades
🐳 Docker SandboxCode execution in isolated containers — safe and reproducible
⚡ Native Tool CallingGemini 2.5 Pro uses native function calling for reliable execution

🤖 Agents

🔍 Dialog Agent

Intelligent conversational agent with web capabilities

  • Smart Search — Multi-source web search with result aggregation
  • Page Reading — Extract and summarize content from any URL
  • Context Awareness — Maintains conversation history and session state

🧠 Coder Agent

Full-featured coding assistant that actually executes code

Coder Agent

  • File Operations — Create, read, list files in isolated workspace
  • Code Execution — Run Python in sandboxed Docker environment
  • Multi-File Projects — Import between files, build complete projects
  • Native Tool Calling — Gemini 2.5 Pro uses native function calling
  • Tool Support Indicator — ✅/⚠️ shows which models support native tools

Example:

User: Calculate fibonacci sequence up to 100
Agent: I'll create and run a Python script for you.
[Creates fibonacci.py → Executes → Returns result]
Output: [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

📊 Crypto Analyst Agent v2.0

Professional cryptocurrency analyzer with real-time Binance data

Crypto Analyst

Real-time data from Binance API:

  • 💰 Price & Candles — Current price, 24h change, multi-timeframe data
  • 📈 12 Technical Indicators — RSI, MACD, EMA, Bollinger, StochRSI, ADX, ATR, VWAP, OBV, Ichimoku, SuperTrend, CMF
  • 📊 Orderbook Analysis — Deltas at 7 levels (1.5%, 3%, 5%, 15%, 30%, 60%, 90%)
  • 🔄 Trade Flow — Buy/sell pressure, whale activity, trade velocity, size distribution
  • 📉 Futures Data — Funding Rate, Open Interest, Long/Short Ratio
  • 🎯 Smart Money Concepts — FVG, Order Blocks, Market Structure (HH/HL/LL/LH), Liquidity Zones
  • 🗓️ Multi-Timeframe — Short/Medium/Long-term analysis (3 horizons)
  • 📊 Volume Analysis — Volume Delta, Relative Volume, Volume Profile (POC, VAH, VAL)
  • 😨 Market Context — Fear & Greed Index, total market cap

Modular Queries:

"analyze BTC" → Full analysis
"indicators ETH" → Technical indicators only
"orderbook SOL" → Orderbook analysis
"smc BTC" → Smart Money Concepts
"sentiment ETH" → Fear&Greed + Funding Rate
"volume SOL" → Volume analysis
"mtf BTC" → Multi-timeframe

Example Analysis:

📉 BTC/USDT Analysis | 2025-12-07

Price: $89,690.73 (-0.03% 24h)

MTF Signal: Bearish (Short: bullish, Medium: mixed, Long: bearish)

Order Flow: 82.6% buys — BUT whales selling (6 whale sells, 0 buys)

Smart Money: Downtrend structure (2 LH, 2 LL), 3 bearish FVG targets

Futures: L/S Ratio 2.17 (longs overloaded — squeeze risk)

Verdict: SELL — Retail buying into whale distribution


🏗️ Architecture

┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Frontend │────▶│ FastAPI │────▶│ LLM Provider │
│ (React) │ │ (routes) │ │ Gemini/OpenRouter│
└─────────────┘ └──────────────┘ └─────────────────┘
│
┌──────┴──────┐
▼ ▼
┌─────────┐ ┌─────────┐
│ Agent │ │ Session │
│ Dialog/ │ │ Manager │
│ Coder/ │ └─────────┘
│ Crypto │
└────┬────┘
▼
┌─────────┐
│ Tools │
│ search/ │
│ files/ │
│ code/ │
│ crypto │
└─────────┘

🔐 Security

This project implements multiple layers of security for code execution:

LayerProtection
🐳 Sandbox ContainerCode runs in isolated Docker container with no network access
📁 Path ValidationAll file operations restricted to session workspace
⏱️ Resource LimitsCPU, memory, and timeout constraints
👤 Non-root UserSandbox runs as unprivileged user

⚠️Disclaimer: This is a demonstration project. For production use, consider additional hardening (gVisor, Firecracker, etc.)

⚠️ Known Limitations

IssueDescriptionStatus
Sandbox FallbackIf sandbox is unavailable, code may execute locally⚠️ TODO: Add explicit flag
Context WindowLong conversations may exceed token limits (no RAG)Demo scope
Regex JSON FallbackLegacy fallback for non-native tool calling modelsUse Gemini 2.5 Pro

🚀 Quick Start

git clone https://github.com/nssanta/Multi-Agent-Router.git
cd Multi-Agent-Router
cp .env.example .env
# Add your API keys to .env
docker compose up --build

Open: http://localhost:3000


⚙️ Configuration

# RequiredGEMINI_API_KEY=your_gemini_keyOPENROUTER_API_KEY=your_openrouter_key# OptionalLLM_PROVIDER=gemini# or openrouterLLM_MODEL=gemini-2.5-pro# default model

🔧 Extending the System

Add a New Agent

# backend/agents/my_agent/agent.pydefcreate_my_agent(llm_provider, session_path):
returnAgent(
name="my_agent",
llm_provider=llm_provider,
instruction="Your custom prompt",
tool_definitions=[...],
)

Add a New Tool

# backend/tools/my_tool.pydefmy_tool(param: str) ->str:
"""Tool description for LLM"""returnf"Result: {param}"

📁 Project Structure

backend/
├── agents/ # Dialog, Coder, Crypto agents
│ ├── dialog/ # Conversational agent
│ ├── coder/ # Code execution agent
│ └── crypto/ # Cryptocurrency analyst
├── api/ # FastAPI routes
├── core/ # LLM providers, sessions, executor
└── tools/ # Agent tools
├── web/ # Search, page reader
└── crypto/ # Binance API, indicators
frontend/
├── src/components/ # React components
└── src/services/ # API client

Full technical documentation: TECHNICAL_DOCS.md


📄 License

MIT

About

A modular multi-agent framework and UI for orchestration between local and remote LLMs (Gemini, OpenRouter) with advanced tool calling capabilities.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages