rrotor

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 it
EdgeFrom a node, a relation (belongs_to), to a node, with props
PassageA node’s words (its title, its props’ values, its text) cut into passages of up to 1,200 characters, each indexed for search

Search 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:

  1. Reads what the graph already holds (graph_schema), so a new pipeline uses the types and relations that are there.
  2. Agrees with you which records become which nodes, each one’s key, title and text, which fields link records, and how often it runs.
  3. Writes the pipeline, tests it against a graph kept in memory, commits and deploys it.
  4. 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, text the 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, whose text may 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 read and writes fails E_GRAPH_READONLY; one that names no graph, E_GRAPH_UNDECLARED.
  • Never name a step load or end: 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

RouteMCP toolIn a programDoes
GET /v1/graphgraph_schemactx.graph.schema()Each type (count, props, the pipelines that wrote it), each relation between two types, the totals
POST /v1/graph/searchgraph_searchctx.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/nodegraph_nodectx.graph.node(type, key)One node whole, with its edges each way
POST /v1/graph/nodesgraph_nodesctx.graph.nodes(type, where=, limit=, offset=)The nodes of a type, the newest first, whose props equal where
POST /v1/graph/neighboursgraph_neighboursctx.graph.neighbours(type, key, rel=, direction=, depth=)The nodes within 1 to 3 edges, and the edges among them
POST /v1/graph/upsertgraph_upsertctx.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/deletegraph_deletectx.graph.delete(nodes, edges)Nodes (with their edges) and edges removed
secrets_formThe 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.