| Name | langgroup JSON |
| Version |
0.2.0
JSON |
| download |
| home_page | None |
| Summary | A multiagent system framework built on LangChain and LangGraph with supervisor-based coordination |
| upload_time | 2025-10-27 23:52:28 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.10 |
| license | MIT |
| keywords |
langchain
langgraph
multiagent
ai
agents
llm
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# LangGroup
[](https://badge.fury.io/py/langgroup)
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
A multiagent system framework built on LangChain and LangGraph with supervisor-based coordination.
LangGroup provides a flexible architecture for creating groups of specialized AI agents that collaborate on complex tasks under the guidance of a supervisor agent.
## Features
- **Supervisor Architecture**: Intelligent task routing and coordination
- **Hierarchical Supervisors**: Supervisors can manage other supervisors, enabling nested group structures
- **Extensible Agent System**: Easy-to-extend base classes for custom agents
- **LangGraph Integration**: Stateful workflows with LangGraph
- **Type-Safe**: Full type hints and Pydantic models
## Installation
```bash
pip install langgroup
```
For development:
```bash
pip install -e ".[dev]"
```
## Quick Start
1. Set up your environment:
```bash
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
```
2. Create your custom agents by extending `BaseAgent`:
```python
from langgroup import BaseAgent
from typing import List, Callable
class MyAgent(BaseAgent):
@property
def description(self) -> str:
return "Description of what this agent does"
@property
def tools(self) -> List[Callable]:
return [my_tool_function]
@property
def system_prompt(self) -> str:
return "System prompt for the agent"
```
3. Set up the agent system:
```python
from langgroup import AgentSystem
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
agents = [MyAgent(llm), AnotherAgent(llm)]
system = AgentSystem(llm, agents)
result = system.run("Your task here")
```
## Hierarchical Supervisors
**💡 Key Feature**: `SupervisorAgent` can be used as a regular agent within another `AgentSystem`, enabling powerful hierarchical group structures.
Create groups of agents for complex workflows:
```python
from langgroup import AgentSystem, SupervisorAgent
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
# Create specialized groups
research_group = [ResearchAgent(llm), AnalysisAgent(llm)]
research_supervisor = SupervisorAgent(
llm, research_group,
name="ResearchGroupSupervisor"
)
content_group = [WritingAgent(llm), EditingAgent(llm)]
content_supervisor = SupervisorAgent(
llm, content_group,
name="ContentGroupSupervisor"
)
# Top-level supervisor coordinates the groups
top_system = AgentSystem(llm, [research_supervisor, content_supervisor])
result = top_system.run("Research AI trends and write a comprehensive report")
```
**How it works:**
1. The top-level supervisor receives the task
2. It intelligently routes to the appropriate group supervisor (e.g., ResearchGroupSupervisor)
3. The group supervisor manages its specialized agents
4. Results flow back up to coordinate between groups
5. Complex multi-stage tasks are handled seamlessly
This architecture allows you to build sophisticated agent organizations with clear separation of concerns.
## Usage
### Single Agent (Basic)
Run the basic agent:
```bash
python main.py
```
The agent includes two tools:
- **Calculator**: Performs mathematical calculations
- **Weather**: Returns weather information (mock implementation)
### Multiagent System with Supervisor
Run the multiagent system:
```bash
python multiagent_supervisor.py
```
The multiagent system includes:
- **Supervisor Agent**: Orchestrates and routes tasks to specialized agents
- **Research Agent**: Handles research and information gathering
- **Analysis Agent**: Analyzes data and provides insights
- **Writing Agent**: Writes and formats content
- **Math Agent**: Performs calculations
The supervisor dynamically decides which agents to invoke and coordinates their work, allowing agents to collaborate back and forth on complex tasks.
## Architecture
The multiagent system uses LangGraph to create a stateful workflow where:
1. Supervisor receives the task
2. Supervisor routes to appropriate sub-agent
3. Sub-agent completes its work
4. Control returns to supervisor
5. Process repeats until task is complete
## Customization
Add your own tools by creating functions and registering them with the `Tool` class in either `main.py` or `multiagent_supervisor.py`.
Raw data
{
"_id": null,
"home_page": null,
"name": "langgroup",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "langchain, langgraph, multiagent, ai, agents, llm",
"author": null,
"author_email": "William Kang <willysk73@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/51/53/1f3ee58fa25eaf593dfc958edccf2265dc8d3807bad2da557ef498c2934b/langgroup-0.2.0.tar.gz",
"platform": null,
"description": "# LangGroup\n\n[](https://badge.fury.io/py/langgroup)\n[](https://www.python.org/downloads/)\n[](https://opensource.org/licenses/MIT)\n\nA multiagent system framework built on LangChain and LangGraph with supervisor-based coordination.\n\nLangGroup provides a flexible architecture for creating groups of specialized AI agents that collaborate on complex tasks under the guidance of a supervisor agent.\n\n## Features\n\n- **Supervisor Architecture**: Intelligent task routing and coordination\n- **Hierarchical Supervisors**: Supervisors can manage other supervisors, enabling nested group structures\n- **Extensible Agent System**: Easy-to-extend base classes for custom agents\n- **LangGraph Integration**: Stateful workflows with LangGraph\n- **Type-Safe**: Full type hints and Pydantic models\n\n## Installation\n\n```bash\npip install langgroup\n```\n\nFor development:\n```bash\npip install -e \".[dev]\"\n```\n\n## Quick Start\n\n1. Set up your environment:\n```bash\ncp .env.example .env\n# Edit .env and add your OPENAI_API_KEY\n```\n\n2. Create your custom agents by extending `BaseAgent`:\n```python\nfrom langgroup import BaseAgent\nfrom typing import List, Callable\n\nclass MyAgent(BaseAgent):\n @property\n def description(self) -> str:\n return \"Description of what this agent does\"\n \n @property\n def tools(self) -> List[Callable]:\n return [my_tool_function]\n \n @property\n def system_prompt(self) -> str:\n return \"System prompt for the agent\"\n```\n\n3. Set up the agent system:\n```python\nfrom langgroup import AgentSystem\nfrom langchain_openai import ChatOpenAI\n\nllm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\nagents = [MyAgent(llm), AnotherAgent(llm)]\nsystem = AgentSystem(llm, agents)\n\nresult = system.run(\"Your task here\")\n```\n\n## Hierarchical Supervisors\n\n**\ud83d\udca1 Key Feature**: `SupervisorAgent` can be used as a regular agent within another `AgentSystem`, enabling powerful hierarchical group structures.\n\nCreate groups of agents for complex workflows:\n\n```python\nfrom langgroup import AgentSystem, SupervisorAgent\nfrom langchain_openai import ChatOpenAI\n\nllm = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n\n# Create specialized groups\nresearch_group = [ResearchAgent(llm), AnalysisAgent(llm)]\nresearch_supervisor = SupervisorAgent(\n llm, research_group, \n name=\"ResearchGroupSupervisor\"\n)\n\ncontent_group = [WritingAgent(llm), EditingAgent(llm)]\ncontent_supervisor = SupervisorAgent(\n llm, content_group, \n name=\"ContentGroupSupervisor\"\n)\n\n# Top-level supervisor coordinates the groups\ntop_system = AgentSystem(llm, [research_supervisor, content_supervisor])\nresult = top_system.run(\"Research AI trends and write a comprehensive report\")\n```\n\n**How it works:**\n1. The top-level supervisor receives the task\n2. It intelligently routes to the appropriate group supervisor (e.g., ResearchGroupSupervisor)\n3. The group supervisor manages its specialized agents\n4. Results flow back up to coordinate between groups\n5. Complex multi-stage tasks are handled seamlessly\n\nThis architecture allows you to build sophisticated agent organizations with clear separation of concerns.\n\n## Usage\n\n### Single Agent (Basic)\nRun the basic agent:\n```bash\npython main.py\n```\n\nThe agent includes two tools:\n- **Calculator**: Performs mathematical calculations\n- **Weather**: Returns weather information (mock implementation)\n\n### Multiagent System with Supervisor\nRun the multiagent system:\n```bash\npython multiagent_supervisor.py\n```\n\nThe multiagent system includes:\n- **Supervisor Agent**: Orchestrates and routes tasks to specialized agents\n- **Research Agent**: Handles research and information gathering\n- **Analysis Agent**: Analyzes data and provides insights\n- **Writing Agent**: Writes and formats content\n- **Math Agent**: Performs calculations\n\nThe supervisor dynamically decides which agents to invoke and coordinates their work, allowing agents to collaborate back and forth on complex tasks.\n\n## Architecture\n\nThe multiagent system uses LangGraph to create a stateful workflow where:\n1. Supervisor receives the task\n2. Supervisor routes to appropriate sub-agent\n3. Sub-agent completes its work\n4. Control returns to supervisor\n5. Process repeats until task is complete\n\n## Customization\n\nAdd your own tools by creating functions and registering them with the `Tool` class in either `main.py` or `multiagent_supervisor.py`.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A multiagent system framework built on LangChain and LangGraph with supervisor-based coordination",
"version": "0.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/willysk73/langgroup/issues",
"Documentation": "https://github.com/willysk73/langgroup#readme",
"Homepage": "https://github.com/willysk73/langgroup",
"Repository": "https://github.com/willysk73/langgroup"
},
"split_keywords": [
"langchain",
" langgraph",
" multiagent",
" ai",
" agents",
" llm"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "893dee8ccc58e0b8efe936bc25e119bf12019ef24c9fa8f68b5fc40350541eb5",
"md5": "59a199b28c8e8fb3adc57d148375f8f8",
"sha256": "4663e3ad07c3e6490c1b07923a12fbf93050096515b5d0b630a9a6a7edf4f049"
},
"downloads": -1,
"filename": "langgroup-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "59a199b28c8e8fb3adc57d148375f8f8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 10957,
"upload_time": "2025-10-27T23:52:26",
"upload_time_iso_8601": "2025-10-27T23:52:26.610665Z",
"url": "https://files.pythonhosted.org/packages/89/3d/ee8ccc58e0b8efe936bc25e119bf12019ef24c9fa8f68b5fc40350541eb5/langgroup-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "51531f3ee58fa25eaf593dfc958edccf2265dc8d3807bad2da557ef498c2934b",
"md5": "0dab4e62f107d8fd44e059e9d77c287f",
"sha256": "7df1e0f2b1b149a0a802cd155fdab8cc6a0ce14fe20353ed37836cab0b3aa9ce"
},
"downloads": -1,
"filename": "langgroup-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "0dab4e62f107d8fd44e059e9d77c287f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 11671,
"upload_time": "2025-10-27T23:52:28",
"upload_time_iso_8601": "2025-10-27T23:52:28.104035Z",
"url": "https://files.pythonhosted.org/packages/51/53/1f3ee58fa25eaf593dfc958edccf2265dc8d3807bad2da557ef498c2934b/langgroup-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-27 23:52:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "willysk73",
"github_project": "langgroup",
"github_not_found": true,
"lcname": "langgroup"
}