Examples
Small and complete.
Quick start
examples/quickstart.mjs — the five steps of the quick start as one script: connect, read World and Attention, subscribe, propose, see the event arrive.
A separate app
examples/demo-app/ — the smallest separate program: a package.json depending on the packed SDK only and one file that reads, listens, proposes, waits for the owner, acts and reports.
Thesis Guard
examples/thesis-guard.mjs — a runtime automation in forty lines: watches for insights that contradict a thesis, proposes an action, waits for the owner, acts, reports.
bevia.events.on("attention.created", async (ev) => {
if (ev.data.why_now !== "contradiction") return;
const proposal = await bevia.propose({ kind: "action", subject: { text: String(ev.data.headline), matter_ids: ev.data.matter_ids },
proposal: { text: "Reduce the position by 20% until the contradiction resolves." }, basis: { evidence_refs: [ev.subject?.id] } });
const decided = await bevia.proposals.awaitResolution(proposal.proposal_id);
if (decided.status === "accepted") { /* act */ await bevia.proposals.report(proposal.proposal_id, { outcome: "done", summary: "…" }); }
});A sensor
examples/sensor.mjs — turns a file of dated notes into evidence, keeping the original dates: validate, then capture.
A timeline
examples/timeline.mjs — what the World said, publication by publication (the last step needs the owner's control).
More
- Python —
examples/python/bevia.py, the stdlib-only reference client. - screenpipe → Bevia —
screenpipe-to-bevia.mjsin the developer workspace: someone else's recordings become your meaning, 127.0.0.1 to 127.0.0.1. - n8n — the community node routes anything n8n can reach into your World.