$ show jd-opensource/OxyGent
OxyGent is a production-grade Python multi-agent system (MAS) framework that unifies LLMs, agents, tools, and flows into a declarative component model. It provides a runtime container (MAS) that orchestrates agent loops (ReAct, Chat, Workflow, PlanAndSolve, Parallel, Reflexion), tool execution (via MCP protocol, FunctionHub decorators, HTTP tools, bank tools), and communication (SSE streaming, A2A protocol for cross-framework interop). The framework ships with a FastAPI web service offering chat, evaluation, prompt management, and SSE endpoints, as well as a built-in web UI. A reference application, OxyBank, demonstrates full-stack data annotation with document ingestion, vector search (Vearch), and annotation agents. The architecture is plugin-based: components reference each other by name, and the MAS container handles lifecycle, wiring, and persistence (Elasticsearch, Redis, Vearch, local fallbacks). OxyGent supports distributed deployments via SSEOxyGent and A2AClientAgent, and integrates with LangChain, LangGraph, AgentScope, and Google A2A SDK. The codebase is well-tested with unit, integration, and regression tests, and includes extensive bilingual documentation.
The LLM identified 5 files worth highlighting for reuse:
Provides a decorator-based tool registration system (@fh.tool) that wraps arbitrary Python functions (sync/async) into callable tools with automatic Pydantic schema extraction, permission flags, timeout, and retry logic. The FunctionHub singleton manages a global tool registry and supports thread-pool execution for sync functions. This pattern is reusable across any Python project needing declarative tool definitions.
Defines the base class for MCP (Model Context Protocol) clients, implementing lifecycle management (init, list_tools, call_tool, close) with retry and error handling. Subclasses StdioMCPClient, SSEMCPClient, and StreamableMCPClient provide concrete transports. The design cleanly separates transport from tool semantics, making it reusable for any MCP-compatible tool server.
Implements a centralized configuration singleton that loads from a JSON file, applies environment variable overrides (e.g., ${OPENAI_API_KEY}), and provides typed getter/setter groups by domain (app, llm, cache, storage, server, agent, tool). The deep_update mechanism and profile-based loading (default/development/production) make it adaptable to different deployment environments without code changes.
Provides a generic client agent for the A2A (Agent-to-Agent) protocol, enabling OxyGent agents to communicate with any A2A-compliant server (LangChain, LangGraph, AgentScope, Google SDK). Includes a factory method `minimal()` for quick setup, automatic agent card discovery, and streaming support. This component demonstrates clean protocol abstraction and can be reused to integrate new A2A servers.
Defines the core OxyRequest and OxyResponse Pydantic schemas with deep-copy semantics (`clone_with` for immutable field overrides), permission checks (`permitted_tool_name_list`), timeout enforcement, and parallel execution coordination (`concurrency_key`, `wait_tasks`). The design ensures safe request mutation and cross-request data flow (shared_data, group_data, global_data), making it a solid foundation for any agent orchestration system.