How conradlog/openmanus works
Main Components
• Core Engine & Entry Points: Show the entry scripts (main.py, run_flow.py, run_mcp.py) that initialize and orchestrate the application.
• Agent Module: Represent the “app/agent” package with its various specialized agent classes (browser, cot, planning, react, etc.). This is the backbone for agent behaviors.
• Flow Management: Indicate the "app/flow" package that seems responsible for governing multi-step processes (including planning flows) and integrating agents.
• Prompt Handling: Emphasize the “app/prompt” package, which mirrors the agent functionalities (browser, planning, etc.) to generate or manage prompts.
• Tools & Utilities: Include the “app/tool” folder (with submodules for bash, search, file operators, etc.) and any auxiliary modules (like logger, exceptions, and schema) as utility components that support diverse agent operations.
• MCP Server: Illustrate the “app/mcp” package and associated server module, representing a control plane for managing or interfacing with agents.
• Sandbox Environment: Represent “app/sandbox” and its subdirectories as the isolated execution environment, ensuring safe operations for potentially untrusted code.
• External Services and Dependencies: Include external LLM APIs (configured via the TOML file), optional browser automation via Playwright, and possibly logging or monitoring services.
Relationships and Interactions
• That the Tools & Utilities are “injected” or invoked by agents across modules (for file operations, browsing actions, search functions, etc.).
• Demonstrate how the MCP server (inside app/mcp) connects with both agents and external clients.
• That the Sandbox environment isolates certain tool operations, with interconnections to agent flows when a secure, managed execution is required.
• Configuration as a central dependency used by nearly all components to retrieve settings and API keys for LLM operations.
Architectural Patterns and Design Principles
• Modular Design & Separation of Concerns: The clear division between agent behaviors, flow control, prompt generation, sandboxing, and tooling illustrates a separation of concerns.
• Reusability & Extensibility: Notice the parallel structure in “app/agent” and “app/prompt,” which suggests an intention for interchangeable or pluggable components.
• Layered Architecture: The system moves from external interface (CLI entry points) through business logic (agent and flow modules) down to system services (tools, config, logs).
• Potential for Microservices–Style Isolation: Although it’s largely a monolithic codebase, components like the MCP server and sandbox could eventually be separated into services if needed.
Technologies, Frameworks, and Libraries
• Python is the primary language, with package management handled via uv (or conda/virtualenv).
• Docker (Dockerfile provided) indicates containerization is supported.
• External integration with LLM APIs (such as OpenAI) is configured via TOML files.
• Optional browser automation is achieved with Playwright.