ManusPro is an agent-based system that can execute tasks, generate documents, conduct research, and more.
demo.mp4
- Clone the repository:
git clone https://github.com/yourusername/open-manus.git
cd open-manus/python- Install the required dependencies:
pip install -r requirements.txt- Optional dependencies:
- For generating visualizations in PDFs:
pip install matplotlib numpy
- Task planning and execution
- Document generation
- PDF generation with data tables and visualizations (auto-opens generated PDFs)
- Markdown generation with auto-open capability
- Web research using Firecrawl API
- Code generation and automatic execution
- Terminal command integration
- Artifact management and tracking
- Conversation handling
Create a .env file in the project root with your API keys:
OPENAI_API_KEY=your_openai_key
FIRECRAWL_API_KEY=your_firecrawl_key # For web research capabilities
# Optional: If using Claude
ANTHROPIC_API_KEY=your_anthropic_key
from app.agent.manus import Manus
import asyncio
# Create Manus agent
agent = Manus()
# Run a task
async def main():
await agent.run("Generate a report about renewable energy technologies")
if __name__ == "__main__":
asyncio.run(main())OpenManus can generate different types of documents:
from app.tool.pdf_generator import PDFGeneratorTool
pdf_tool = PDFGeneratorTool()
result = pdf_tool.run(
content="# This is a PDF report\n\nContent goes here...",
title="Sample Report",
options={"auto_open": True} # Automatically open the PDF after generation
)
print(f"PDF created at: {result['artifact_path']}")from app.tool.markdown_generator import MarkdownGeneratorTool
md_tool = MarkdownGeneratorTool()
result = md_tool.run(
content="## This is a Markdown document\n\nContent goes here...",
title="Sample Document",
options={"auto_open": True} # Automatically open the markdown file
)
print(f"Markdown created at: {result['artifact_path']}")Generate and automatically execute code:
from app.tool.code_generator import CodeGeneratorTool
code_tool = CodeGeneratorTool()
result = code_tool.run(
description="Create a function that calculates the factorial of a number",
language="python" # Code will be auto-executed if it's safe
)
print(f"Code created at: {result['artifact_path']}")
if result.get("executed"):
print(f"Execution result: {result['execution_result']['output']}")Perform web research using the Firecrawl API:
from app.tool.firecrawl_research import FirecrawlResearchTool
research_tool = FirecrawlResearchTool()
result = research_tool.run(
query="Latest advancements in quantum computing",
output_format="markdown",
include_visualizations=True
)
print(f"Research data saved to: {result['artifact_path']}")The PDF generator can include data visualizations if matplotlib is installed. To enable this feature:
pip install matplotlib numpyWithout matplotlib, the system will still work but will display a message in the PDF when visualizations are requested.
For automating browser tasks, Selenium is used:
pip install selenium webdriver-managerFor web research capabilities, the firecrawl-py package is required:
pip install firecrawl-py