Metadata-Version: 2.4
Name: composer-agent
Version: 0.1.0
Summary: Thread-based agents with typed streaming, tool-hide rules, branch compression, and optional Django persistence
Project-URL: Homepage, https://github.com/MM21B038/composer
Project-URL: Documentation, https://github.com/MM21B038/composer/blob/main/docs/chat_persistence.md
Project-URL: Repository, https://github.com/MM21B038/composer
Project-URL: Issues, https://github.com/MM21B038/composer/issues
Author-email: MM21B038 <mg2464109@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agents,langchain,llm,mcp,streaming
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Requires-Dist: deepagents>=0.6.3
Requires-Dist: langchain-core>=1.4.0
Requires-Dist: langchain-mcp-adapters>=0.2.2
Requires-Dist: langchain-openai>=1.2.1
Requires-Dist: langchain-openrouter>=0.2.3
Requires-Dist: langchain>=1.3.1
Requires-Dist: langgraph>=1.2.0
Requires-Dist: numpy>=2.0.0
Requires-Dist: pillow>=11.0.0
Requires-Dist: tiktoken>=0.13.0
Provides-Extra: all
Requires-Dist: django>=5.1; extra == 'all'
Requires-Dist: ipykernel>=7.2.0; extra == 'all'
Requires-Dist: jupyter>=1.1.1; extra == 'all'
Requires-Dist: pytest-django>=4.9; extra == 'all'
Requires-Dist: pytest>=8.0; extra == 'all'
Requires-Dist: python-dotenv>=1.0.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: django>=5.1; extra == 'dev'
Requires-Dist: ipykernel>=7.2.0; extra == 'dev'
Requires-Dist: jupyter>=1.1.1; extra == 'dev'
Requires-Dist: pytest-django>=4.9; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: python-dotenv>=1.0.0; extra == 'dev'
Requires-Dist: twine>=6.0; extra == 'dev'
Provides-Extra: django
Requires-Dist: django>=5.1; extra == 'django'
Description-Content-Type: text/markdown

# Composer

Thread-based agents with typed streaming, tool-hide rules, branch compression, and optional Django persistence.

## Install

```bash
pip install composer-agent
```

With chat persistence (Django + SQLite):

```bash
pip install composer-agent[django]
composer-migrate
```

The default database path is `~/.composer/db.sqlite3`. Override with `COMPOSER_DB_PATH`.

## Quick start

```python
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](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.

```python
from composer import ChatProject, HumanMessage, SystemMessage

project = ChatProject.create("my-project")
session = project.new_session(name="main")
```

## Development

```bash
uv sync --group dev
pytest
python manage.py migrate   # uses ./db.sqlite3 in the repo checkout
```

## Publish

```bash
uv sync --group dev
python -m build
twine upload --repository testpypi dist/*   # test first
twine upload dist/*                         # production PyPI
```
