A modern Python library for building multi-agent communication systems with LLM integration
Project description
Flowtic
Build agent workflows that actually talk to each other. No complex orchestration, just simple communication patterns that work.
What it does
- Agent sessions: Each agent keeps its own conversation history (text + images)
- Tool system: Write functions once, agents use them automatically
- Communication graph: Tell agents who can talk to whom with simple syntax
- Callbacks: Hook into conversations for logging, user input, whatever you need
Install
pip install git+https://github.com/PrAsAnNaRePo/Flowtic.git
Quick start
Single agent with tools
from flowtic import Agent, Tool, Tools
def calculate(expression: str):
return str(eval(expression)), None
calc_tool = Tool(
tool_definition={
"type": "function",
"function": {
"name": "calculate",
"description": "Calculate math expressions",
"parameters": {
"type": "object",
"properties": {
"expression": {"type": "string", "description": "Math expression"}
},
"required": ["expression"]
}
}
},
tool_execution=calculate
)
agent = Agent(
agent_name="calculator",
model_name="gpt-4o", # any litellm model
instructions="You help with math problems.",
tools=Tools([calc_tool])
)
result = agent("What's 15 * 23?")
Multi-agent workflow
from flowtic import Agent, CommunicationProtocol
# Create agents
analyst = Agent(
agent_name="analyst",
model_name="gpt-4o",
instructions="Analyze requirements and ask clarifying questions.",
allow_user_input=True # can talk to user
)
coder = Agent(
agent_name="coder",
model_name="gpt-4o",
instructions="Write code based on requirements.",
allow_user_input=False # only talks to other agents
)
# Set up who talks to whom
protocol = CommunicationProtocol(
"analyst<->coder", # bidirectional
[analyst, coder]
)
# Start the workflow
protocol.execute("Build a simple todo app")
Communication patterns
The syntax is dead simple:
A->Bmeans A can send messages to BA<->Bmeans they can talk both waysA->B, B->Cchains them togetherA<->B, A->Cmeans A talks to both B and C
When agents communicate, they automatically get tools to message each other. No setup needed.
Images and multimodal
# Agent automatically handles images
agent("Here's a screenshot", images=["path/to/image.png"])
# Works with URLs and base64 too
agent("Analyze this", images=["https://example.com/chart.png"])
Custom callbacks
from flowtic import Callback
class MyCallbacks(Callback):
def on_user_loop(self, agent_name, message):
return input(f"{agent_name}: {message}\n> ")
def on_tool_call(self, agent_name, tool_name, args):
print(f"{agent_name} is using {tool_name}")
agent = Agent(
agent_name="helper",
model_name="gpt-4o",
callbacks=MyCallbacks()
)
Session management
Each agent keeps its own conversation buffer. Even if multiple agents reuse the same SessionManager, their histories stay isolated by agent name:
from flowtic import SessionManager
session_store = SessionManager()
agent1 = Agent(
agent_name="researcher",
model_name="gpt-4o",
session=session_store
)
agent2 = Agent(
agent_name="writer",
model_name="gpt-4o",
session=session_store
)
# The writer still has its own memory
agent1("Find info about climate change")
agent2("Write a summary based on what the researcher found")
If you want agents to share context, use agent-to-agent communication. CommunicationProtocol injects _spin_into, so one agent can explicitly hand context to another instead of silently sharing history.
Sessions handle images automatically - no extra work needed:
session = SessionManager()
# Add context manually if needed
session.add_user_context("my_agent",
text="Here's the data",
images=["chart1.png", "chart2.png"]
)
# Get the full conversation
history = session.get_buffer_memory("my_agent")
That's it
Three main pieces: agents that remember conversations, tools they can use, and simple rules for who talks to whom. Everything else just works.
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 flowtic-1.6.1.tar.gz.
File metadata
- Download URL: flowtic-1.6.1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed3783f3aef5e6d4f4728e32272f201960d4ddeb6e2b918fd0958832aaab1c92
|
|
| MD5 |
b122a96e27ea095c8f2ed597aabc1321
|
|
| BLAKE2b-256 |
faf1a24676ce4acb452b241f692735c613bcddb1bbeb552dfb65d5e47548e79f
|
File details
Details for the file flowtic-1.6.1-py3-none-any.whl.
File metadata
- Download URL: flowtic-1.6.1-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
391fade266aaebd7d62a86e2b656190e7fc6ab136d558800c5652d81fcf5b4ae
|
|
| MD5 |
e6a0e0fcc352efcedcc533729ac41353
|
|
| BLAKE2b-256 |
b30d03cf4dc8aa448726352acd5a8761003114204ea2117f685e723c8bf0e9ed
|