@sioma/client
v0.2.0
Published
Typed HTTP client for Sioma, which makes any AI cheaper and more reliable - focus / outcome / savings / rails against a hosted or self-hosted cell. Zero dependencies.
Readme
@sioma/client
Typed HTTP client for Sioma, which makes any AI cheaper and
more reliable. Zero dependencies, plain fetch. Point it at your Sioma cell (managed or
self-hosted) with an agent-scoped API key.
Sioma turns your API spec into a typed entity map and serves your agent only
the minimal grounded context each task needs. Every resolution returns a
status — serve (confident), ask (clarify), none (red flag) — and Sioma
never invents a path.
import { SiomaClient } from "@sioma/client";
const sioma = new SiomaClient({
baseUrl: "https://aws-us1.cells.sioma.ai",
apiKey: process.env.SIOMA_API_KEY!,
});
// 1. Focus: the minimal grounded context for an intent.
const f = await sioma.focus({ intent: "list this customer's unpaid invoices" });
// f.status: "serve" | "ask" | "none"; f.systemText: give this to your model.
// 2. Your model acts on f.systemText…
// 3. Report the outcome so the engine learns (include token counts to see
// savings in your dashboard).
await sioma.outcome(f.recordId, {
success: true,
inputTokens: 812,
outputTokens: 96,
});Rails (flows the layer runs)
If your workspace enabled rails, the agent picks a flow and Sioma makes the calls — compiled only from what your spec declares:
const ride = await sioma.railBoard({ entityId: "invoice" }, { customerId: "c42" });
// ride.status: completed | awaiting-slots | awaiting-approval (writes pause
// for a human approval in the Sioma dashboard) | haltedsioma.railExecutor() returns the four passenger methods
(board/provide/inspect/abort) as one object, ready to hand to
@sioma/vercel's rail tools.
What this package is not
The learning/resolution engine runs server-side (that is the product). This client is the caller: your agent talks to a cell over HTTP. For fully in-process deployment (data residency), ask about the enterprise embedded tier.
MIT © Sioma
