Build AI capabilities using any framework, with best support for TypeScript-based tools.
Building an AI starts with prototyping. You can use whichever framework you prefer. Axiom is focused on helping you evaluate and observe your capabilities rather than prescribing how to build them.TypeScript-based frameworks like Vercel’s AI SDK do integrate most seamlessly with Axiom’s tooling today, but that’s likely to evolve over time.
Define your capability using your framework of choice. Here’s an example using Vercel’s AI SDK, which includes many examples covering different capability design patterns. Popular alternatives like Mastra also exist.
src/lib/capabilities/classify-ticket.ts
Copy
Ask AI
import { generateObject } from 'ai';import { openai } from '@ai-sdk/openai';import { wrapAISDKModel } from 'axiom/ai';import { z } from 'zod';export async function classifyTicket(input: { subject?: string; content: string}) { const result = await generateObject({ model: wrapAISDKModel(openai('gpt-4o-mini')), messages: [ { role: 'system', content: 'Classify support tickets as: question, bug_report, or feature_request.', }, { role: 'user', content: input.subject ? `Subject: ${input.subject}\n\n${input.content}` : input.content, }, ], schema: z.object({ category: z.enum(['question', 'bug_report', 'feature_request']), confidence: z.number().min(0).max(1), }), }); return result.object;}
The wrapAISDKModel function instruments your model calls for Axiom’s observability features. Learn more in the Observe section.
As you prototype, collect examples of inputs and their correct outputs.
Copy
Ask AI
const referenceExamples = [ { input: { subject: 'How do I reset my password?', content: 'I forgot my password and need help.' }, expected: { category: 'question' }, }, { input: { subject: 'App crashes on startup', content: 'The app immediately crashes when I open it.' }, expected: { category: 'bug_report' }, },];
These become your ground truth for evaluation. Learn more in the Evaluate section.
Once you have a working capability and reference examples, systematically evaluate its performance.To learn how to set up and run evaluations, see Evaluate.