Getting started
Install it, report a few beats of work, finish the story, and look at what came out. Two minutes.
Install#
One command sets a project up: it installs the package, writes a configured storyteller, and adds a short guide to your AGENTS.md so any agent working in the repo knows how to use it.
Safe to run again later — it never overwrites anything you've edited. Or just install the package and wire it up yourself:
Your first story#
Report each beat as it happens. When the work is done, finish. Everything you reported becomes one record.
import { Storyteller } from "@lovelaces-io/storyteller"; const story = new Storyteller({ origin: { who: "my-service" }, }); story.report("User clicked checkout"); story.report("Cart validated", { what: { items: 3 } }); story.finish("Checkout started");
report() takes a message, or any value at all — an error, an API response, a Map. finish() takes a title and, optionally, a level and an error.
What comes out#
The console prints a readable report by default. Underneath is a clean JSON record you can store anywhere:
{ "timestamp": "2026-03-31T14:30:00.000Z", "level": "Information", "title": "Checkout started", "origin": { "who": "my-service" }, "durationMs": 0, "notes": [ { "timestamp": "...", "note": "User clicked checkout" }, { "timestamp": "...", "note": "Cart validated", "what": { "items": 3 } } ] }
That's the whole story, in one place: what happened, in order, how long it took, who did it, and how it ended.
Two shapes, one story#
Story — JSON
What you store. Database, log file, monitoring, an agent's memory. JSON.stringify(event) is the complete row.
Report — text
What you read. Console, terminal, a Discord message. formatStory(event) or event.summarize().
Keep these separate in your head. Storage audiences get the record; people get the report. Never store the formatted text.
Where next#
- Collected & live — watch beats arrive as they happen instead of waiting for the end.
- Audiences — send stories to your database, to Discord, to anything.
- The Library — keep stories, ask in words, let an agent read them back.
- Agents & init — make every agent in your repo narrate its work.