Raven

SDK reference.

The Raven SDK is a thin, typed wrapper over our HTTP API. It is available for TypeScript and Python today, with Go in private beta.

Installation

bash
npm install @raven/sdk
pnpm add @raven/sdk
yarn add @raven/sdk
bash
pip install raven-sdk

Creating a client

Every operation goes through a typed client scoped to a workspace. The client is safe to share across requests in long-running services.

typescript
import { Raven } from "@raven/sdk";

const raven = new Raven({
  token: process.env.RAVEN_TOKEN!,
  workspace: process.env.RAVEN_WORKSPACE!,
  // optional
  region: "eu-west",
  timeoutMs: 30_000,
});

Muninn

raven.muninn.search

Run a hybrid (vector + structured) query across observations in your workspace.

typescript
const results = await raven.muninn.search({
  query: "supplier exposure in southeast asia",
  since: "7d",
  limit: 50,
  filter: { sector: "industrial" },
});

raven.muninn.ingest

Push a batch of observations into Muninn. Each observation must include a source identifier; ingestion without provenance is rejected.

typescript
await raven.muninn.ingest({
  records: [
    {
      subject: "asset:pump-31a",
      observation: { temp: 78.4, vibration: 0.31 },
      source: { uri: "scada://plant-2/loop-31", at: new Date() },
    },
  ],
});

Huginn

raven.huginn.cases.open

Start a new investigation case. Cases are the unit of accountable reasoning in Huginn.

typescript
const caseRef = await raven.huginn.cases.open({
  title: "Q2 supplier concentration review",
  hypothesis: "Tier-1 supplier mix exceeds policy ceiling for region X",
  owner: "alex@acme.example",
});

raven.huginn.cases.attach

Attach evidence — observations, documents, prior cases — to a case.

Sleipnir

raven.field.workflows.run

Execute a published workflow. Inputs are validated against the workflow's typed schema; policy is enforced before execution begins.

typescript
const run = await raven.field.workflows.run({
  workflow: "supplier-concentration-alert",
  inputs: { region: "APAC", threshold: 0.35 },
  approver: "ops@acme.example",
});

Error handling

The SDK throws typed errors. The most common are: