A compositional framework for dialogue systems.
Project description
DIALOGUS
SYNOPSIS
A compositional framework for AI-based dialogue systems.
DESCRIPTION
Dialogus is a facility for constructing complex conversational systems through the composition of simple, independent processing units. It provides a minimal set of primitives for message passing, transformation, and routing.
The complexity of modern AI applications often leads to brittle, entangled architectures. Dialogus posits that complex behavior emerges not from complex components, but from the rigorous composition of simple ones.
PHILOSOPHY
The design of dialogus is informed by the Unix philosophy:
- Make each program do one thing well (composition over inheritance and monolithic design).
- Expect the output of every program to become the input to another, as yet unknown, program.
- Design and build software to be tried early, ideally within weeks.
- Write programs to handle a universal interface.
- Economy and elegance of design due to constraints ("salvation through suffering").
- Make it easy to write, test, and run programs.
- Self-supporting system: our system is maintained by itself.
- Do not attempt to predict user needs; provide the primitives with which users can solve their own problems.
ARCHITECTURE
The system maps the concepts of Information Theory onto three fundamental primitives.
1. MESSAGE
NAME
Message — the immutable quantum of information.
SYNOPSIS
Message:
content: Any
id: str
name: str
timestamp: int
DESCRIPTION
A Message is a typed, immutable value object serving as the sole unit of exchange between processors.
In dialogus, "everything is a Message" (just as in Unix "everything is a file"). A Message is a discrete, self-identifying packet of typed data.
It is strictly immutable. State is never mutated in place; it is transformed by creating new Messages. This immutability guarantees that the history of a conversation is a perfect, append-only log of information states.
- Identity: Unique ID and timestamp.
- Type: Explicit class definition (e.g.,
UserQuery,LLMResponse) used for routing. - Payload: Rigid, immutable.
2. PROCESSOR
NAME
Processor — the information channel.
SYNOPSIS
Processor[MessageIn, MessageOut]:
task_manager: Optional[TaskManager]
observers: Optional[list[BaseObserver]]
DESCRIPTION
A Processor is a noisy channel that accepts a Message, performs work, and produces a new Message. It is the atom of computation, equivalent to a Unix filter.
The interface is polymorphic. To the framework, there is no distinction between an LLM, a database query, a REST API call, or a conditional logic block. They are all simply Processors.
- Input: Accepts exactly one
Message. The input type is declared via the generic parameterMessageIn. - Output: Returns exactly one
Message. The output type is declared via the generic parameterMessageOut. - Union Types: Union types are supported for both input and output types.
- Type Inference: Input and output types are extracted automatically from the generic parameters at construction time. No manual specification required.
- State: While the interface is functional, the implementation may be stateful (e.g., maintaining chat history or buffer windows).
- TaskManager: The
Processorcan optionally receive aTaskManagerat construction time. If not provided, theCompositewill propagate its ownTaskManagerto theProcessor.
3. COMPOSITE
NAME
Composite — the information topology.
SYNOPSIS
Composite[Message, Message]:
processors: Sequence[Processor]
max_hops: int = 30
DESCRIPTION
A Composite is a Processor that routes messages through a directed graph of processors. It is the Unix pipeline: a composition of filters where the output of one becomes the input of the next.
The routing logic is deterministic and type-driven. Given a Message, the Composite looks up its type in an internal mapping (derived from each processor's generic input types) and dispatches it to the corresponding Processor. The result is fed back into the system until a terminal condition is reached.
- Routing: Message type →
Processorlookup. The mapping is built automatically from each processor's declaredMessageIntype. - Chaining:
Processoroutput becomes the next input. The chain continues until termination. - Termination: The loop exits when a
Processoremits anEgressMessage. - Bounds: A
max_hopslimit prevents infinite loops. - TaskManager Propagation: The
Compositepropagates itsTaskManagerto child processors that lack one.
The Topology is a compiled representation of the routing graph. At construction time, it validates two invariants:
- Completeness: Every output type produced by a processor must be handled by some processor in the topology.
- Termination: At least one processor must produce an
EgressMessage.
If either invariant is violated, the topology refuses to compile.
INSTALLATION
pip install dialogus
STANDARDS
The aesthetic of the project is industrial. We build tools for engineers, not consumers.
- Boring: Code should be predictable and standard. Excitement in code is usually a synonym for error.
- Minimal: If a feature can be implemented in user-space, it does not belong in the kernel (core).
- Explicit: Magic is forbidden. Control flow must be visible.
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 dialogus-0.1.2.tar.gz.
File metadata
- Download URL: dialogus-0.1.2.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59f43740e4775d522b164e0250dbd02cd2bfd7900786d40c6ce3e7693746d6c2
|
|
| MD5 |
6d63286c8fbdbea8a5c60e62095da3ec
|
|
| BLAKE2b-256 |
8b88b47e6d69a5894f4c16a7b6ff2e9fb3fbc23d5982e1cb0b51d3c72ffed04f
|
Provenance
The following attestation bundles were made for dialogus-0.1.2.tar.gz:
Publisher:
publish.yml on comprimus/dialogus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dialogus-0.1.2.tar.gz -
Subject digest:
59f43740e4775d522b164e0250dbd02cd2bfd7900786d40c6ce3e7693746d6c2 - Sigstore transparency entry: 779264707
- Sigstore integration time:
-
Permalink:
comprimus/dialogus@327d9f7bee7b4707eb09e4719b65142ec6bf093d -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/comprimus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@327d9f7bee7b4707eb09e4719b65142ec6bf093d -
Trigger Event:
release
-
Statement type:
File details
Details for the file dialogus-0.1.2-py3-none-any.whl.
File metadata
- Download URL: dialogus-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3919c3a07a72e8af39e763979c511421b891f10b029ba3346e8e80a584299b66
|
|
| MD5 |
64271b800e5dfd9ee1904ecc6d9c2c46
|
|
| BLAKE2b-256 |
7027d4aee7f42e6b99cdcb7e3b89971c46426caab483e9401db3ce94553f25b2
|
Provenance
The following attestation bundles were made for dialogus-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on comprimus/dialogus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dialogus-0.1.2-py3-none-any.whl -
Subject digest:
3919c3a07a72e8af39e763979c511421b891f10b029ba3346e8e80a584299b66 - Sigstore transparency entry: 779264710
- Sigstore integration time:
-
Permalink:
comprimus/dialogus@327d9f7bee7b4707eb09e4719b65142ec6bf093d -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/comprimus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@327d9f7bee7b4707eb09e4719b65142ec6bf093d -
Trigger Event:
release
-
Statement type: