Pipelines and the graph
rrotor keeps one knowledge graph of your organisation’s data, its semantic layer. Pipelines write it, on a schedule; the apps Claude builds, and Claude itself, read it.
What the graph is
One graph for the whole rrotor (from rrotor 0.4.0), kept in SQLite on its own volume. Your data is shaped once, by a pipeline, and everything built on the rrotor reads the same shape.
NodeA type and a key (deal, d-1042), with a title, props (a JSON object) and text. The type and key name it: writing it again changes itEdgeFrom a node, a relation (belongs_to), to a node, with propsPassageA node’s words (its title, its props’ values, its text) cut into passages of up to 1,200 characters, each indexed for searchSearch is by words: SQLite’s full-text index, stemmed and ranked by BM25. It is not search by meaning: no model runs on rrotor, so there are no embeddings.
Build a pipeline from Claude
With the glyphh plugin and your rrotor connected, say what to connect:
connect our HubSpot to rrotor: companies, contacts and deals, every hour
The plugin’s rrotor-graph skill:
- Reads what the graph already holds (
graph_schema), so a new pipeline uses the types and relations that are there. - Agrees with you which records become which nodes, each one’s key, title and text, which fields link records, and how often it runs.
- Writes the pipeline, tests it against a graph kept in memory, commits and deploys it.
- Shows you a form to set its key (below), runs it once, and reads the schema again to show what it wrote.
A pipeline is a program
The same program as any other, with "graph": "write" in its manifest, the source’s host, its key as a secret and a schedule. There is no DAG engine: its steps are plain Python functions that one function calls in order.
{
"name": "hubspot_pipeline",
"description": "HubSpot's deals, written to the graph each hour",
"python": "3.13",
"functions": { "sync": { "inputs": { "type": "object", "additionalProperties": false } } },
"hosts": ["api.hubapi.com"],
"secrets": ["HUBSPOT_TOKEN"],
"graph": "write",
"limits": { "seconds": 900, "memory_mb": 512 },
"schedules": [{ "function": "sync", "cron": "5 * * * *", "name": "each_hour" }]
}from rrotor import Ctx, Result
API = "https://api.hubapi.com/crm/v3/objects"
def extract(ctx: Ctx, objects: str, properties: list[str]):
"""Every record, a page at a time."""
headers = {"Authorization": f"Bearer {ctx.secrets['HUBSPOT_TOKEN']}"}
after = None
while True:
params = {"limit": 100, "properties": ",".join(properties), "associations": "companies"}
if after:
params["after"] = after
page = ctx.http.get(f"{API}/{objects}", params=params, headers=headers).raise_for_status().json()
yield from page.get("results", [])
after = ((page.get("paging") or {}).get("next") or {}).get("after")
if not after:
return
def transform(record: dict) -> dict:
"""A record as a flat row."""
linked = ((record.get("associations") or {}).get("companies") or {}).get("results") or []
return {"id": record["id"], **(record.get("properties") or {}), "companies": sorted({a["id"] for a in linked})}
def store(ctx: Ctx, rows: list[dict]) -> dict:
"""The rows as nodes, with an edge to each company a row names."""
return ctx.graph.rows(rows, type="deal", key="id", title="dealname", text=["description"],
links={"companies": ("belongs_to", "company")})
def sync(ctx: Ctx, inputs: dict) -> Result:
rows = [transform(r) for r in extract(ctx, "deals", ["dealname", "amount", "dealstage", "description"])]
return Result.done(store(ctx, rows))ctx.graph.rows(records, type=, key=, title=, text=, props=, links=)writes a table of records: each row a node,textthe columns search should read, the other columns its props.links={"account_id": ("belongs_to", "account")}makes an edge from the row to the account that column names.ctx.graph.upsert(nodes, edges)writes them as given: use it for documents, whosetextmay be up to a million characters.- Run again, it writes the same nodes again: the graph keeps one of each type and key, and a node keeps what a write does not name. An edge to a node not written yet makes it, empty, until its own pipeline fills it.
- What the source dropped stays until the pipeline removes it with
ctx.graph.delete. - The program never touches the graph’s file: it asks rrotor over its run’s own channel, and rrotor checks what its manifest allows. A program that says
readand writes failsE_GRAPH_READONLY; one that names no graph,E_GRAPH_UNDECLARED. - Never name a step
loadorend: those are the hooks rrotor calls before and after every run.
Keys: a form, never the chat
- A pipeline’s key is a secret its manifest declares. Claude calls
secrets_form, which shows a form in Claude: each secret, whether it is set, and a field. - What you type goes from the form straight to rrotor’s vault, encrypted there. It is not in the conversation, it is never shown back, and Claude is told only which names were set.
- Where no form shows (Claude Code in a terminal), set it yourself:
PUT /v1/programs/{name}/secrets/{secret}with{"value": "…"}.
Apps on the graph
An app published with graph: "read" reads the graph through its own functions, one per chart, table or search box; the page calls them as the viewer.
def won_deals(ctx, inputs):
deals = ctx.graph.nodes("deal", where={"dealstage": "closedwon"}, limit=200)
return Result.done({"rows": [{"name": d["title"], "amount": d["props"].get("amount")} for d in deals]})
def ask(ctx, inputs):
hits = ctx.graph.search(inputs["q"], limit=8, expand=True)
return Result.done({"hits": [{"title": h["title"], "type": h["type"], "passage": h["passage"]} for h in hits]})The graph is not divided by role: whoever may open the app sees what its functions answer, so give an app over sensitive data roles.
Routes and tools
| Route | MCP tool | In a program | Does |
|---|---|---|---|
| GET /v1/graph | graph_schema | ctx.graph.schema() | Each type (count, props, the pipelines that wrote it), each relation between two types, the totals |
| POST /v1/graph/search | graph_search | ctx.graph.search(query, types=, limit=, expand=) | The best nodes for the words, each with the passage that matched, a snippet and a score; expand adds the nodes each is linked to |
| POST /v1/graph/node | graph_node | ctx.graph.node(type, key) | One node whole, with its edges each way |
| POST /v1/graph/nodes | graph_nodes | ctx.graph.nodes(type, where=, limit=, offset=) | The nodes of a type, the newest first, whose props equal where |
| POST /v1/graph/neighbours | graph_neighbours | ctx.graph.neighbours(type, key, rel=, direction=, depth=) | The nodes within 1 to 3 edges, and the edges among them |
| POST /v1/graph/upsert | graph_upsert | ctx.graph.upsert(nodes, edges), ctx.graph.rows(…) | Nodes and edges written, all of them or none: 2,000 nodes and 10,000 edges a call |
| POST /v1/graph/delete | graph_delete | ctx.graph.delete(nodes, edges) | Nodes (with their edges) and edges removed |
| secrets_form | The form to set a program’s secrets |
Limits
- Search is by words, not meaning. Search with the words the data uses.
- In a cluster the graph is the head’s alone: it does not replicate, a program that names it runs on the head, and a node made head has an empty one until the pipelines run again.
- Each pipeline holds its own key: there are no connections signed in once and shared.