Super Agent
Super Agent is a powerful intelligent agent system built on the LangCrew framework, integrating browser automation, web search, code execution, file operations, and various other tools. It provides complete Web API services with streaming response support.
Prerequisites and Configuration
Section titled “Prerequisites and Configuration”Environment Variables
Section titled “Environment Variables”Before using Super Agent, you need to configure environment variables.
Important Note: Please refer to the environment variable configuration example file in the project:
- Configuration Example File:
examples/components/web/super_agent/.env.example
Please configure all the following environment variables to ensure Super Agent runs properly:
# LLM API KeyOPENAI_API_KEY=
# E2B Sandbox Environment ConfigurationE2B_API_KEY=E2B_TEMPLATE=e2b-20250806-v1E2B_DOMAIN=your-e2b-domain.example.comE2B_TIMEOUT=3600
# S3 Storage ConfigurationS3_ENDPOINT=S3_AK=S3_SK=S3_BUCKET=S3_GATEWAY=S3_REGION=
# WebSearchTool Configuration
# WebSearchTool Configuration (required for web search functionality)SERPER_API_KEY=your_serper_api_key_here
# ImageGenerationTool Configuration (optional, for AI image generation)ARK_API_KEY=your_image_gen_api_key_hereVariable Descriptions
Section titled “Variable Descriptions”-
LLM API Key: OpenAI API key for the agent’s core reasoning capabilities
-
E2B Sandbox Environment Configuration: Used for secure code execution environment
E2B_API_KEY: Requires applying for E2B API keyE2B_TEMPLATE: To build a custom sandbox, refer to the official E2B documentation at https://e2b.dev/docs/sandbox-template. We provide a pre-configured template inlangcrew/libs/langcrew-tools/e2b-template. After building your own, replace theE2B_TEMPLATEvariable with your template ID.E2B_DOMAIN: Your E2B domain (e.g.,your-e2b-domain.example.com)E2B_TIMEOUT: Sandbox timeout, set to 3600 seconds
-
S3 Storage Configuration: For file storage and image saving, requires configuring S3-compatible object storage service
-
Search Tool Configuration: For web search functionality, requires configuring search service endpoint and key
-
Image Generation Configuration: For AI image generation functionality, requires configuring image generation service key
Important Note: All environment variables should be configured according to your own service accounts and requirements. The template file .env.example provides examples of required variables.
Quick Start
Section titled “Quick Start”Step 1: Navigate to the Example Project Directory
Section titled “Step 1: Navigate to the Example Project Directory”cd examples/components/web/super_agentStep 2: Configure Environment Variables
Section titled “Step 2: Configure Environment Variables”Create a .env file in the current directory:
# Copy configuration example filecp .env.example .env# Edit the .env file to fill in necessary configurationsStep 3: Start Services
Section titled “Step 3: Start Services”docker-compose -f compose-super-agent.yaml up --buildStep 4: Access Services
Section titled “Step 4: Access Services”After startup is complete, you can access:
- Super Agent API: http://localhost:8000
- Frontend Web UI: http://localhost:3600
- Note: The front-end service requires 5-6 minutes to start up.
Docker Compose Architecture Overview
Section titled “Docker Compose Architecture Overview”The compose-super-agent.yaml file in the example directory defines the complete full-stack architecture:
frontend service:
- Based on Node.js 18 Alpine image
- Port mapping: 3600:3600
- Automatically installs dependencies and starts development server
- Environment variable:
AGENT_API_HOST=http://super-agent:8000 - Mounts
./webdirectory as frontend code
super-agent service:
- Built based on the
Dockerfilein the current directory - Port mapping: 8000:8000
- Loads environment variables from
.envfile - Run mode: full, log level: info
- Network: langcrew-network (for communication with frontend service)
Key Features
Section titled “Key Features”API Interfaces
Section titled “API Interfaces”Super Agent provides the following core API interfaces:
1. Chat Interface
Section titled “1. Chat Interface”POST /api/v1/chatContent-Type: application/json
{ "message": "Your task description", "session_id": "Session ID (optional, automatically generated if empty)"}Features:
- Multi-turn conversation support
- Real-time streaming response (Server-Sent Events)
- Automatic session management
- Tool invocation and execution monitoring
2. Stop Execution Interface
Section titled “2. Stop Execution Interface”POST /api/v1/chat/stopContent-Type: application/json
{ "session_id": "Session ID to stop"}3. Update Task Interface
Section titled “3. Update Task Interface”POST /api/v1/update_taskContent-Type: application/json
{ "message": "New task instruction", "session_id": "Session ID"}Agent Capabilities
Section titled “Agent Capabilities”Browser Automation
Section titled “Browser Automation”- Intelligent web page operation and data extraction based on browser-use
- Automatic handling of complex multi-step web tasks and workflows
- Intelligent page element recognition and interactive operations
- Support for user takeover control and manual intervention for login pages
- Built-in error recovery and retry mechanisms to ensure stable task execution
Information Retrieval and Processing
Section titled “Information Retrieval and Processing”- Web search and content scraping
- Multi-source information integration and verification
- Structured data extraction and analysis
- Intelligent content summarization and report generation
Code Execution and File Operations
Section titled “Code Execution and File Operations”- Python code execution in sandbox environment
- Mathematical calculations, data analysis, chart generation
- Complete file system operation support
- Support for reading and writing various file formats
Multimedia Generation
Section titled “Multimedia Generation”- AI-driven image generation
- Support for various artistic styles and descriptions
- Automatic image file saving and management
System Integration
Section titled “System Integration”- Linux command execution support
- Environment variable and configuration management
- Multi-tool coordination and workflow orchestration
Usage Examples
Section titled “Usage Examples”Web Search and Information Extraction
Section titled “Web Search and Information Extraction”curl -X POST "http://localhost:8000/api/v1/chat" \ -H "Content-Type: application/json" \ -d '{ "message": "Search for 2024 artificial intelligence development trends and summarize key insights", "session_id": "a1b2c3d4e5f6g7h8" }'Browser Automation Tasks
Section titled “Browser Automation Tasks”curl -X POST "http://localhost:8000/api/v1/chat" \ -H "Content-Type: application/json" \ -d '{ "message": "Open the 12306 official website and help me check which high-speed trains from Beijing to Shanghai have available tickets after 3 PM the day after tomorrow", "session_id": "b2c3d4e5f6g7h8i9" }'File Processing and Content Generation
Section titled “File Processing and Content Generation”curl -X POST "http://localhost:8000/api/v1/chat" \ -H "Content-Type: application/json" \ -d '{ "message": "Create a research report on AI technology development and save it as a markdown file", "session_id": "c3d4e5f6g7h8i9j0" }'Project Architecture
Section titled “Project Architecture”src/super_agent/├── agent/│ └── crew.py # Main SuperAgentCrew class├── config/│ ├── config.py # Configuration class definitions│ └── prompt.py # System prompts├── main.py # Direct execution entry point└── server.py # FastAPI serverIntegration with LangCrew Framework
Section titled “Integration with LangCrew Framework”Super Agent is built entirely on the LangCrew framework, showcasing the framework’s powerful capabilities:
- Decorator Development Pattern: Uses
@agent,@crewdecorators - Tool Ecosystem: Integrates LangCrew-Tools toolset
- Streaming Monitoring: Real-time execution status and result streams
- Session Management: Persistent context and state
Super Agent is a perfect demonstration of the LangCrew framework’s capabilities, providing a complete reference implementation for building production-grade intelligent agent systems.