// DEVELOPERS/Guides/AI pipelines

AI pipelines

Canvases are structured. Every block has a type, a position, and a stable ID. That makes them clean inputs for retrieval, fine-tuning, and agent workflows. Bring your own model.

Common patterns

  • Synthesize a brief from canvas content.
  • Embed every block into a vector store for retrieval aware comments and search.
  • Stream model output back into a block as it generates.
  • Let an agent read and write blocks via scoped tool calls.

Send a canvas to Claude

// canvas-to-claude.tsTypeScript
const blocks = await allo.canvases.blocks(id)
const res    = await anthropic.messages.create({
  model: "claude-sonnet-4-5",
  messages: [{ role: "user", content: toContext(blocks) }],
  tools: [alloWriteBlock],
  stream: true,
})

Embed and index

// embed-pinecone.pyPython
from allo import Allo
from openai import OpenAI
from pinecone import Pinecone

blocks = Allo().canvases.blocks(cid)
vecs   = [oai.embeddings.create(input=b.text) for b in blocks]
pc.Index("canvases").upsert(vectors=vecs)

Stream into a block

POST /v1/canvases/:id/stream returns server sent events. Pipe model output to it and watch a block fill live in the canvas.

Audit trail

Every AI write logs the model name, prompt hash, and reviewer if any. Visible in the activity log and exportable via /v1/audit.

// NOTE
No model lock in. ALLO does not host or charge for inference. Use any provider that fits your stack.