Thread-based agents with typed streaming, tool-hide rules, branch compression, and optional Django persistence
Project description
Composer
Thread-based agents with typed streaming, tool-hide rules, branch compression, and optional Django persistence.
Install
pip install composer-agent
With chat persistence (Django + SQLite):
pip install composer-agent[django]
composer-migrate
The default database path is ~/.composer/db.sqlite3. Override with COMPOSER_DB_PATH.
Quick start
from composer import Agent, HumanMessage, SystemMessage, Thread
agent = Agent(model="...", base_url="...", api_key="...")
thread = Thread()
SystemMessage("You are a helpful assistant.") | thread
thread.append(HumanMessage("Hello"))
reply = thread.invoke(agent)
print(reply.content)
Chat persistence
See docs/chat_persistence.md for the full guide on ChatProject and ChatSession — create/list/delete projects and sessions, incognito mode, branch graphs, and resuming conversations.
from composer import ChatProject, HumanMessage, SystemMessage
project = ChatProject.create("my-project")
session = project.new_session(name="main")
Development
uv sync --group dev
pytest
python manage.py migrate # uses ./db.sqlite3 in the repo checkout
Publish
uv sync --group dev
python -m build
twine upload --repository testpypi dist/* # test first
twine upload dist/* # production PyPI
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 composer_agent-0.1.0.tar.gz.
File metadata
- Download URL: composer_agent-0.1.0.tar.gz
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8aefe66f506a1648cb42bd5438e9ee67078adbd11a1934145293bfc11c56680
|
|
| MD5 |
a94596f9c761450a0951a3efacf85cbf
|
|
| BLAKE2b-256 |
20201ca29af3dbc0a53ec799c459ff208d0f9fb6781e1ef6594a07e13d7c7533
|
File details
Details for the file composer_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: composer_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 42.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b64d0ca092b9c9cd9e5248e985c155e4185a381ad223d954ea8cc99e6dac05d
|
|
| MD5 |
57ca4bb294f49a49211bcea2a3d4f710
|
|
| BLAKE2b-256 |
faa276ffd0235dcca2c62ef70ae9b0b38a7a79c03b36b0086e13da7c04d1550c
|