Skip to Content
Recodocs

Architecture

How RecoX is built, from the governed tool gateway and tenant isolation to durable workflows, data classification, storage roles and the model connection.

6 min read

RecoX is a layered platform with one rule at its centre: every request, from a console click to an outside agent's tool call, passes through the same governed tool gateway and the same tool definitions. Identity, roles, data classification, approval policies and audit are therefore enforced in one place, not re-implemented per entry point. This page describes the layers, how companies are isolated, how durable workflows survive failures, what each datastore does and how models are used.

Layers

Imagine a user in Slack and another in the console asking about the same invoice. Their permitted access should depend on their identity and role, not the interface they happen to use. The architecture explains why the gateway enforces that boundary consistently.

Governed request path (1–2)State, cache & durable storage (3)Model provider calls (M)RecoX Platform Boundary
RecoX platform layersClick to inspect
Entry points no business logic
Web ConsoleTemplates & Needs You
SlackMentions & DM approvals
MCP ClientsClaude, Codex (scoped)
RecoX Core Platform
Backend Gateway
Governed Tool GatewayIdentity · Roles · Column data classification · Approval policies · Audit
Logic Layer
RecobotAnswer Reveal
Dept. ModulesBusiness rules
Entity GraphTyped links
WorkflowsDurable + AI
Platform Stores & Execution
PostgreSQLRecords & Governed Views
TemporalDurable workflows
Redis24h exact / 28d embed
QdrantPer-tenant vectors
Model connections Outside AI: Off or one provider
ChatGPT / Codex planCompany default route · spend guard
Claude API keyAnthropic provider · no silent fallback
1
2
3
M
LayerResponsibilityStatus
Entry pointsCarry a person or a machine credential into RecoX (Console, Slack, MCP clients). They hold no business logic.Live feature
Governed tool gatewayAuthenticates, resolves caller role and grants, applies column data classifications, evaluates policy, creates decisions, executes tools and records the call.Live feature
RecobotThe model-driven loop that chooses tools to answer a person, with Answer Reveal transparency and citation deep-linking.Live agent
Entity GraphCross-department graph linking records (invoices, tasks, campaigns, documents, legal filings) with typed bidirectional edges.Live feature
Workflows and AI stepsDurable workflows run by Temporal with retries, and bounded model calls inside fixed code.Live workflow, Live AI step
Department modulesOwn records and deterministic business rules for Sales, Marketing, Finance, Compliance, People, Operations, Templates and Academy.Live feature
PlatformPostgreSQL with Governed Views & SQL Lineage, Temporal for durable workflows, Redis for caching, and Qdrant for semantic search.Live feature

One gateway for every entry point

The console, Recobot, Slack and MCP clients all call tools by name, for example bills.mark_paid. Every tool declares:

PropertyWhat it states
RolesWhich roles may call it
Side effectWhether it changes anything, and where
Approval policyWhether the call needs a person to approve
Retry safetyWhether repeating the call after a failure is safe
SensitivityWhether it touches personal, pay or message data
Read-backHow the result is verified after a write

Because the definitions are shared, a Slack mention, a Claude session over MCP and a button in the console follow identical checks. An MCP client with a narrow grant sees a short tool list. A write from any entry point that needs approval returns pending_approval and creates the same decision.

Admission checks (1–3)AllowedApproval requiredDenied
Governed Tool Gateway pipelineClick to inspect
Governed Tool Gateway every call passes 4 checks
IdentityUser or token
Roles & GrantsTool allowlist
MaskingSensitivity
Policy GateAllow · Ask · Deny
Allowed
Execute toolDeterministic run
Read backVerify actual state
Approval required
Create DecisionPreview & fingerprints
Denied
Typed ErrorNo side effects
Immutable Audit LogRecords every allowed execution + read-back, parked decision, and denied call
1
2
3
✓
?
✕

Tool-call result envelope

Every tool call returns the same versioned envelope. This is a write that needs approval:

bills.mark_paid response
{
  "status": "pending_approval",
  "data": null,
  "evidence": [
    { "type": "finance.bills", "id": "bill_123" },
    { "type": "finance.bank_lines", "id": "bl_881" }
  ],
  "effect": null,
  "proposal": {
    "id": "dec_4f2a91",
    "title": "Mark Northwind bill as paid",
    "severity": "moderate",
    "approver_role": "finance_lead",
    "expires_at": "2026-11-08T09:30:00Z",
    "fingerprint": "sha256:9c1e7b"
  },
  "next_actions": ["Ask Priya Sharma to approve decision dec_4f2a91"],
  "retryable": false,
  "invocation_id": "inv_77b3",
  "run_id": "run_2d90"
}

Prop

Type

Errors use a separate structured error packet:

error response
{
  "error": {
    "code": "forbidden",
    "message": "Role operator cannot call payroll.run",
    "retryable": false
  }
}

Tenancy and isolation

Each organisation is a tenant with its own database, files, credentials and jobs. Queries are bound to the caller's company at the gateway, so one company's records and documents never appear in another company's results.

Inside a company, isolation is by role. Access is scoped to the company, a department or the person's reports, can be time-bound, and sensitive permissions (people.pii.read, pay.read, messages.read) mask fields. Employees see their own records. See Roles and access.

Durable workflows

Status: Live workflow. Routines, invoice import and annual accounts run as Temporal workflows. A workflow is a sequence of steps, and each step is durable.

  • Retried. A transient failure in an integration retries without losing the run.
  • Resumes after a restart. If a worker restarts mid-run, the workflow continues from the last completed step.
  • Waits and resumes. A workflow can wait for a person or an event and continue afterwards.
  • Visible. Routines show health and a run timeline. See Routines.

No model decides the steps of a workflow. Where a workflow includes an AI step, the model makes one bounded call and fixed code does the rest.

What each datastore does

StoreRole
PostgreSQLSystem of record for companies, people, roles, decisions and every module's records.
TemporalDurable execution of workflows and routines.
RedisCache. Exact-text results are cached for 24 hours and embeddings for 28 days. Records, access decisions and approvals are never cached.
QdrantVector search over documents and knowledge, kept separate per company.

Models

Recobot uses two model stages.

Two-stage model executionClick to inspect
Two-stage model execution fast routing + governed answering
RequestConsole or Slack
Router modelDeepSeek V4 Flash
WorkflowCode-owned route
Answering modelGPT-6 Luna / Claude · spend guard
OutputCited answer or governed proposal
1
2
3
4

A fast router model, DeepSeek V4 Flash, picks the workflow. The answer comes from the company's default model connection: GPT-6 Luna through a ChatGPT or Codex plan, or Claude through an Anthropic API key. In each chat the person can choose the model, the reasoning effort and fast mode. There is no automatic fallback to another provider. A spend guard sits on model calls, and provider prompt reuse lowers the cost of repeated context. See Caching and cost.

The Outside AI setting is Off or one provider. With it Off, RecoX uses templates for drafts and summaries and nothing leaves the company.

Planned

Automatic fallback between model providers is on the roadmap.

How MCP and Slack enter

EntryIdentityBehaviour
MCPA stdio launcher, or a governed HTTP gateway where a machine credential is exchanged for a short-lived run tokenReads run directly. Consequential calls return a pending proposal.
SlackThe Slack user, mapped to a RecoX personRecobot runs as that person. Decisions arrive as DMs with signed buttons.
ConsoleSigned-in personRecobot panel and pages call tools directly.

An outside agent can propose but cannot approve. External MCP servers can also be registered in RecoX, and each of their tools stays off until an admin allows it. See MCP.

Audit trail

Decisions, tool calls, record changes, access changes and connection changes are recorded. A decision records the outcome, who decided and the channel. Access changes can be exported as CSV from the Access page. See Outputs and audit and Audit log.

Failure behaviour

FailureBehaviour
Model connection errorThe run stops with an error. There is no automatic switch to another provider.
Integration errorA workflow retries. A tool that is not safe to repeat returns a failure and waits for a person.
Worker restartThe workflow resumes from the last completed step.
Record changed before applyThe decision does not apply a different change.
Read-back differsThe decision is marked failed.
Spend guardThe guard stops further model calls.

How is this page?

Last updated on