{"id":49394766,"url":"https://github.com/ashref-dev/open-manus-tn","last_synced_at":"2026-04-28T15:03:24.478Z","repository":{"id":286900127,"uuid":"962923601","full_name":"Ashref-dev/open-manus-tn","owner":"Ashref-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-08T22:15:40.000Z","size":775,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T23:23:23.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ashref-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-08T22:10:04.000Z","updated_at":"2025-04-08T22:15:44.000Z","dependencies_parsed_at":"2025-04-08T23:33:27.669Z","dependency_job_id":null,"html_url":"https://github.com/Ashref-dev/open-manus-tn","commit_stats":null,"previous_names":["ashref-dev/open-manus-tn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ashref-dev/open-manus-tn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashref-dev%2Fopen-manus-tn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashref-dev%2Fopen-manus-tn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashref-dev%2Fopen-manus-tn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashref-dev%2Fopen-manus-tn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ashref-dev","download_url":"https://codeload.github.com/Ashref-dev/open-manus-tn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ashref-dev%2Fopen-manus-tn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32385943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-28T15:02:57.512Z","updated_at":"2026-04-28T15:03:24.469Z","avatar_url":"https://github.com/Ashref-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open Manus TN: General AI Agent\n\nThis project implements Open Manus TN, a general AI agent designed to fulfill a variety of user tasks. It leverages a ReAct (Reasoning and Acting) agent architecture and a collection of tools to achieve its goals. It uses [LangGraph](https://github.com/langchain-ai/langgraph) to orchestrate its reasoning and actions.\n\nThe agent can handle tasks such as:\n*   Generating PDFs\n*   Searching the web\n*   Summarizing data\n*   Writing detailed charts and reports\n*   Leveraging specific tools like Planning, Search, PDF generation, LaTeX, LinkedIn integration, Web Browsing, and potentially more.\n\n## Technology Stack\n\n*   **Backend Framework:** FastAPI\n*   **Web Server:** Uvicorn\n*   **AI Agent Logic:** LangChain \u0026 LangGraph (implementing a ReAct agent)\n*   **Language Models:** Compatible with OpenAI, Anthropic, Fireworks, and potentially OpenRouter models (configurable)\n*   **Tools:** Planning, Search (e.g., Tavily, Google Search), PDF Generation, LaTeX Processing, LinkedIn API, Web Browser interaction, etc. (implementation specific)\n*   **Data Validation:** Pydantic\n*   **Package Management:** `uv` / `pip` with `pyproject.toml`\n\n## Project Structure\n\n```\n.\n├── .env.example           # Example environment variables\n├── .gitignore             # Git ignore rules\n├── LICENSE                # Project license\n├── Makefile               # Optional: Build/run commands\n├── pyproject.toml         # Project metadata and dependencies (for uv/pip)\n├── uv.lock                # Lockfile for dependencies (if using uv)\n├── README.md              # This file\n├── src/                   # Main application source code directory\n│   ├── __init__.py\n│   ├── main.py            # FastAPI app entry point, mounts API routers\n│   ├── core/              # Cross-cutting concerns (Config, Custom Exceptions)\n│   │   ├── __init__.py\n│   │   ├── config.py      # Application settings, environment variable loading.\n│   │   ├── exceptions.py  # Optional: Custom application exceptions.\n│   │   └── limiter.py     # Rate limiting configuration\n│   ├── api/               # Presentation Layer (Handles HTTP requests/responses)\n│   │   ├── __init__.py\n│   │   ├── routers/       # FastAPI routers defining API endpoints.\n│   │   │   ├── __init__.py\n│   │   │   └── chat.py    # Chat endpoint router. Depends on `application.services`.\n│   │   └── schemas.py     # Pydantic models for API request/response validation.\n│   ├── application/       # Application Layer (Core business logic, use cases)\n│   │   ├── __init__.py\n│   │   ├── services/      # Orchestrates application use cases.\n│   │   │   ├── __init__.py\n│   │   │   └── agent_service.py # Service handling chat logic, using the agent graph.\n│   │   ├── graph/         # Agent-specific graph logic (LangGraph).\n│   │   │   ├── __init__.py\n│   │   │   ├── definition.py  # LangGraph graph definition.\n│   │   │   └── state.py       # Agent state definition.\n│   │   ├── prompts.py       # Agent prompts.\n│   │   └── interfaces/      # Abstract interfaces for infrastructure components.\n│   │       ├── __init__.py\n│   │       ├── i_llm.py     # Interface for language model operations.\n│   │       └── i_tool.py    # Interface for agent tools.\n│   ├── infrastructure/    # Infrastructure Layer (External concerns implementation)\n│   │   ├── __init__.py\n│   │   ├── llm/           # Concrete LLM clients and configuration.\n│   │   │   ├── __init__.py\n│   │   │   ├── configuration.py # LLM selection and API key setup.\n│   │   │   └── clients.py     # Implementations for OpenAI, Anthropic etc.\n│   │   ├── tools/         # Concrete tool implementations.\n│   │   │   ├── __init__.py\n│   │   │   ├── search.py    # Example: Search tool implementation.\n│   │   │   ├── pdf_generator.py # Example: PDF tool implementation.\n│   │   │   ├── browser.py     # Example: Web browser tool implementation.\n│   │   │   └── ...          # Other tools (LaTeX, LinkedIn, etc.)\n│   │   └── caching/       # Optional: Caching mechanisms.\n│   │       └── __init__.py\n│   └── static/            # Static files (HTML, CSS, JS for simple UI)\n│       └── index.html\n├── tests/                 # Unit and integration tests (optional)\n└── .venv/                 # Virtual environment created by `uv venv`\n```\n\n## Getting Started\n\n### Prerequisites\n\n*   Python 3.11+\n\n### Setup\n\nFollow these steps to set up the project environment using `uv`:\n\n1.  **Install `uv` (if you haven't already):**\n    `uv` is a fast Python package installer and resolver. Follow the official installation instructions for your operating system [here](https://github.com/astral-sh/uv#installation).\n    A common method is using `curl` or `pip`:\n    ```bash\n    # Example using curl (check official docs for the latest)\n    curl -LsSf https://astral.sh/uv/install.sh | sh \n    \n    ```\n\n2.  **Clone the repository:**\n    ```bash\n    git clone \u003crepository-url\u003e\n    cd \u003crepository-folder\u003e\n    ```\n\n3.  **Create and populate `.env`:**\n    Copy the example file and add your API keys.\n```bash\ncp .env.example .env\n```\n    Edit `.env` and add your keys:\n    ```plaintext\n    # Required for the default search tool (if using Tavily)\n    # TAVILY_API_KEY=\"your_tavily_api_key\"\n    # Add API keys for other tools as needed, e.g.:\n  \n    # ... etc ...\n\n    # Required for the language model (choose one or more)\n    OPENAI_API_KEY=\"your_openai_api_key\"\n    # or\n    ANTHROPIC_API_KEY=\"your_anthropic_api_key\"\n    # or\n    OPENROUTER_API_KEY=\"your_openrouter_api_key\"\n\n    # Optional: LangSmith tracing\n    # LANGCHAIN_TRACING_V2=\"true\"\n    # LANGCHAIN_API_KEY=\"your_langsmith_api_key\"\n    # LANGCHAIN_PROJECT=\"your_project_name\"\n    ```\n    *   Get a Tavily API key [here](https://app.tavily.com/).\n    *   Get OpenAI/Anthropic keys from their respective platforms.\n\n4.  **Create and Activate Virtual Environment:**\n    ```bash\n    # Create a virtual environment named '.venv' in the current directory.\n    # This isolates project dependencies from your global Python installation.\n    uv venv\n    \n    # Activate the virtual environment in your current shell session (Linux/macOS).\n    # This makes the project's Python interpreter and installed packages available.\n    source .venv/bin/activate \n    \n    # On Windows PowerShell, use this command instead:\n    # .\\\\.venv\\\\Scripts\\\\Activate.ps1 \n    ```\n    *Note: You must activate the environment in each new terminal session where you want to work on the project.* \n\n5.  **Install Dependencies:**\n    With the virtual environment activated, install the project dependencies:\n    ```bash\n    # Install all dependencies specified in pyproject.toml and locked in uv.lock\n    # into the activated virtual environment. This ensures reproducible builds.\n    uv sync\n    ```\n\n### Managing Dependencies with `uv`\n\nMake sure your virtual environment is activated (`source .venv/bin/activate`) before running these commands.\n\n*   **Adding a new dependency:**\n    ```bash\n    # Installs the package and adds it to your pyproject.toml\n    uv pip install \u003cpackage-name\u003e\n    # Example: uv pip install requests\n    ```\n    After adding, `uv` typically updates `pyproject.toml` automatically. If you modify `pyproject.toml` manually, run `uv sync` again.\n\n*   **Removing a dependency:**\n    ```bash\n    # Uninstalls the package and removes it from your pyproject.toml\n    uv pip uninstall \u003cpackage-name\u003e\n    # Example: uv pip uninstall requests \n    ```\n    Similar to adding, this should update `pyproject.toml`. Run `uv sync` if needed after manual edits.\n\n### Running the API Server\n\nActivate your virtual environment if you haven't already (`source .venv/bin/activate`).\n\nRun the FastAPI application using Uvicorn:\n```bash\n# src.main refers to src/main.py, app refers to the FastAPI instance inside it.\nuvicorn src.main:app --reload --host 0.0.0.0 --port 8000\n```\n\nThe Open Manus TN API will be available at `http://127.0.0.1:8000` (or your local network IP if accessing from another device). You can access the auto-generated API documentation at `http://127.0.0.1:8000/docs` and the simple chat UI at `http://127.0.0.1:8000/`.\n\n## API Endpoint\n\n*   `POST /api/chat`\n    *   **Request Body:**\n        ```json\n        {\n          \"query\": \"Your question for the agent\"\n        }\n        ```\n    *   **Response Body:**\n        ```json\n        {\n          \"response\": \"The agent's final answer\"\n        }\n        ```\n\nYou can test this endpoint using tools like `curl`, Postman, or the Swagger UI at `/docs`.\n\n## Customization\n\n*   **Agent Logic:** Modify the core reasoning graph (likely implementing the ReAct loop) in `src/application/graph/definition.py` and the state definition in `src/application/graph/state.py`. Agent interaction logic is primarily within `src/application/services/agent_service.py`.\n*   **Tools:** This is crucial for Open Manus TN. Implement or refine tools in `src/infrastructure/tools/` (e.g., `pdf_generator.py`, `browser.py`, `linkedin.py`). Ensure the agent's prompt (`src/application/prompts.py`) is updated to know how to effectively use these tools.\n*   **Model:** Change the default language model and other agent configurations in `src/infrastructure/llm/configuration.py`. Model loading logic is in `src/infrastructure/llm/clients.py`.\n*   **Prompts:** Adjust the Open Manus TN system prompt in `src/application/prompts.py` to guide the ReAct agent effectively.\n*   **Environment Loading:** Configuration loading (including `.env` handling) happens in `src/core/config.py`.\n*   **API Endpoints:** Add new API endpoints if needed in `src/api/routers/` and include them in `src/main.py`.\n*   **UI:** Modify the simple HTML UI in `src/static/index.html`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashref-dev%2Fopen-manus-tn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashref-dev%2Fopen-manus-tn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashref-dev%2Fopen-manus-tn/lists"}