{"id":48018940,"url":"https://github.com/llmx-tech/a2a-template-langgraph","last_synced_at":"2026-05-29T14:31:42.840Z","repository":{"id":288544359,"uuid":"967259957","full_name":"llmx-tech/a2a-template-langgraph","owner":"llmx-tech","description":"A production-ready agent server built with LangGraph that implements the Agent-to-Agent (A2A) protocol","archived":false,"fork":false,"pushed_at":"2025-05-12T07:28:15.000Z","size":62,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T13:50:18.393Z","etag":null,"topics":["a2a","agent","agent2agent","langgraph","python"],"latest_commit_sha":null,"homepage":"https://llmx.tech","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llmx-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-16T07:16:37.000Z","updated_at":"2026-03-29T14:24:47.000Z","dependencies_parsed_at":"2025-04-21T06:46:52.741Z","dependency_job_id":null,"html_url":"https://github.com/llmx-tech/a2a-template-langgraph","commit_stats":null,"previous_names":["llmx-de/a2a-template-langgraph","llmx-tech/a2a-template-langgraph"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/llmx-tech/a2a-template-langgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llmx-tech%2Fa2a-template-langgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llmx-tech%2Fa2a-template-langgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llmx-tech%2Fa2a-template-langgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llmx-tech%2Fa2a-template-langgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llmx-tech","download_url":"https://codeload.github.com/llmx-tech/a2a-template-langgraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llmx-tech%2Fa2a-template-langgraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33657690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["a2a","agent","agent2agent","langgraph","python"],"created_at":"2026-04-04T13:45:31.262Z","updated_at":"2026-05-29T14:31:42.835Z","avatar_url":"https://github.com/llmx-tech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A2A LangGraph Agent\n\n**Empower your applications with Agent-to-Agent (A2A) protocol support.**\n\nA production-ready agent server built with [LangGraph](https://github.com/langgraph/langgraph) that implements the Agent-to-Agent (A2A) protocol. Perfect for building advanced, real-time AI workflows and integrating AI capabilities into your applications.\n\n## 🚀 Features\n- 🔄 A2A Protocol Support: Full implementation of the Agent-to-Agent protocol.\n- 🧠 LangGraph-powered Agent: Flexible agent architecture built on LangGraph's React pattern.\n- 🔍 Extensible Tools: Easy integration of custom tools like search, database queries, and more.\n- ⚡ Real-Time Streaming: Stream responses for live updates and interactive flows.\n- 🗄️ Database-backed State Management: Maintain conversation state across sessions.\n- 🌐 FastAPI HTTP Server: Robust HTTP server with proper A2A protocol endpoints.\n\n## 🔧 Quick Start\n\n### Option 1: Local Installation\n\n1. **Clone the repo**\n   ```bash\n   git clone https://github.com/llmx-de/a2a_template_langgraph.git\n   cd a2a_template_langgraph\n   ```\n\n2. **Install dependencies**\n   ```bash\n   pip install -e .\n   # or with uv\n   uv install\n   ```\n\n3. **Set up PostgreSQL**\n   Use the included Docker Compose file to start a PostgreSQL instance:\n   ```bash\n   docker-compose up -d postgres\n   ```\n\n4. **Configure**\n   Create a `.env` file:\n   ```env\n   OPENAI_API_KEY=your_openai_api_key\n   HOST=0.0.0.0      # Optional, defaults to 0.0.0.0\n   PORT=10000        # Optional, defaults to 10000\n   OPENAI_MODEL=o4-mini # Optional, defaults to o4-mini\n   ```\n\n5. **Run the server**\n   ```bash\n   python main.py\n   ```\n\n### Option 2: Docker Deployment\n\n1. **Clone the repo**\n   ```bash\n   git clone https://github.com/llmx-de/a2a_template_langgraph.git\n   cd a2a_template_langgraph\n   ```\n\n2. **Configure**\n   Create a `.env` file:\n   ```env\n   OPENAI_API_KEY=your_openai_api_key\n   OPENAI_MODEL=o4-mini # Optional, defaults to o4-mini\n   ```\n\n3. **Build and run with Docker Compose**\n   ```bash\n   docker-compose up -d\n   ```\n\n   This will:\n   - Start a PostgreSQL database\n   - Run database migrations automatically\n   - Start the A2A agent server\n\nYour agent server will be live on `http://localhost:10000`.\n\n## 🛠️ API Endpoints\n\n- **GET /** or **GET /.well-known/agent.json**  \n  Returns the agent card information following the A2A protocol.\n\n- **POST /**  \n  Send a one-off task to the agent.\n\n- **POST /send_task_subscribe**  \n  Stream a task to receive real-time responses.\n\n## 📂 Project Structure\n\n```\n.\n├── main.py                # Entry point\n├── a2a_service/           # Core service package\n│   ├── agent.py           # LangGraph agent implementation\n│   ├── server.py          # A2A HTTP server\n│   ├── database.py        # Database connection setup\n│   ├── types.py           # All data types and models for the A2A protocol\n│   ├── models/            # Database models \n│   │   └── db_models.py   # SQLAlchemy database models\n│   ├── task_managers/     # Task management modules\n│   │   ├── __init__.py    # Base task manager interface\n│   │   ├── db_task_manager.py  # DB-backed task manager\n│   │   └── async_inmem_task_manager.py  # In-memory task manager\n│   └── tools/             # Agent tools\n│       └── search.py      # Web search tool\n├── alembic/               # Database migration scripts\n├── alembic.ini            # Alembic configuration\n├── pyproject.toml         # Project configuration \u0026 dependencies\n├── docker-compose.yaml    # Docker setup for PostgreSQL\n└── README.md              # This file\n```\n\n## 🛠️ Tech Stack\n\n- **Python 3.13+**  \n- **[LangGraph](https://github.com/langgraph/langgraph)** for agent orchestration  \n- **[LangChain](https://github.com/langchain-ai/langchain)** for LLM components\n- **FastAPI** \u0026 **Uvicorn** for HTTP server  \n- **PostgreSQL** via **SQLAlchemy** \u0026 **Alembic** migrations  \n- **OpenAI** for LLM capabilities  \n- **Pydantic** for data validation and serialization\n- **Docker \u0026 Docker Compose** for containerization and deployment\n\n## 🐳 Docker Support\n\nThis project includes full Docker support for development and deployment:\n\n- **Dockerfile**: Builds the A2A LangGraph Agent application\n- **docker-compose.yaml**: Orchestrates the application with PostgreSQL and automatic migrations\n- **Automatic Database Migration**: Runs Alembic migrations on startup\n- **Smart Entrypoint Script**: Handles database waiting, migrations, and application startup\n\nThe Docker setup provides:\n- Automatic database initialization and migrations\n- Proper dependency ordering (database → migrations → application)\n- Health checks to ensure services are ready before dependent services start\n\nNote: While the project recommends UV for local development, the Docker build uses pip for compatibility and reliability in containerized environments.\n\n## 🔌 Extending the Agent\n\nTo add custom tools:\n1. Create a new Python file in the `a2a_service/tools/` directory\n2. Define your tool using the `@tool` decorator from LangChain\n3. Import and add your tool to the Agent's tools list in `main.py`\n\nExample:\n\n```python\n# a2a_service/tools/my_tool.py\nfrom langchain_core.tools import tool\n\n@tool\ndef my_custom_tool(param: str) -\u003e str:\n    \"\"\"Description of what this tool does.\n    \n    Args:\n        param: Description of the parameter\n        \n    Returns:\n        Description of the return value\n    \"\"\"\n    # Your implementation here\n    return f\"Processed: {param}\"\n```\n\n## 💬 Get in touch\n\n- [Website](https://llmx.de)\n- [LinkedIn](https://www.linkedin.com/in/dmytro--ch/)\n- [X](https://x.com/dmytro__ch)\n- [GitHub](https://github.com/llmx-de)\n- [Email](mailto:dmytro.de.ch@gmail.com)\n\n---\n\nFeel free to contribute or report issues!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllmx-tech%2Fa2a-template-langgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllmx-tech%2Fa2a-template-langgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllmx-tech%2Fa2a-template-langgraph/lists"}