Skip to content

Anvia SDK ​

Build provider-neutral AI behavior inside a TypeScript application. Anvia supplies small runtime primitives and lets your application keep ownership of credentials, permissions, data, persistence, and deployment.

Choose the runtime shape ​

PrimitiveUse it whenWhat Anvia handles
CompletionYour application owns a single model call.Normalized requests, responses, usage, and streaming.
AgentA model-driven task needs reusable instructions, tools, memory, or multiple turns.Context assembly, the model/tool loop, sessions, events, and run limits.
ExtractorUnstructured input must become validated application data.Schema-driven model output and parsing.
PipelineWork must follow repeatable stages, branches, or parallel steps.Typed workflow execution across models, agents, and functions.

Add only what the product needs ​

AreaCapabilities
Models and actionsProvider models, typed tools, MCP tools, skills, and multimodal generation.
State and knowledgeSessions, durable memory, static context, loaders, embeddings, and vector retrieval.
Control and safetyTurn limits, hooks, middleware, approvals, schemas, and guardrails.
OperationsRuntime events, observers, evaluations, server streams, React state, and Studio.

These capabilities attach to the runtime shape you chose. You do not need a different framework when an agent later gains memory or when a pipeline needs observability.

Run your first agent ​

bash
pnpm add @anvia/core @anvia/openai
ts
import { AgentBuilder } from '@anvia/core'
import { OpenAIClient } from '@anvia/openai'

const client = new OpenAIClient({
  apiKey: process.env.OPENAI_API_KEY,
})

const agent = new AgentBuilder('support', client.completionModel('gpt-5'))
  .instructions('Answer support questions clearly.')
  .defaultMaxTurns(4)
  .build()

const response = await agent.prompt('Draft a reply to this ticket.').send()
console.log(response.output)

From runtime to product ​

Keep the agent on the server, expose its events with @anvia/server, consume them with @anvia/react, and attach observers for logs or traces. Use Studio while developing when you need to inspect prompts, sessions, tools, memory, and runtime events.

The runtime remains dependency-injection oriented throughout: your application constructs provider models, stores, indexes, services, tools, and observers, then passes them into Anvia.

Where to start ​

Built for Anvia.