switon / thread
Working-conversation and append-only transcript storage for Switon Framework
v1.0.0
2026-08-22 14:34 UTC
Requires
- php: >=8.3
- switon/ai: ^1.0
- switon/core: ^1.0
- switon/event: ^1.0
- switon/llm: ^1.0
Requires (Dev)
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- switon/testing: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Switon's thread directory for application services that want the working conversation and an append-only transcript stored apart from the agent loop.
Highlights
- One leaf: settled turns, the open turn, state, and totals each have their own file under the thread directory.
- Memory stays memory: a thread with no directory is not written, and sealing it dispatches nothing.
- The window stays short: older turns fold into a short head. The transcript keeps the full text.
Installation
composer require switon/thread
Quick Start
@threads is @runtime/threads. Point the thread's directory at a leaf under that root, then create it. A missing directory is left in memory.
$threads->create($thread); $threads->saveTurn($thread); $threads->commit($thread);
commit appends the sealed turn and removes the open-turn file. Load the same directory later with load.
Docs: https://github.com/switon-php/thread/blob/main/docs/README.md
License
MIT.