Skip to content

DemonDamon/AgenticX

Repository files navigation

AgenticX: Unified Multi-Agent Framework


Language / 语言: English | 中文


Vision

AgenticX aims to create a unified, scalable, production-ready multi-agent application development framework, empowering developers to build everything from simple automation assistants to complex collaborative intelligent agent systems.

System Architecture

AgenticX System Architecture — 5-tier overview covering UI, Studio Runtime, Core Framework, Platform Services, and Domain Extensions

The framework is organized into 5 tiers: User Interface (Desktop / CLI / SDK) → Studio Runtime (Session Manager, Meta-Agent, Team Manager, Avatar & Group Chat) → Core Framework (Orchestration, Execution, Agent, Memory, Tools, LLM Providers, Hooks) → Platform Services (Observability, Protocols, Security, Storage) → Domain Extensions (GUI Agent, Knowledge & GraphRAG, AgentKit Integration).

Core Features

Core Framework

  • Agent Core: Agent execution engine based on 12-Factor Agents methodology, with Meta-Agent CEO dispatcher, agent team management, think-act loop, event-driven architecture, self-repair, and overflow recovery
  • Orchestration Engine: Graph-based workflow engine + Flow system with decorators, execution plans, conditional routing, and parallel execution
  • Tool System: Unified tool interface with function decorators, MCP Hub (multi-server aggregation), remote tools v2, OpenAPI toolset, sandbox tools, skill bundles, and document routers
  • Memory System: Hierarchical memory (core / episodic / semantic), Mem0 deep integration, workspace memory, short-term memory, memory decay, hybrid search, compaction flush, MCP memory, and memory intelligence engine
  • LLM Providers: 15+ providers — OpenAI, Anthropic, Ollama, Gemini, Kimi/Moonshot, MiniMax, Ark/VolcEngine, Zhipu, Qianfan, Bailian/Dashscope — with response caching, transcript sanitizer, and failover routing
  • Communication Protocols: A2A inter-agent protocol (client / server / AgentCard / skill-as-tool), MCP resource access protocol
  • Task Validation: Pydantic-based output parsing, auto-repair, and guiderails

Avatar & Team Collaboration

  • Avatar System: Avatar registry (CRUD), group chat with multiple routing strategies (user-directed / meta-routed / round-robin)
  • Meta-Agent Runtime: CEO dispatcher with dynamic sub-agent orchestration, team management with concurrency limits, archived snapshots, and session isolation
  • Collaboration Patterns: Delegation, role-playing, conversation management, task locks, and collaboration metrics

Knowledge & Retrieval

  • Knowledge Base: Document processing pipeline with chunkers, readers, extractors, and graph builders (GraphRAG)
  • Retrieval System: Vector retriever, BM25 retriever, graph retriever, hybrid retriever, auto-retriever, and reranker
  • Embeddings: OpenAI, Bailian, SiliconFlow, LiteLLM, with smart routing

Developer Experience

  • CLI Tools (agx): serve, studio, loop, run, project, deploy, codegen, docs, skills, hooks, debug, scaffold, and config management
  • Web UI (Studio): FastAPI-based management server with session management, real-time WebSocket, and protocol support
  • Desktop App: Electron + React + Zustand + Vite, Pro/Lite dual mode (multi-pane / single-pane), command palette, settings panel, avatar sidebar, sub-agent panel, session history, and workspace panel

Enterprise Security

  • Safety Layer: Leak detection, input sanitizer, advanced injection detector, policy engine (rules / severity / actions), input validator, sandbox policy, and audit logging
  • Sandbox: Docker, Microsandbox, and Subprocess backends; Jupyter kernel manager, stateful code interpreter, sandbox templates
  • Session Security: Database-backed sessions, write locks, in-memory sessions

Observability & Evaluation

  • Monitoring: Complete callback system, real-time metrics, Prometheus/OpenTelemetry integration, trajectory analysis, span tree, WebSocket streaming
  • Evaluation Framework: EvalSet-based evaluation, LLM judge, composite judge, span evaluator, trajectory matcher, trace-to-evalset converter
  • Data Export: Multi-format export (JSON / CSV / Prometheus), time series analysis

Storage Layer

  • Key-Value: SQLite, Redis, PostgreSQL, MongoDB, InMemory
  • Vector: Milvus, Qdrant, Chroma, Faiss, PgVector, Pinecone, Weaviate
  • Graph: Neo4j, Nebula
  • Object: S3, GCS, Azure
  • Unified Manager: Storage router, migration support, unified storage interface

GUI Agent / Embodiment

  • Action Reflection: A/B/C result classification with heuristic and VLM reflection modes
  • Stuck Detection & Recovery: Consecutive failure detection, repeat pattern recognition, intelligent recovery strategy recommendation
  • Action Caching: Action-tree-based trajectory caching with exact and fuzzy matching (up to 9x speedup)
  • REACT Output Parsing: Standardized REACT format parsing with compact action schema
  • Device-Cloud Routing: Dynamic selection of on-device or cloud model based on task complexity and sensitivity
  • DAG Task Verification: DAG-based multi-path task verification with dual semantic dependencies
  • Human-in-the-Loop: Collector, component, and event model for human oversight

Quick Start

Installation

Option 1: Install from PyPI (Recommended)

# Core install (lightweight, no torch, installs in seconds)
pip install agenticx

# Install optional features as needed
pip install "agenticx[memory]"      # Memory: mem0, chromadb, qdrant, redis, milvus
pip install "agenticx[document]"    # Document processing: PDF, Word, PPT parsing
pip install "agenticx[graph]"       # Knowledge graph: networkx, neo4j, community detection
pip install "agenticx[llm]"         # Extra LLMs: anthropic, ollama
pip install "agenticx[monitoring]"  # Observability: prometheus, opentelemetry
pip install "agenticx[mcp]"         # MCP protocol
pip install "agenticx[database]"    # Database backends: postgres, SQLAlchemy
pip install "agenticx[data]"        # Data analysis: pandas, scikit-learn, matplotlib
pip install "agenticx[ocr]"         # OCR (pulls in torch ~2GB): easyocr
pip install "agenticx[volcengine]"  # Volcengine AgentKit
pip install "agenticx[all]"         # Everything

Tip: The core package includes only ~27 lightweight dependencies and installs in seconds. Heavy dependencies (torch, pandas, etc.) are optional extras - install only what you need.

Option 2: Install from Source (Development)

# Clone repository
git clone https://github.com/DemonDamon/AgenticX.git
cd AgenticX

# Using uv (recommended, 10-100x faster than pip)
pip install uv
uv pip install -e .                  # Core install
uv pip install -e ".[memory,graph]"  # Add optional features
uv pip install -e ".[all]"           # Everything
uv pip install -e ".[dev]"           # Development tools

# Or using pip
pip install -e .
pip install -e ".[all]"

Environment Setup

# Set environment variables
export OPENAI_API_KEY="your-api-key"
export ANTHROPIC_API_KEY="your-api-key"  # Optional

Complete Installation Guide: For system dependencies (antiword, tesseract) and advanced document processing features, see INSTALL.md

CLI Quick Start

After installation, the agx command-line tool is available:

# View version
agx --version

# Create a new project
agx project create my-agent --template basic

# Start the API server
agx serve --port 8000

# Parse documents (PDF/PPT/Word etc.)
agx mineru parse report.pdf --output ./parsed

Full CLI Reference: See docs/cli.md for complete command documentation.

Create Your First Agent

from agenticx import Agent, Task, AgentExecutor
from agenticx.llms import OpenAIProvider

# Create agent
agent = Agent(
    id="data-analyst",
    name="Data Analyst",
    role="Data Analysis Expert", 
    goal="Help users analyze and understand data",
    organization_id="my-org"
)

# Create task
task = Task(
    id="analysis-task",
    description="Analyze sales data trends",
    expected_output="Detailed analysis report"
)

# Configure LLM
llm = OpenAIProvider(model="gpt-4")

# Execute task
executor = AgentExecutor(agent=agent, llm=llm)
result = executor.run(task)
print(result)

Tool Usage Example

from agenticx.tools import tool

@tool
def calculate_sum(x: int, y: int) -> int:
    """Calculate the sum of two numbers"""
    return x + y

@tool  
def search_web(query: str) -> str:
    """Search web information"""
    return f"Search results: {query}"

# Agents will automatically invoke these tools

Complete Examples

We provide rich examples demonstrating various framework capabilities:

Agent Core (M5)

Single Agent Example

# Basic agent usage
python examples/m5_agent_demo.py
  • Demonstrates basic agent creation and execution
  • Tool invocation and error handling
  • Event-driven execution flow

Multi-Agent Collaboration

# Multi-agent collaboration example
python examples/m5_multi_agent_demo.py
  • Multi-agent collaboration patterns
  • Task distribution and result aggregation
  • Inter-agent communication

Orchestration & Validation (M6 & M7)

Simple Workflow

# Basic workflow orchestration
python examples/m6_m7_simple_demo.py
  • Workflow creation and execution
  • Task output parsing and validation
  • Conditional routing and error handling

Complex Workflow

# Complex workflow orchestration
python examples/m6_m7_comprehensive_demo.py
  • Complex workflow graph structures
  • Parallel execution and conditional branching
  • Complete lifecycle management

Agent Communication (M8)

A2A Protocol Demo

# Inter-agent communication protocol
python examples/m8_a2a_demo.py
  • Agent-to-Agent communication protocol
  • Distributed agent systems
  • Service discovery and skill invocation

Observability Monitoring (M9)

Complete Monitoring Demo

# Observability module demo
python examples/m9_observability_demo.py
  • Real-time performance monitoring
  • Execution trajectory analysis
  • Failure analysis and recovery recommendations
  • Data export and report generation

Memory System

Basic Memory Usage

# Memory system example
python examples/memory_example.py
  • Long-term memory storage and retrieval
  • Context memory management

Healthcare Scenario

# Healthcare memory scenario
python examples/mem0_healthcare_example.py  
  • Medical knowledge memory and application
  • Personalized patient information management

Human-in-the-Loop

Human Intervention Flow

# Human-in-the-loop example
python examples/human_in_the_loop_example.py
  • Human approval workflows
  • Human-machine collaboration patterns
  • Risk control mechanisms

Detailed documentation: examples/README_HITL.md

LLM Integration

Chatbot

# LLM chat example
python examples/llm_chat_example.py
  • Multi-model support demonstration
  • Streaming response handling
  • Cost control and monitoring

Security Sandbox

Code Execution Sandbox

# Micro-sandbox example
python examples/microsandbox_example.py
  • Secure code execution environment
  • Resource limits and isolation

Technical blog: examples/microsandbox_blog.md

Intent Recognition Service

Intelligent Intent Recognition System

# Intent recognition service example
python examples/agenticx-for-intent-recognition/main.py

A production-grade, layered intent recognition service built entirely on the AgenticX framework, demonstrating real-world usage of Agents, Workflows, Tools, and Storage systems.

Architecture:

  • Agent Layer: Hierarchical agent design — a base IntentRecognitionAgent (LLM-powered) with specialized agents (GeneralIntentAgent, SearchIntentAgent, FunctionIntentAgent) for fine-grained classification
  • Workflow Engine: Pipeline-based orchestration — preprocessing → intent classification → entity extraction → rule matching → post-processing; plus dedicated workflows for each intent type
  • Tool System: Hybrid entity extraction (UIE + LLM + Rule extractors with confidence-weighted fusion), regex/full-text matching, and a full post-processing suite (confidence adjustment, conflict resolution, entity optimization, intent refinement)
  • API Gateway: Async service layer with rate limiting, concurrent control, batch processing, health checks, and performance metrics
  • Storage: SQLite-backed data persistence for training data management via UnifiedStorageManager
  • Data Models: Pydantic-based type-safe data contracts for API requests/responses and domain objects

Key capabilities:

  • Three-tier Intent Classification: General dialogue (greetings, chitchat), information search (factual/how-to/comparison queries), and function/tool invocation
  • Hybrid Entity Extraction: Combines UIE models, LLM, and rule-based extractors with intelligent fusion strategies
  • Full Post-processing Pipeline: Confidence adjustment, conflict resolution, entity optimization, and intent refinement
  • Extensible Design: Add new intent types by simply creating a new agent and workflow — zero changes to existing code

See: examples/agenticx-for-intent-recognition/

GUI Agent / Embodiment (M16)

GUI Automation Agent

# GUI Agent example
python examples/agenticx-for-guiagent/AgenticX-GUIAgent/main.py
  • Complete GUI automation framework with human-aligned learning
  • Action reflection (A/B/C classification) and stuck detection
  • Action caching system for performance optimization
  • REACT output parsing and compact action schema
  • Device-Cloud routing for intelligent model selection
  • DAG-based task verification

Key capabilities:

  • Action Reflection: Automatic action result classification (success/wrong_state/no_change)
  • Stuck Detection: Continuous failure detection and recovery strategy recommendation
  • Action Caching: Trajectory caching with exact and fuzzy matching (up to 9x speedup)
  • REACT Parsing: Standardized REACT format output parsing
  • Smart Routing: Dynamic device-cloud model selection based on task complexity and sensitivity
  • DAG Verification: Multi-path task verification with dual-semantic dependencies

See: examples/agenticx-for-guiagent/

More Application Examples

Project Description Path
Agent Skills Skill discovery, matching, and SOP-driven skill execution for agents examples/agenticx-for-agent-skills/
AgentKit Volcengine AgentKit integration with Docker-ready agent deployment examples/agenticx-for-agentkit/
ChatBI Conversational BI — natural language to data insights examples/agenticx-for-chatbi/
Deep Research Multi-source deep research and report generation examples/agenticx-for-deepresearch/
Doc Parser Intelligent document parsing (PDF, Word, PPT) examples/agenticx-for-docparser/
Finance Financial news hunting and analysis examples/agenticx-for-finance/
Future Prediction Predictive analysis and forecasting examples/agenticx-for-future-prediction/
GraphRAG Knowledge graph-enhanced retrieval-augmented generation examples/agenticx-for-graphrag/
Math Modeling Mathematical modeling assistant examples/agenticx-for-math-modeling/
Model Architecture Discovery Automated model architecture search and discovery examples/agenticx-for-modelarch-discovery/
Query Optimizer SQL/query optimization agent examples/agenticx-for-queryoptimizer/
Sandbox Secure code execution sandbox examples/agenticx-for-sandbox/
Spec Coding Specification-driven code generation examples/agenticx-for-spec-coding/
Vibe Coding AI-assisted creative/vibe coding examples/agenticx-for-vibecoding/

Technical Architecture

graph TD
    subgraph "User Interface Layer"
        Desktop["Desktop App (Electron + React)"]
        CLI["CLI (agx serve / loop / run / project)"]
        SDK[Python SDK]
    end

    subgraph "Studio Runtime Layer"
        StudioServer["Studio Server (FastAPI)"]
        SessionMgr[Session Manager]
        MetaAgent["Meta-Agent (CEO Dispatcher)"]
        TeamMgr[Agent Team Manager]
        AvatarSys["Avatar & Group Chat"]
    end

    subgraph "Core Framework Layer"
        subgraph "Orchestration"
            WorkflowEngine[Workflow Engine]
            Flow["Flow System"]
        end
        subgraph "Execution"
            AgentRuntime["Agent Runtime (Studio)"]
            AgentExecutor["Agent Executor (Core)"]
            TaskValidator[Task Validator & Output Parser]
        end
        subgraph "Core Components"
            Agent[Agent]
            Task[Task]
            Tool[Tool System & MCP Hub]
            Memory["Memory (Mem0 / Short-term / Workspace)"]
            LLM["LLM Providers (OpenAI / Anthropic / Ollama / 10+)"]
        end
        Collaboration["Collaboration & Delegation"]
        Hooks["Hooks System"]
    end

    subgraph "Platform Services Layer"
        subgraph "Observability"
            Monitoring["Monitoring & Trajectory"]
            Prometheus[Prometheus / OpenTelemetry]
        end
        subgraph "Protocols"
            A2A["A2A Protocol"]
            MCP["MCP Protocol"]
        end
        subgraph "Security"
            Safety["Safety Layer (Leak Detection / Sanitizer / Policy)"]
            Sandbox["Execution Sandbox"]
        end
        subgraph "Storage"
            KVStore["Key-Value (SQLite / Redis)"]
            VectorStore["Vector (Milvus / Qdrant / Chroma)"]
            GraphStore["Graph (Neo4j / NetworkX)"]
        end
    end

    subgraph "Domain Extensions"
        Embodiment["GUI Agent / Embodiment"]
        Knowledge["Knowledge & GraphRAG"]
    end

    Desktop --> StudioServer
    CLI --> StudioServer
    SDK --> AgentExecutor

    StudioServer --> SessionMgr
    SessionMgr --> MetaAgent
    MetaAgent --> TeamMgr
    MetaAgent --> AvatarSys
    TeamMgr --> AgentRuntime

    AgentRuntime --> Agent
    AgentExecutor --> Agent
    WorkflowEngine --> AgentExecutor

    Agent --> Tool
    Agent --> Memory
    Agent --> LLM
    Agent --> Hooks

    AgentRuntime --> Monitoring
    AgentExecutor --> Monitoring
    Agent --> A2A
    Tool --> MCP

    Agent --> Safety
    Memory --> KVStore
    Memory --> VectorStore
    Knowledge --> GraphStore
Loading

Development Progress

✅ Completed Modules (M1-M11, M13-M17)

Module Status Description
M1 Core Abstraction Layer — Agent, Task, Tool, Workflow, Event Bus, Component, and Pydantic data contracts
M2 LLM Service Layer — 15+ providers (OpenAI / Anthropic / Ollama / Gemini / Kimi / MiniMax / Ark / Zhipu / Qianfan / Bailian), response caching, failover routing
M3 Tool System — Function decorators, MCP Hub, remote tools v2, OpenAPI toolset, sandbox tools, skill bundles, document routers
M4 Memory System — Hierarchical (core / episodic / semantic), Mem0, workspace, short-term, memory decay, hybrid search, memory intelligence engine
M5 Agent Core — Meta-Agent CEO dispatcher, think-act loop, event-driven architecture, self-repair, overflow recovery, reflection
M6 Task Validation — Pydantic-based output parsing, auto-repair, guiderails
M7 Orchestration Engine — Graph-based workflow engine + Flow system with decorators, execution plans, conditional routing, parallel execution
M8 Communication Protocols — A2A (client / server / AgentCard / skill-as-tool), MCP resource access, AGUI protocol
M9 Observability — Callbacks, real-time monitoring, trajectory analysis, span tree, WebSocket streaming, Prometheus / OpenTelemetry integration
M10 Developer Experience — CLI (agx with 15+ commands), Studio Server (FastAPI), Desktop App (Electron + React + Zustand, Pro/Lite dual mode)
M11 Enterprise Security — Safety layer (leak detection / sanitizer / injection detector / policy / audit), Sandbox (Docker / Microsandbox / Subprocess / Jupyter kernel / code interpreter)
M13 Knowledge & Retrieval — Knowledge base with document processing, chunkers, graphers (GraphRAG), readers; retrieval (vector / BM25 / graph / hybrid / auto); embeddings (OpenAI / Bailian / SiliconFlow / LiteLLM)
M14 Avatar & Collaboration — Avatar registry, group chat (user-directed / meta-routed / round-robin), delegation, role-playing, conversation patterns, team management
M15 Evaluation Framework — EvalSet, LLM judge, composite judge, span evaluator, trajectory matcher, trace converter
M16 Embodiment — GUI Agent framework with action reflection, stuck detection, action caching, REACT parsing, device-cloud routing, DAG verification, human-in-the-loop
M17 Storage Layer — Key-Value (SQLite / Redis / PostgreSQL / MongoDB), Vector (Milvus / Qdrant / Chroma / Faiss / PgVector / Pinecone / Weaviate), Graph (Neo4j / Nebula), Object (S3 / GCS / Azure)

🚧 Planned Modules

Module Status Description
M12 🚧 Agent Evolution — Architecture search, knowledge distillation, adaptive planning
M18 🚧 Multi-tenancy & RBAC — Per-tenant data isolation, fine-grained permission control

Core Advantages

  • Unified Abstraction: Clear and consistent core abstractions, avoiding conceptual confusion
  • Pluggable Architecture: All components are replaceable, avoiding vendor lock-in
  • Enterprise-Grade Monitoring: Complete observability, production-ready
  • Security First: Built-in security mechanisms and multi-tenant support
  • High Performance: Optimized execution engine and concurrent processing
  • Rich Ecosystem: Complete toolset and example library

System Requirements

  • Python: 3.10+
  • Memory: 4GB+ RAM recommended
  • System: Windows / Linux / macOS
  • Core Dependencies: ~27 lightweight packages, installs in seconds (see pyproject.toml)
  • Optional Dependencies: 15 feature groups available via pip install "agenticx[xxx]"

Contributing

We welcome community contributions! Please refer to:

  1. Submit Issues to report bugs or request features
  2. Fork the project and create feature branches
  3. Submit Pull Requests, ensuring all tests pass
  4. Participate in code reviews and discussions

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see LICENSE file for details

Star History

Star History Chart


If AgenticX helps you, please give us a Star!

GitHubDocumentationExamplesDiscussions

About

AgenticX is an advanced framework for building and deploying Agentic AI applications. It provides a flexible and extensible architecture to easily integrate Agentic AI with various applications like Agentic RAG and Agentic Workflows, empowering developers to build next-generation intelligent applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors