Build on Bevia

Build tools and agents that use a Bevia World.

Send sources in. Ask the World and get answers with sources. Listen for changes. Propose actions the owner approves.

What you can build

Connect a source, build a view of your World, or give an agent context it can trace to evidence. Use the SDK or call the local HTTP API from your preferred language.

Sensors / input adapters

Turn what something knows into evidence: a device, a brokerage, a file format, a service, a robot. The engine decides what it means.

Lenses / custom interfaces

A timeline, a terminal, a 3D graph, a minimalist journal, an operations console — read the published World and render it your way.

Automations / workflows

React to what happened — a publication, a new insight, a contradiction — with n8n, a script, a queue, an agent. Bevia recognizes the condition; you run the workflow.

Agents / copilots

Reason from governed understanding through MCP, propose what to do, get the owner's authorization, act, and report what happened back as evidence.

A published World

Bevia writes a World as linked notes; Obsidian Publish, Obsidian's paid service, puts them on the web. See one at world.bevia.co.

The 15-minute quick start

Five steps, one script. Everything below is in the SDK's examples/quickstart.mjs (included in the SDK package) and runs unchanged against an installed Bevia.

  1. Install the SDK
    npm install @bevia/sdk

    That is the whole install — no checkout, no tarball, no private registry. It speaks protocol v1.5.

  2. Connect to Bevia

    Open Bevia's menu-bar icon → Engine Controls… → Create a developer workspace. Bevia pairs a workspace with the engine on your machine and writes ~/Bevia/Developer/bevia-workspace.json with the port and a token that already works.

    import { connectLocal } from "@bevia/sdk";
    
    const bevia = await connectLocal();          // reads the workspace file (or BEVIA_ENGINE_URL + BEVIA_TOKEN)
    const me = await bevia.whoami();             // { name, kind, capabilities: [...], pending: [] }
  3. Ask the World and read Attention
    const history  = await bevia.world.history(5);      // every publication, newest first
    const answer   = await bevia.ask("what changed this week?");   // one answer, with its sources
    const insights = await bevia.attention();           // what the publisher selected as worth noticing
    for (const i of insights?.insights ?? []) console.log(i.kind, i.headline);

    The whole World (world.current()) is the owner's only.

    Nothing published yet? Every read says so — { ok: false, code: "not_published" } — never an empty answer dressed as one.

  4. Subscribe to an event
    const sub = bevia.events.on(["proposal.created", "proposal.resolved"], (ev) => {
      console.log(ev.kind, ev.subject?.id, ev.data);
    }, { after: await bevia.events.head() });        // from now
  5. Submit a proposal — and watch it come back
    const p = await bevia.propose({
      kind: "note",
      subject: { text: "quick start" },
      proposal: { text: "Hello from the quick start." },
      basis: { reason: "Proving the loop." },
    });
    // …a moment later the handler above prints: proposal.created <p.proposal_id>
    const decided = await bevia.proposals.awaitResolution(p.proposal_id);   // the OWNER decides, in the app

Run it: node examples/quickstart.mjs. The loop is closed when the proposal you just made comes back over the stream. Then open Bevia and resolve it — or let awaitResolution tell you.

The shape

Anything

Your sensor, script, device, service.

→
Open intake · Governed World · Open output

Evidence is admitted, formed and published by a closed constitutional engine. Nothing outside decides meaning.

→
Anything

Your dashboard, agent, automation, action.

Bevia owns truth, governance, provenance, time and authority. You own the interface, the workflow, the automation, the visualization, the action. Open the doors, not the machinery.

The runtime →