Skip to content
All use cases

IN PRACTICE / RAG

RAG & agent pipelines

A retrieval pipeline is a chain of effectful calls wrapped around pure ranking.

Read the manifest
rag.bloccs06 NODES / DIRECTED FLOW
RAG & agent pipelines: an isometric view of the six-node network described below

Typed connections / Top pip = declared effect

01 / 06

query

Takes the user question off the wire as a typed Query@1.

Node reference

THE ARCHITECTURE

Every hop has
a responsibility.

bloccs scopes each model and database call to its own node, keeps the ranking pure and replayable, and puts the decision gate in the graph itself — so approved drafts and requests for review take explicit routes. Because every effect is a declared capability, you can see exactly which nodes reach the model, the vector store, or take an action.

Implementation status

Where this stands today: retrieval over the DB effect, the routing in gate, and every outbound call are shipped in 0.8. The model calls (embed, generate) ride the generic HTTP effect for now, and gate branches on a decision in the message — a first-class model effect and a gate that suspends for live human approval are on the roadmap.

SOURCE OF TRUTH

From shape
to source.

The network is declared in TOML. Compile it with its referenced node manifests and bloccs checks the wiring, schemas, and capabilities before emitting a Broadway supervision tree.

COMPILEmix bloccs.compile

Node implementations live in the referenced nodes/*.bloccs files.

Manifest documentation
rag.bloccs
[network]
id      = "rag"
version = "0.1.0"
runtime = "beam"

[nodes]
query    = { use = "nodes/query.bloccs" }
embed    = { use = "nodes/embed.bloccs" }
retrieve = { use = "nodes/retrieve.bloccs" }
rerank   = { use = "nodes/rerank.bloccs" }
generate = { use = "nodes/generate.bloccs" }
gate     = { use = "nodes/gate.bloccs" }

[[edges]]
from = "query.asked"
to   = "embed.text"

[[edges]]
from = "embed.vector"
to   = "retrieve.query"

[[edges]]
from = "retrieve.chunks"
to   = "rerank.chunks"

[[edges]]
from = "rerank.ranked"
to   = "generate.context"

[[edges]]
from = "generate.draft"
to   = "gate.candidate"

[expose]
in  = { ask = "query.asked" }
out = { act = "gate.approved", review = "gate.held" }

[supervision]
strategy     = "one_for_one"
max_restarts = 10
max_seconds  = 60

[deploy]
concurrency = { embed = 4, generate = 2 }
06

One node. One responsibility.

The kind describes its role. The capability declares its reach.

01

query

Source+HTTP

Takes the user question off the wire as a typed Query@1.

02

embed

Transform+HTTPRoadmap detail below

Calls the embedding model. Today that's the generic HTTP effect; a first-class model capability is on the roadmap.

03

retrieve

Node+DB

Vector search over your store via the DB effect, emitting candidate Chunk@1s.

04

rerank

Node

Reorders candidates by relevance. Pure scoring — no I/O, fully replayable in tests.

05

generate

Transform+HTTPRoadmap detail below

Calls the LLM with the ranked context over the HTTP effect to draft an answer.

06

gate

SplitRoadmap detail below

Routes the draft to act or hold for review. Today it branches on a decision already in the message; suspending for a live human approval is on the roadmap.

Build this one for real.

Declare the graph. Check the contracts. Let the BEAM run it.

Read the docs
{:bloccs, "~> 0.9"}