Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

composer_agent-0.1.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

composer_agent-0.1.0-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

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

Hashes for composer_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f8aefe66f506a1648cb42bd5438e9ee67078adbd11a1934145293bfc11c56680
MD5 a94596f9c761450a0951a3efacf85cbf
BLAKE2b-256 20201ca29af3dbc0a53ec799c459ff208d0f9fb6781e1ef6594a07e13d7c7533

See more details on using hashes here.

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

Hashes for composer_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b64d0ca092b9c9cd9e5248e985c155e4185a381ad223d954ea8cc99e6dac05d
MD5 57ca4bb294f49a49211bcea2a3d4f710
BLAKE2b-256 faa276ffd0235dcca2c62ef70ae9b0b38a7a79c03b36b0086e13da7c04d1550c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page