Sinew Labs

Rootstock · v1.0 · for technical evaluators

How Rootstock is actually built.

The architecture, data flow, and infrastructure behind Rootstock, one of Sinew Labs' AI accelerators — written for the people who have to approve it, not just the people who buy it.

Doc version 1.0 · Aug 2026 Audience IT, security, and platform teams Deployment Cloud-first, on-prem supported

Overview

Rootstock is a per-client deployment, not a shared multi-tenant SaaS your data disappears into. Each client gets its own retrieval index, its own domain ontology, and its own trace log — built on a fixed, opinionated stack so a Sinew Labs engineer can configure it in weeks rather than architect it from scratch.

Three layers do the actual work: a retrieval layer that turns your documents into a queryable, versioned knowledge base; an agent layer that reasons over that knowledge using a domain-specific ontology instead of a hard-coded script; and an operations layer that traces every query, tool call, and dollar spent. Identity and access sit underneath all three, tied to your existing SSO.

System architecture

The diagram below is the mechanism, not the marketing version: where documents and questions enter, which component talks to which, and — the part most security reviews care about — the one edge where a request leaves Sinew Labs' managed boundary and reaches a third-party model provider.

CLIENT ENVIRONMENT SINEW MANAGED SERVICE LLM PROVIDER Documents User (via SSO) Ingest & embed API / chat Vector store (pgvector, per-client) Retriever (hybrid search + rerank) Ontology (domain rules) Agent (LangGraph) LLM gateway (LiteLLM) Langfuse — traces, cost, evals OpenAI / Claude / vLLM uploads embeds & stores top‑k match asks answers query context domain rules reasoning call trace ⇢ answer + citations completion via API (TLS)
Every arrow crossing into the LLM Provider zone is the same edge: an HTTPS completion request through the LiteLLM gateway. It is the only point where prompt content leaves Sinew Labs' managed boundary — and the only edge that changes between a hosted-model deployment and a fully self-hosted one.
Why one gateway

Every model call — regardless of provider — routes through the LiteLLM gateway. That gives you one place to swap OpenAI for Azure OpenAI, Anthropic, or a self-hosted vLLM endpoint without touching the agent logic, and one place to enforce rate limits, redaction, and per-client model allow-lists.

Data flow

What happens between a document landing in Rootstock and an answer landing in front of a business owner.

  1. Upload & ingest.

    A document is uploaded via the console or API under an SSO-scoped session. It's parsed (tables, headers, and structure preserved), chunked, and embedded.

  2. Version & store.

    Chunks and vectors land in the client's pgvector schema; the previous version is archived, not overwritten, so retrieval can be pinned to a point in time.

  3. Query arrives.

    A question comes in through the chat window or the API. The retriever runs hybrid search — dense vector plus keyword — scoped to what that user's role is allowed to see.

  4. Agent reasons.

    Retrieved context and the client's domain ontology (entities, relationships, rules) are handed to the LangGraph agent, which decides what to answer directly and what requires a tool call.

  5. Model call.

    Where a completion is needed, the agent calls out through the LLM gateway — the one edge that reaches a third-party model provider, always over TLS, never with raw documents attached beyond the retrieved context.

  6. Trace & return.

    The retrieval, the reasoning steps, the tool calls, and the token cost are all written to Langfuse in real time. The answer returns with citations back to the user.

Layer-by-layer stack

Ingestion & knowledge base

Handles everything between "a file" and "a queryable fact."

Parsing — Unstructured.io Chunking — semantic + recursive splitting Embeddings — OpenAI text-embedding-3-large (default) Vector store — PostgreSQL + pgvector Object storage — S3 / MinIO

Agent & reasoning layer

Where domain knowledge becomes a decision, not just a paragraph.

Orchestration — LangGraph Tool interface — Model Context Protocol (MCP) Model routing — LiteLLM gateway Reranking — Cohere Rerank 3 Domain schema — per-client ontology (YAML)

Identity & access

Every query is scoped to a person, not just a client.

SSO — OIDC / SAML 2.0 via WorkOS Providers — Okta, Entra ID, Google Workspace Authorization — row-level security in Postgres

LLMOps & observability

The dashboard your consultant shows you isn't decorative — it's reading the same trace store as this section.

Tracing & cost — Langfuse RAG evaluation — Ragas (faithfulness, context precision/recall) Guardrails — PII redaction + prompt-injection screening

API surface

A representative slice of the REST API — enough to see the shape of what your team would integrate against.

EndpointPurpose
POST /v1/documentsUpload and version a document into the knowledge base
GET /v1/documents/{id}/versionsList version history for a document
POST /v1/queryAsk a domain question; returns an answer, citations, and a trace ID
POST /v1/agents/{workflow}/runTrigger a named agentic workflow directly
GET /v1/ontologyFetch the current domain schema (entities, relationships, rules)
PUT /v1/ontologyUpdate the domain schema
GET /v1/metricsCost, latency, and usage summary — mirrors the Langfuse dashboard

Webhooks are available for document.ingested, query.answered, workflow.completed, and escalation.triggered, so Rootstock can push into a client's own systems rather than waiting to be polled.

Deployment model

Cloud-first. Each client runs in its own environment — an isolated Postgres schema by default, a dedicated instance for enterprise clients — deployed into the client's own AWS, GCP, or Azure account, or into Sinew Labs' managed cloud. Services ship as Docker containers; smaller deployments run on ECS Fargate / Cloud Run, larger ones on Kubernetes (EKS/GKE/AKS). Infrastructure is defined in Terraform and provisioned the same way every time.

On-premise. The same container images ship as a Helm chart or Docker Compose bundle for air-gapped or on-prem clusters. The client provides Postgres with the pgvector extension, S3-compatible object storage (MinIO works), and either an approved egress path to a hosted model provider or a self-hosted vLLM endpoint. Functionally identical to the cloud deployment — the only thing that changes is who operates the boxes.

Security & compliance posture

What's actually in place today, stated plainly rather than rounded up.

EncryptionTLS 1.2+ in transit; AES-256 at rest for documents, vectors, and traces
Access controlSSO-backed authentication; row-level security scopes every query to a user's role and permitted documents
Audit trailImmutable log of document access, queries, and agent tool calls, queryable per user or per document
SecretsAWS Secrets Manager or HashiCorp Vault, never stored in application config
Data retentionConfigurable per client, including full export and deletion on offboarding
CertificationArchitecture is designed around SOC 2 Type II control objectives; formal certification is on the roadmap, not yet completed — we'll tell you plainly where we stand when you ask

Stack reference

One table, for the whiteboard.

LayerDefault technology
ParsingUnstructured.io
EmbeddingsOpenAI text-embedding-3-large
Vector storePostgreSQL + pgvector
Object storageAWS S3 / MinIO
Agent orchestrationLangGraph
Tool protocolModel Context Protocol (MCP)
Model gatewayLiteLLM
RerankingCohere Rerank 3
SSOOIDC/SAML via WorkOS
ObservabilityLangfuse
EvaluationRagas
ComputeDocker on ECS Fargate / Kubernetes
IaCTerraform
CI/CDGitHub Actions

Every row is swappable — this is the default we configure unless your environment already standardizes on something else.

Want your team on a call with the people who built this?

We'll walk your engineers through the architecture directly — no slide deck required.

Request an architecture review →