Learn how to create and define AI capabilities using structured prompts and typed arguments with Axiom.
Prompt
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:
Template
@axiomhq/ai
package 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:
InferContext
utility.
parse
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.
axiom
CLI will allow you to push
, pull
, and list
prompt versions directly from your terminal, synchronizing your local files with the Axiom platform.axiom.prompts.create()
and axiom.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.