Defining a capability as a prompt object
In Axiom AI engineering, every capability is represented by aPrompt object. This object serves as the single source of truth for the capability’s logic, including its messages, metadata, and the schema for its arguments.
For now, these Prompt objects can be defined and managed as TypeScript files within your own project repository.
A typical Prompt object looks like this:
/src/prompts/email-summarizer.prompt.ts
Strongly-typed arguments with Template
To ensure that prompts are used correctly, the Axiom’s AI SDK includes a Template type system (exported as Type) for defining the schema of a prompt’s arguments. This provides type safety, autocompletion, and a clear, self-documenting definition of what data the prompt expects.
The arguments object uses Template helpers to define the shape of the context:
/src/prompts/report-generator.prompt.ts
InferContext utility.
Prototyping and local testing
Before using a prompt in your application, you can test it locally using theparse function. This function takes a Prompt object and a context object, rendering the templated messages to verify the output. This is a quick way to ensure your templating logic is correct.
Managing prompts with Axiom
To enable more advanced workflows and collaboration, Axiom is building tools to manage your prompt assets centrally.- Coming soonThe
axiomCLI will allow you topush,pull, andlistprompt versions directly from your terminal, synchronizing your local files with the Axiom platform. - Coming soonThe SDK will include methods like
axiom.prompts.create()andaxiom.prompts.load()for programmatic access to your managed prompts. This will be the foundation for A/B testing, version comparison, and deploying new prompts without changing your application code.