Dialograph is a Python toolkit for building, evolving, and reasoning over temporal dialogue graphs for proactive conversational agents.
Project description
dialograph
Dialograph is a lightweight Python library for representing, evolving, and traversing dialogue memory as a temporal graph. It is designed for proactive dialogue agents, where reasoning over user preferences, beliefs, and strategies matters more than raw generation.
At its core, Dialograph wraps a dynamic graph structure around typed dialogue memories and provides clean hooks for retrieval, scoring, and long-term evolution.
Core Concepts
Nodes
Nodes represent dialogue memory units such as:
- user preferences
- beliefs / facts
- dialogue strategies
Each node carries a state object (e.g. PreferenceState, BeliefState) with confidence and temporal metadata.
Edges
Edges represent relations between memory units:
- semantic relations (supports, contradicts, elicits)
- dialogue flow dependencies
- strategy activation paths
Edges are directional, weighted, and time-aware.
Time
Dialograph maintains an internal time counter that allows:
- decay of confidence
- forgetting
- recency-based retrieval
Project Structure
dialograph/
├── core/ # graph primitives
│ ├── graph.py # Dialograph wrapper
│ ├── node.py # node state definitions
│ └── edge.py # edge state definitions
│
├── memory/ # typed dialogue memory
│ ├── preference.py
│ ├── belief.py
│ └── strategy.py
│
├── traversal/ # retrieval and scoring
│ ├── retrieve.py
│ └── score.py
│
├── utils/ # persistence & visualization
│ ├── io.py
│ └── visualize.py
Installation
For development:
git clone https://github.com/nabin2004/dialograph.git
cd dialograph
uv venv
source .venv/bin/activate
uv pip install -e .
Quick Example
from dialograph import Node, Edge, Dialograph, draw
graph = Dialograph()
# Nabin Eats Rice.
n1 = Node(node_id='n1',node_type='personal_details',data={"value":"Nabin"})
n2 = Node(node_id='n2',node_type="object", data={"value":"Rice"})
n3 = Node(node_id='n3',node_type='personal_details',data={"value":"Football"})
n4 = Node(node_id='n4',node_type='person',data={"value":"R. Feynman"})
n5 = Node(node_id='n5',node_type='subject',data={"value":"Quantum Physics"})
e1 = Edge(edge_id='e1', source_node_id='n1', target_node_id='n2', relation='eats')
e2 = Edge(edge_id='e2', source_node_id='n1', target_node_id='n4', relation='knows')
e3 = Edge(edge_id='e3', source_node_id='n1', target_node_id='n3', relation='plays')
e4 = Edge(edge_id='e4', source_node_id='n1', target_node_id='n5', relation='interested')
e5 = Edge(edge_id='e5', source_node_id='n4', target_node_id='n5', relation='famousFor')
graph.add_node(n1)
graph.add_node(n2)
graph.add_node(n3)
graph.add_node(n4)
graph.add_node(n5)
graph.add_edge(e1)
graph.add_edge(e2)
graph.add_edge(e3)
graph.add_edge(e4)
graph.add_edge(e5)
draw(graph)
Intended Use Cases
- Proactive dialogue systems
- Emotional support agents
- Preference elicitation
- Strategy planning and reuse
- Dialogue memory research
Status
This project is under active development. APIs may evolve, but core abstractions are expected to remain stable.
Roadmap
- Path-based retrieval
- Forgetting thresholds
- Graph serialization
- 3D / interactive visualization
- LLM-facing retrieval API
License
MIT License.
Citation
If you use Dialograph in academic work, please cite the corresponding paper (coming soon).
- How can an agent use past interactions to proactively adapt its dialog strategies over time, without relying on opaque embedding-only retrieval or heavy ontologies?
- We're not retrieving facts, we're retrieving how to act.
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
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 dialograph-0.7.0.tar.gz.
File metadata
- Download URL: dialograph-0.7.0.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04aff7e718119ad61e96c3dd597ec9fdecfc66164d8677d5cb9f07f7f10903fd
|
|
| MD5 |
c0df7db2b2d18d48873de609b360d0ac
|
|
| BLAKE2b-256 |
5172ce2d249b579cf1501a91a1b5b8cd98943c8201a8dcf276829a6c7b2ae51d
|
File details
Details for the file dialograph-0.7.0-py3-none-any.whl.
File metadata
- Download URL: dialograph-0.7.0-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9ac052a9bc33828c7c2bb30f34dec1bdc9a589ffc20549844b08ad7d9c06f25
|
|
| MD5 |
40446d84e0d581fcd2bbf418a9f3196e
|
|
| BLAKE2b-256 |
9959ed3b1353c12d49dbe6b93be7a2c77b366350e090241b71e5f623bac4f410
|