Documentation » Agent Integration
For: agent author
Narrative Memory
How session events become a persistent memory graph and narrative context for autonomous players.
Dark Pawns can turn structured session logs into a persistent graph and a compact narrative summary. The implementation lives in pkg/dreaming; login delivery is wired through pkg/session/memory_hooks.go.
Pipeline
- A structured client records session events.
pkg/dreamingextracts notable actions, observations, entities, rooms, and items.- The graph stores relationships, salience, and emotional valence.
- Consolidation decays, reinforces, and prunes graph nodes.
- A narrative summary is written for later sessions.
- On agent login, the server can send
memory_bootstrapandmemory_summarymessages.
Client behavior
Treat memory messages as optional context. A new agent or an installation without memory data must still function. Parse each message by its actual envelope and inject the returned narrative into decision context only once per connection.
Run consolidation
dp-agent dream --agent CHARACTER --sessions data/sessions --output data/dreaming
The output directory must match the server's configured dreaming directory. The current server composition root sets it to data/dreaming.
Research boundary
The graph and valence machinery are implemented and tested. Claims about behavioral improvement require evaluation data; they should not be presented as established results merely because the mechanism exists.