A simple framework for creating distributed llm agent swarms
Project description
AgentKit
Overview
AgentKit is a simple framework designed to facilitate the networked communication between agents in distributed systems. It enables the creation, management, and coordination of intelligent agents over a network, fostering complex data-driven decision processes and automated tasks with minimal human intervention. This toolkit, built with Python, focuses on ease-of-use, efficiency, and scalability, making it ideal for applications beyond conversational agents, but also in IoT, smart home systems, and automation tasks.
Installation
Install AgentKit using pip:
pip install agentkit
Ensure you have Python 3.10 or higher installed to meet the compatibility requirements.
Features
Simplified Agent Framework
-
Easy to Create and Manage Agents: The framework facilitates lightweight and straightforward implementation of agents, with a simple interface for sending and receiving messages. AgentKit is suitable for developers seeking to build systems with complex interactions but straightforward code.
-
Asynchronous Operation Supported: The architecture supports asynchronous operations, essential for maintaining high performance in distributed systems where blocking operations can create bottlenecks.
-
Built-in Logging and Monitoring: Integrated logging tracks message flows and system activity, providing valuable insights during development and troubleshooting phases.
Model Context Protocol (MCP) Integration
- Per-agent MCP tool catalogs: Each agent can declare its own list of MCP servers. Tools discovered from those servers are automatically surfaced through the AgentKit functions registry, allowing LLM-driven planners to call them like any other function.
- Namespace isolation: Tools are exposed using a
<server>::<tool>naming convention so that specialized agents can connect to different MCP stacks without name collisions. - Powered by the official SDK: AgentKit now depends on the
mcppackage, ensuring first-class support for the Model Context Protocol standard and future enhancements.
Sample snippet from an agent configuration:
"mcp_servers": [
{
"name": "filesystem",
"transport": "stdio",
"command": "python",
"args": ["-m", "mcp_servers.fs"],
"namespace": "fs"
}
]
Why AgentKit?
AgentKit simplifies the creation and management of networked agent systems, making it an invaluable tool for a variety of innovative applications:
Real-Time Data Processing
Enables agents to collect, process, and react to real-time data across various domains. This is crucial for environments where timely data analysis and decision-making are key.
Automated and Intelligent Decision Making
Facilitates autonomous systems that learn from data to make decisions independently of human input, optimizing processes through dynamic response to environmental variables.
Enhanced Connectivity and Flexibility
Allows for the deployment of agents across diverse and geographically dispersed environments, making it possible to manage complex systems from centralized or various locations.
Research and Development
Aids in the simulation and modeling of complex systems to facilitate research and theoretical analysis without physical constraints.
Getting Started
Refer to the examples directory to see a simple chat agent implementation. Comprehensive documentation will be provided soon!
Using the AgentRunner Utility
For simplified agent creation and lifecycle management, AgentKit provides the AgentRunner utility:
import asyncio
from pathlib import Path
from agentkit.utils import AgentRunner
async def main():
runner = AgentRunner(
name="Julia",
description="A friendly AI assistant",
model="ollama/qwen3",
agent_home=str(Path("agentkit/examples/agent_homes/Julia").resolve())
)
await runner.run()
if __name__ == "__main__":
asyncio.run(main())
This utility handles:
- Agent creation with sensible defaults
- Message receiver setup and registration
- Signal handling for graceful shutdown
- Proper resource cleanup
TODO: Add more examples of AgentRunner configuration options
Agent Home Convention
AgentKit now uses a per-agent home directory for durable state, working files, and prompt instructions.
Each configured agent must provide agent_home, and that directory must contain an AGENTS.md file. The content of AGENTS.md is loaded as the system prompt.
Expected layout:
<agent_home>/
AGENTS.md
state/
tasks/
workspace/
logs/
The runtime ensures these subdirectories exist when the agent is loaded.
Example sophia_task_agent.json:
{
"name": "Sophia",
"description": "A thoughtful task-aware assistant who can plan, delegate, and execute tools.",
"agent_home": "../agent_homes/Sophia",
"model": "ollama/qwen3-coder:480b-cloud",
"planner_model": "ollama/qwen3-coder:480b-cloud",
"user_prompt": "Conversation history:\n{context}\nSophia:",
"bus_ip": "127.0.0.1"
}
Documentation
Still in the works. Refer to the source docstrings for documentation for now.
Quick Start Guide
Running the Data Bus
The Networkkit project which spun off from this project has a Data bus implementation that handles the communication aspects of the agents. To start the Data Bus, use the following command:
python -m networkkit.databus
This command initializes the Data Hub, which listens for incoming messages from agents and handles their distribution across the network using the Pub-Sub model. Networkkit should be installed as part of a dependancy of Agentkit.
Running the Example Chat Bot Agent
To run a chat bot agent that utilizes the Data Bub for sending and receiving messages, follow these steps:
-
Download or Clone the Repository: Ensure you have the latest version of the example files from the
examplesdirectory. -
Configure the Agent: Examine and modify the configuration file (
simple_chat.json) to fit your setup. By default, the agent is configured to interact with Ollama running on localhost. Ensure each agent has anagent_homepath and thatAGENTS.mdexists there.Update the configuration settings for the model and identity as necessary. For using other LLMs like OpenAI's models, refer to the Litellm documentation for details on specifying API keys and model settings.
-
Run the Chat Bot: Execute the following command to start the chat bot:
python ./config_agent.py --config ./config/simple_chat.json
This script will initiate the chat bot that communicates through the Data Hub using the specified LLM settings.
Running the Example Human Agent
To interact with the LLM-powered chat bot above, launch the agent with the human_agent.json as the configuration file so you can send it chat messages and interact with it:
python ./config_agent.py --config ./config/human_agent.json --loglevel WARN
Once the prompt appears, you can use a multi-agent chat-room style interface:
- Plain text sends to the current channel (broadcast as
ALL) /join <channel>switches channels (default#general)/dm <agent> <message>sends a direct message/reply <message>replies to the most recent sender/agentslists discovered agents/history [N]shows recent timeline entries/helpshows all commands
Japanese input/output is supported out of the box (UTF-8).
Further Assistance
Should you need further assistance, consult the source code or submit an issue on GitHub for support.
Contributing
Contributions are welcome!
Please review our issues section or send a PR on GitHub if you're interested in improving AgentKit.
License
AgentKit is licensed under the MIT License. See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentkit-0.0.4.tar.gz.
File metadata
- Download URL: agentkit-0.0.4.tar.gz
- Upload date:
- Size: 81.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2f3d9fa0dd3c95f466f228be646be6413205a434b73ae0adf5b8a1fbe975e55
|
|
| MD5 |
795b2b49ed6ea9a70d5403bd95c05285
|
|
| BLAKE2b-256 |
2390be67fed32192a4c778764dc8cc7f8ba1e57dc7f86c642a13701b7c28a3a4
|
Provenance
The following attestation bundles were made for agentkit-0.0.4.tar.gz:
Publisher:
release.yaml on japanvik/agentkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentkit-0.0.4.tar.gz -
Subject digest:
d2f3d9fa0dd3c95f466f228be646be6413205a434b73ae0adf5b8a1fbe975e55 - Sigstore transparency entry: 1013331072
- Sigstore integration time:
-
Permalink:
japanvik/agentkit@2f31116a64e578b9afd543017afcc55472e8f675 -
Branch / Tag:
refs/tags/0.0.4 - Owner: https://github.com/japanvik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@2f31116a64e578b9afd543017afcc55472e8f675 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentkit-0.0.4-py3-none-any.whl.
File metadata
- Download URL: agentkit-0.0.4-py3-none-any.whl
- Upload date:
- Size: 108.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f900c760a45b1c0cae51726c13b90548cca9aa2e43a5a0cec09a20783c9841f7
|
|
| MD5 |
05b726919f3a49b992a238acf176e4d3
|
|
| BLAKE2b-256 |
be1852eb79bd9d65a8a3dfdd01cabc57fc7314ee225e549cfbd26897e64b0716
|
Provenance
The following attestation bundles were made for agentkit-0.0.4-py3-none-any.whl:
Publisher:
release.yaml on japanvik/agentkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentkit-0.0.4-py3-none-any.whl -
Subject digest:
f900c760a45b1c0cae51726c13b90548cca9aa2e43a5a0cec09a20783c9841f7 - Sigstore transparency entry: 1013331096
- Sigstore integration time:
-
Permalink:
japanvik/agentkit@2f31116a64e578b9afd543017afcc55472e8f675 -
Branch / Tag:
refs/tags/0.0.4 - Owner: https://github.com/japanvik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@2f31116a64e578b9afd543017afcc55472e8f675 -
Trigger Event:
push
-
Statement type: