coagent-python


Namecoagent-python JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/OpenCSGs/coagent
SummaryAn open-source framework for building monolithic or distributed agentic systems, ranging from simple LLM calls to compositional workflows and autonomous agents.
upload_time2025-07-25 08:18:35
maintainerNone
docs_urlNone
authorRussellLuo
requires_python<3.14,>=3.10.0
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Coagent
[![CI](https://github.com/OpenCSGs/coagent/actions/workflows/ci.yml/badge.svg)](https://github.com/OpenCSGs/coagent/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)

An open-source framework for building monolithic or distributed agentic systems, ranging from simple LLM calls to compositional workflows and autonomous agents.


<p align="center">
<img src="assets/coagent-overview.png" height="600">
</p>


## Latest Updates

- 🚀 **2025-07-18**: Added support for [A2A](https://a2a-protocol.org/), check out the [example](examples/a2a).
- **2025-02-08**: Added support for [DeepSeek-R1](https://api-docs.deepseek.com/news/news250120), check out the [example](examples/deepseek-r1).
- **2025-01-28**: Added support for [Structured Outputs][2].
- **2025-01-22**: Added support for [Model Context Protocol][3].
- **2025-01-17**: Added integration with [LiteLLM](https://github.com/BerriAI/litellm).


## Features

- [x] Event-driven & Scalable on-demand
- [x] Monolithic or Distributed
    - [x] Local Runtime (In-process Runtime)
    - [x] HTTP Runtime (HTTP-based Distributed Runtime)
    - [x] NATS Runtime (NATS-based Distributed Runtime)
        - [ ] Using NATS [JetStream][1]
- [x] Single-agent
    - [x] [Function calling](https://platform.openai.com/docs/guides/function-calling)
    - [x] [Structured Outputs][2] ([example](examples/structured-outputs))
    - [ ] ReAct
- [x] Multi-agent orchestration
    - [x] Agent Discovery
    - [x] Static orchestration
        - [x] Sequential
        - [x] Parallel
    - [x] Dynamic orchestration
        - [x] Dynamic Triage
        - [x] Handoffs (based on async Swarm)
- [x] Support any LLM
- [x] Support [Model Context Protocol][3] ([example](examples/mcp))
- [x] [CoS](coagent/cos) (Multi-language support)
    - [x] [Python](examples/cos/cos.py)
    - [x] [Node.js](examples/cos/cos.js)
    - [x] [Go](examples/cos/goagent)
    - [ ] Zig
    - [ ] Rust


## Three-tier Architecture

<p align="center">
<img src="assets/coagent-three-tier-architecture.png" height="500">
</p>


## Installation

```bash
pip install coagent-python
```

To install with A2A support:

```bash
pip install "coagent-python[a2a]"
```


## Quick Start


### Monolithic

Implement the agent:

```python
# translator.py

import asyncio
import os

from coagent.agents import ChatAgent, ChatMessage, Model
from coagent.core import AgentSpec, new, init_logger
from coagent.runtimes import LocalRuntime

translator = AgentSpec(
    "translator",
    new(
        ChatAgent,
        system="You are a professional translator that can translate Chinese to English.",
        model=Model(id="openai/gpt-4o", api_key=os.getenv("OPENAI_API_KEY")),
    ),
)


async def main():
    async with LocalRuntime() as runtime:
        await runtime.register(translator)

        result = await translator.run(
            ChatMessage(role="user", content="你好,世界").encode(),
            stream=True,
        )
        async for chunk in result:
            msg = ChatMessage.decode(chunk)
            print(msg.content, end="", flush=True)


if __name__ == "__main__":
    init_logger()
    asyncio.run(main())
```

Run the agent:

```bash
export OPENAI_API_KEY="your-openai-key"
python translator.py
```


### Distributed

Start a NATS server ([docs][4]):

```bash
docker run -p 4222:4222 --name nats-server -ti nats:latest
```

Implement the agent:

```python
# translator.py

import asyncio
import os

from coagent.agents import ChatAgent, Model
from coagent.core import AgentSpec, new, init_logger
from coagent.runtimes import NATSRuntime

translator = AgentSpec(
    "translator",
    new(
        ChatAgent,
        system="You are a professional translator that can translate Chinese to English.",
        model=Model(id="openai/gpt-4o", api_key=os.getenv("OPENAI_API_KEY")),
    ),
)


async def main():
    async with NATSRuntime.from_servers("nats://localhost:4222") as runtime:
        await runtime.register(translator)
        await runtime.wait_for_shutdown()


if __name__ == "__main__":
    init_logger()
    asyncio.run(main())
```

Run the agent as a daemon:

```bash
export OPENAI_API_KEY="your-openai-key"
python translator.py
```

Communicate with the agent using the `coagent` CLI:

```bash
coagent translator -H type:ChatMessage --chat -d '{"role": "user", "content": "你好,世界"}'
```


## Patterns

(The following patterns are mainly inspired by [Anthropic's Building effective agents][5] and [OpenAI's Handoffs][6].)

### Basic: Augmented LLM

**Augmented LLM** is an LLM enhanced with augmentations such as retrieval, tools, and memory. Our current models can actively use these capabilities—generating their own search queries, selecting appropriate tools, and determining what information to retain.

<p align="center">
<img src="assets/patterns-augmented-llm.png">
</p>

**Example** (see [examples/patterns/augmented_llm.py](examples/patterns/augmented_llm.py) for a runnable example):

```python
from coagent.agents import ChatAgent, Model, tool
from coagent.core import AgentSpec, new


class Assistant(ChatAgent):
    system = """You are an agent who can use tools."""
    model = Model(...)

    @tool
    async def query_weather(self, city: str) -> str:
        """Query the weather in the given city."""
        return f"The weather in {city} is sunny."


assistant = AgentSpec("assistant", new(Assistant))
```

### Workflow: Chaining

**Chaining** decomposes a task into a sequence of steps, where each agent processes the output of the previous one.

<p align="center">
<img src="assets/patterns-chaining.png">
</p>

**When to use this workflow:** This workflow is ideal for situations where the task can be easily and cleanly decomposed into fixed subtasks. The main goal is to trade off latency for higher accuracy, by making each agent an easier task.

**Example** (see [examples/patterns/chaining.py](examples/patterns/chaining.py) for a runnable example):

```python
from coagent.agents import ChatAgent, Sequential, Model
from coagent.core import AgentSpec, new

model = Model(...)

extractor = AgentSpec(
    "extractor",
    new(
        ChatAgent,
        system="""\
Extract only the numerical values and their associated metrics from the text.
Format each as 'value: metric' on a new line.
Example format:
92: customer satisfaction
45%: revenue growth\
""",
        model=model,
    ),
)

converter = AgentSpec(
    "converter",
    new(
        ChatAgent,
        system="""\
Convert all numerical values to percentages where possible.
If not a percentage or points, convert to decimal (e.g., 92 points -> 92%).
Keep one number per line.
Example format:
92%: customer satisfaction
45%: revenue growth\
""",
        model=model,
    ),
)

sorter = AgentSpec(
    "sorter",
    new(
        ChatAgent,
        system="""\
Sort all lines in descending order by numerical value.
Keep the format 'value: metric' on each line.
Example:
92%: customer satisfaction
87%: employee satisfaction\
""",
        model=model,
    ),
)

formatter = AgentSpec(
    "formatter",
    new(
        ChatAgent,
        system="""\
Format the sorted data as a markdown table with columns:
| Metric | Value |
|:--|--:|
| Customer Satisfaction | 92% |\
""",
        model=model,
    ),
)

chain = AgentSpec(
    "chain", new(Sequential, "extractor", "converter", "sorter", "formatter")
)
```

### Workflow: Parallelization

**Parallelization** distributes independent subtasks across multiple agents for concurrent processing.

<p align="center">
<img src="assets/patterns-parallelization.png">
</p>

**When to use this workflow:** Parallelization is effective when the divided subtasks can be parallelized for speed, or when multiple perspectives or attempts are needed for higher confidence results.

**Example** (see [examples/patterns/parallelization.py](examples/patterns/parallelization.py) for a runnable example):

```python
from coagent.agents import Aggregator, ChatAgent, Model, Parallel
from coagent.core import AgentSpec, new

model = Model(...)

customer = AgentSpec(
    "customer",
    new(
        ChatAgent,
        system="""\
Customers:
- Price sensitive
- Want better tech
- Environmental concerns\
""",
        model=model,
    ),
)

employee = AgentSpec(
    "employee",
    new(
        ChatAgent,
        system="""\
Employees:
- Job security worries
- Need new skills
- Want clear direction\
""",
        model=model,
    ),
)

investor = AgentSpec(
    "investor",
    new(
        ChatAgent,
        system="""\
Investors:
- Expect growth
- Want cost control
- Risk concerns\
""",
        model=model,
    ),
)

supplier = AgentSpec(
    "supplier",
    new(
        ChatAgent,
        system="""\
Suppliers:
- Capacity constraints
- Price pressures
- Tech transitions\
""",
        model=model,
    ),
)

aggregator = AgentSpec("aggregator", new(Aggregator))

parallel = AgentSpec(
    "parallel",
    new(
        Parallel,
        "customer",
        "employee",
        "investor",
        "supplier",
        aggregator="aggregator",
    ),
)
```


### Workflow: Triaging & Routing

**Triaging** classifies an input and directs it to a specialized followup agent. This workflow allows for separation of concerns, and building more specialized agents.

<p align="center">
<img src="assets/patterns-triaging.png">
</p>

**When to use this workflow:** This workflow works well for complex tasks where there are distinct categories that are better handled separately, and where classification can be handled accurately, either by an LLM (using Prompting or Function-calling) or a more traditional classification model/algorithm.

**Example** (see [examples/patterns/triaging.py](examples/patterns/triaging.py) for a runnable example):

```python
from coagent.agents import ChatAgent, DynamicTriage, Model
from coagent.core import AgentSpec, new

model = Model(...)

billing = AgentSpec(
    "team.billing",  # Under the team namespace
    new(
        ChatAgent,
        system="""\
You are a billing support specialist. Follow these guidelines:
1. Always start with "Billing Support Response:"
2. First acknowledge the specific billing issue
3. Explain any charges or discrepancies clearly
4. List concrete next steps with timeline
5. End with payment options if relevant

Keep responses professional but friendly.\
""",
        model=model,
    ),
)

account = AgentSpec(
    "team.account",  # Under the team namespace
    new(
        ChatAgent,
        system="""\
You are an account security specialist. Follow these guidelines:
1. Always start with "Account Support Response:"
2. Prioritize account security and verification
3. Provide clear steps for account recovery/changes
4. Include security tips and warnings
5. Set clear expectations for resolution time

Maintain a serious, security-focused tone.\
""",
        model=model,
    ),
)

triage = AgentSpec(
    "triage",
    new(
        DynamicTriage,
        system="""You are a triage agent who will delegate to sub-agents based on the conversation content.""",
        model=model,
        namespace="team",  # Collect all sub-agents under the team namespace
    ),
)
```


## Examples

- [patterns](examples/patterns)
- [a2a](examples/a2a)
- [mcp](examples/mcp)
- [mcp-new](examples/mcp-new)
- [structured-outputs](examples/structured-outputs)
- [deepseek-r1](examples/deepseek-r1)
- [translator](examples/translator)
- [discovery](examples/discovery)
- [notification](examples/notification)
- [app-builder](examples/app-builder)
- [opencsg](examples/opencsg)
- [framework-integration](examples/framework-integration)
- [ping-pong](examples/ping-pong)
- [stream-ping-pong](examples/stream-ping-pong)
- [cos](examples/cos)


[1]: https://docs.nats.io/nats-concepts/jetstream
[2]: https://platform.openai.com/docs/guides/structured-outputs
[3]: https://modelcontextprotocol.io/introduction
[4]: https://docs.nats.io/running-a-nats-service/nats_docker/nats-docker-tutorial
[5]: https://www.anthropic.com/research/building-effective-agents
[6]: https://cookbook.openai.com/examples/orchestrating_agents


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OpenCSGs/coagent",
    "name": "coagent-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.10.0",
    "maintainer_email": null,
    "keywords": null,
    "author": "RussellLuo",
    "author_email": "luopeng.he@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/93/bb/3d325b6743e741e866ce2390bb96c44a4e4ca14e96bfc2da1d16ca6d2743/coagent_python-0.0.6.tar.gz",
    "platform": null,
    "description": "# Coagent\n[![CI](https://github.com/OpenCSGs/coagent/actions/workflows/ci.yml/badge.svg)](https://github.com/OpenCSGs/coagent/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)\n\nAn open-source framework for building monolithic or distributed agentic systems, ranging from simple LLM calls to compositional workflows and autonomous agents.\n\n\n<p align=\"center\">\n<img src=\"assets/coagent-overview.png\" height=\"600\">\n</p>\n\n\n## Latest Updates\n\n- \ud83d\ude80 **2025-07-18**: Added support for [A2A](https://a2a-protocol.org/), check out the [example](examples/a2a).\n- **2025-02-08**: Added support for [DeepSeek-R1](https://api-docs.deepseek.com/news/news250120), check out the [example](examples/deepseek-r1).\n- **2025-01-28**: Added support for [Structured Outputs][2].\n- **2025-01-22**: Added support for [Model Context Protocol][3].\n- **2025-01-17**: Added integration with [LiteLLM](https://github.com/BerriAI/litellm).\n\n\n## Features\n\n- [x] Event-driven & Scalable on-demand\n- [x] Monolithic or Distributed\n    - [x] Local Runtime (In-process Runtime)\n    - [x] HTTP Runtime (HTTP-based Distributed Runtime)\n    - [x] NATS Runtime (NATS-based Distributed Runtime)\n        - [ ] Using NATS [JetStream][1]\n- [x] Single-agent\n    - [x] [Function calling](https://platform.openai.com/docs/guides/function-calling)\n    - [x] [Structured Outputs][2] ([example](examples/structured-outputs))\n    - [ ] ReAct\n- [x] Multi-agent orchestration\n    - [x] Agent Discovery\n    - [x] Static orchestration\n        - [x] Sequential\n        - [x] Parallel\n    - [x] Dynamic orchestration\n        - [x] Dynamic Triage\n        - [x] Handoffs (based on async Swarm)\n- [x] Support any LLM\n- [x] Support [Model Context Protocol][3] ([example](examples/mcp))\n- [x] [CoS](coagent/cos) (Multi-language support)\n    - [x] [Python](examples/cos/cos.py)\n    - [x] [Node.js](examples/cos/cos.js)\n    - [x] [Go](examples/cos/goagent)\n    - [ ] Zig\n    - [ ] Rust\n\n\n## Three-tier Architecture\n\n<p align=\"center\">\n<img src=\"assets/coagent-three-tier-architecture.png\" height=\"500\">\n</p>\n\n\n## Installation\n\n```bash\npip install coagent-python\n```\n\nTo install with A2A support:\n\n```bash\npip install \"coagent-python[a2a]\"\n```\n\n\n## Quick Start\n\n\n### Monolithic\n\nImplement the agent:\n\n```python\n# translator.py\n\nimport asyncio\nimport os\n\nfrom coagent.agents import ChatAgent, ChatMessage, Model\nfrom coagent.core import AgentSpec, new, init_logger\nfrom coagent.runtimes import LocalRuntime\n\ntranslator = AgentSpec(\n    \"translator\",\n    new(\n        ChatAgent,\n        system=\"You are a professional translator that can translate Chinese to English.\",\n        model=Model(id=\"openai/gpt-4o\", api_key=os.getenv(\"OPENAI_API_KEY\")),\n    ),\n)\n\n\nasync def main():\n    async with LocalRuntime() as runtime:\n        await runtime.register(translator)\n\n        result = await translator.run(\n            ChatMessage(role=\"user\", content=\"\u4f60\u597d\uff0c\u4e16\u754c\").encode(),\n            stream=True,\n        )\n        async for chunk in result:\n            msg = ChatMessage.decode(chunk)\n            print(msg.content, end=\"\", flush=True)\n\n\nif __name__ == \"__main__\":\n    init_logger()\n    asyncio.run(main())\n```\n\nRun the agent:\n\n```bash\nexport OPENAI_API_KEY=\"your-openai-key\"\npython translator.py\n```\n\n\n### Distributed\n\nStart a NATS server ([docs][4]):\n\n```bash\ndocker run -p 4222:4222 --name nats-server -ti nats:latest\n```\n\nImplement the agent:\n\n```python\n# translator.py\n\nimport asyncio\nimport os\n\nfrom coagent.agents import ChatAgent, Model\nfrom coagent.core import AgentSpec, new, init_logger\nfrom coagent.runtimes import NATSRuntime\n\ntranslator = AgentSpec(\n    \"translator\",\n    new(\n        ChatAgent,\n        system=\"You are a professional translator that can translate Chinese to English.\",\n        model=Model(id=\"openai/gpt-4o\", api_key=os.getenv(\"OPENAI_API_KEY\")),\n    ),\n)\n\n\nasync def main():\n    async with NATSRuntime.from_servers(\"nats://localhost:4222\") as runtime:\n        await runtime.register(translator)\n        await runtime.wait_for_shutdown()\n\n\nif __name__ == \"__main__\":\n    init_logger()\n    asyncio.run(main())\n```\n\nRun the agent as a daemon:\n\n```bash\nexport OPENAI_API_KEY=\"your-openai-key\"\npython translator.py\n```\n\nCommunicate with the agent using the `coagent` CLI:\n\n```bash\ncoagent translator -H type:ChatMessage --chat -d '{\"role\": \"user\", \"content\": \"\u4f60\u597d\uff0c\u4e16\u754c\"}'\n```\n\n\n## Patterns\n\n(The following patterns are mainly inspired by [Anthropic's Building effective agents][5] and [OpenAI's Handoffs][6].)\n\n### Basic: Augmented LLM\n\n**Augmented LLM** is an LLM enhanced with augmentations such as retrieval, tools, and memory. Our current models can actively use these capabilities\u2014generating their own search queries, selecting appropriate tools, and determining what information to retain.\n\n<p align=\"center\">\n<img src=\"assets/patterns-augmented-llm.png\">\n</p>\n\n**Example** (see [examples/patterns/augmented_llm.py](examples/patterns/augmented_llm.py) for a runnable example):\n\n```python\nfrom coagent.agents import ChatAgent, Model, tool\nfrom coagent.core import AgentSpec, new\n\n\nclass Assistant(ChatAgent):\n    system = \"\"\"You are an agent who can use tools.\"\"\"\n    model = Model(...)\n\n    @tool\n    async def query_weather(self, city: str) -> str:\n        \"\"\"Query the weather in the given city.\"\"\"\n        return f\"The weather in {city} is sunny.\"\n\n\nassistant = AgentSpec(\"assistant\", new(Assistant))\n```\n\n### Workflow: Chaining\n\n**Chaining** decomposes a task into a sequence of steps, where each agent processes the output of the previous one.\n\n<p align=\"center\">\n<img src=\"assets/patterns-chaining.png\">\n</p>\n\n**When to use this workflow:** This workflow is ideal for situations where the task can be easily and cleanly decomposed into fixed subtasks. The main goal is to trade off latency for higher accuracy, by making each agent an easier task.\n\n**Example** (see [examples/patterns/chaining.py](examples/patterns/chaining.py) for a runnable example):\n\n```python\nfrom coagent.agents import ChatAgent, Sequential, Model\nfrom coagent.core import AgentSpec, new\n\nmodel = Model(...)\n\nextractor = AgentSpec(\n    \"extractor\",\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nExtract only the numerical values and their associated metrics from the text.\nFormat each as 'value: metric' on a new line.\nExample format:\n92: customer satisfaction\n45%: revenue growth\\\n\"\"\",\n        model=model,\n    ),\n)\n\nconverter = AgentSpec(\n    \"converter\",\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nConvert all numerical values to percentages where possible.\nIf not a percentage or points, convert to decimal (e.g., 92 points -> 92%).\nKeep one number per line.\nExample format:\n92%: customer satisfaction\n45%: revenue growth\\\n\"\"\",\n        model=model,\n    ),\n)\n\nsorter = AgentSpec(\n    \"sorter\",\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nSort all lines in descending order by numerical value.\nKeep the format 'value: metric' on each line.\nExample:\n92%: customer satisfaction\n87%: employee satisfaction\\\n\"\"\",\n        model=model,\n    ),\n)\n\nformatter = AgentSpec(\n    \"formatter\",\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nFormat the sorted data as a markdown table with columns:\n| Metric | Value |\n|:--|--:|\n| Customer Satisfaction | 92% |\\\n\"\"\",\n        model=model,\n    ),\n)\n\nchain = AgentSpec(\n    \"chain\", new(Sequential, \"extractor\", \"converter\", \"sorter\", \"formatter\")\n)\n```\n\n### Workflow: Parallelization\n\n**Parallelization** distributes independent subtasks across multiple agents for concurrent processing.\n\n<p align=\"center\">\n<img src=\"assets/patterns-parallelization.png\">\n</p>\n\n**When to use this workflow:** Parallelization is effective when the divided subtasks can be parallelized for speed, or when multiple perspectives or attempts are needed for higher confidence results.\n\n**Example** (see [examples/patterns/parallelization.py](examples/patterns/parallelization.py) for a runnable example):\n\n```python\nfrom coagent.agents import Aggregator, ChatAgent, Model, Parallel\nfrom coagent.core import AgentSpec, new\n\nmodel = Model(...)\n\ncustomer = AgentSpec(\n    \"customer\",\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nCustomers:\n- Price sensitive\n- Want better tech\n- Environmental concerns\\\n\"\"\",\n        model=model,\n    ),\n)\n\nemployee = AgentSpec(\n    \"employee\",\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nEmployees:\n- Job security worries\n- Need new skills\n- Want clear direction\\\n\"\"\",\n        model=model,\n    ),\n)\n\ninvestor = AgentSpec(\n    \"investor\",\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nInvestors:\n- Expect growth\n- Want cost control\n- Risk concerns\\\n\"\"\",\n        model=model,\n    ),\n)\n\nsupplier = AgentSpec(\n    \"supplier\",\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nSuppliers:\n- Capacity constraints\n- Price pressures\n- Tech transitions\\\n\"\"\",\n        model=model,\n    ),\n)\n\naggregator = AgentSpec(\"aggregator\", new(Aggregator))\n\nparallel = AgentSpec(\n    \"parallel\",\n    new(\n        Parallel,\n        \"customer\",\n        \"employee\",\n        \"investor\",\n        \"supplier\",\n        aggregator=\"aggregator\",\n    ),\n)\n```\n\n\n### Workflow: Triaging & Routing\n\n**Triaging** classifies an input and directs it to a specialized followup agent. This workflow allows for separation of concerns, and building more specialized agents.\n\n<p align=\"center\">\n<img src=\"assets/patterns-triaging.png\">\n</p>\n\n**When to use this workflow:** This workflow works well for complex tasks where there are distinct categories that are better handled separately, and where classification can be handled accurately, either by an LLM (using Prompting or Function-calling) or a more traditional classification model/algorithm.\n\n**Example** (see [examples/patterns/triaging.py](examples/patterns/triaging.py) for a runnable example):\n\n```python\nfrom coagent.agents import ChatAgent, DynamicTriage, Model\nfrom coagent.core import AgentSpec, new\n\nmodel = Model(...)\n\nbilling = AgentSpec(\n    \"team.billing\",  # Under the team namespace\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nYou are a billing support specialist. Follow these guidelines:\n1. Always start with \"Billing Support Response:\"\n2. First acknowledge the specific billing issue\n3. Explain any charges or discrepancies clearly\n4. List concrete next steps with timeline\n5. End with payment options if relevant\n\nKeep responses professional but friendly.\\\n\"\"\",\n        model=model,\n    ),\n)\n\naccount = AgentSpec(\n    \"team.account\",  # Under the team namespace\n    new(\n        ChatAgent,\n        system=\"\"\"\\\nYou are an account security specialist. Follow these guidelines:\n1. Always start with \"Account Support Response:\"\n2. Prioritize account security and verification\n3. Provide clear steps for account recovery/changes\n4. Include security tips and warnings\n5. Set clear expectations for resolution time\n\nMaintain a serious, security-focused tone.\\\n\"\"\",\n        model=model,\n    ),\n)\n\ntriage = AgentSpec(\n    \"triage\",\n    new(\n        DynamicTriage,\n        system=\"\"\"You are a triage agent who will delegate to sub-agents based on the conversation content.\"\"\",\n        model=model,\n        namespace=\"team\",  # Collect all sub-agents under the team namespace\n    ),\n)\n```\n\n\n## Examples\n\n- [patterns](examples/patterns)\n- [a2a](examples/a2a)\n- [mcp](examples/mcp)\n- [mcp-new](examples/mcp-new)\n- [structured-outputs](examples/structured-outputs)\n- [deepseek-r1](examples/deepseek-r1)\n- [translator](examples/translator)\n- [discovery](examples/discovery)\n- [notification](examples/notification)\n- [app-builder](examples/app-builder)\n- [opencsg](examples/opencsg)\n- [framework-integration](examples/framework-integration)\n- [ping-pong](examples/ping-pong)\n- [stream-ping-pong](examples/stream-ping-pong)\n- [cos](examples/cos)\n\n\n[1]: https://docs.nats.io/nats-concepts/jetstream\n[2]: https://platform.openai.com/docs/guides/structured-outputs\n[3]: https://modelcontextprotocol.io/introduction\n[4]: https://docs.nats.io/running-a-nats-service/nats_docker/nats-docker-tutorial\n[5]: https://www.anthropic.com/research/building-effective-agents\n[6]: https://cookbook.openai.com/examples/orchestrating_agents\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An open-source framework for building monolithic or distributed agentic systems, ranging from simple LLM calls to compositional workflows and autonomous agents.",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/OpenCSGs/coagent",
        "Repository": "https://github.com/OpenCSGs/coagent"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a0146d967298ac5477335c4e40cb65689899b98d329da6f3ff9a69e1b83bc0e3",
                "md5": "983b8d7c999d59ccf6298083fe913c6e",
                "sha256": "d39174f557aa3410fb97ba66365dca7809f29b9df73de3007f41135a26e5665c"
            },
            "downloads": -1,
            "filename": "coagent_python-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "983b8d7c999d59ccf6298083fe913c6e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.10.0",
            "size": 82106,
            "upload_time": "2025-07-25T08:18:34",
            "upload_time_iso_8601": "2025-07-25T08:18:34.051088Z",
            "url": "https://files.pythonhosted.org/packages/a0/14/6d967298ac5477335c4e40cb65689899b98d329da6f3ff9a69e1b83bc0e3/coagent_python-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "93bb3d325b6743e741e866ce2390bb96c44a4e4ca14e96bfc2da1d16ca6d2743",
                "md5": "278ce80971674b5b42d3169418c16f06",
                "sha256": "371af5fc791f6da8cfdd87bea3e3ef8c3c90a50a5949b77e4928d8236930d028"
            },
            "downloads": -1,
            "filename": "coagent_python-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "278ce80971674b5b42d3169418c16f06",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.10.0",
            "size": 66693,
            "upload_time": "2025-07-25T08:18:35",
            "upload_time_iso_8601": "2025-07-25T08:18:35.469119Z",
            "url": "https://files.pythonhosted.org/packages/93/bb/3d325b6743e741e866ce2390bb96c44a4e4ca14e96bfc2da1d16ca6d2743/coagent_python-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-25 08:18:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OpenCSGs",
    "github_project": "coagent",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "coagent-python"
}
        
Elapsed time: 0.45749s