ObjectStackObjectStack

Agent

Agent protocol schemas

AI Model Configuration

Source: packages/spec/src/ai/agent.zod.ts

TypeScript Usage

import { AIKnowledge, AIModelConfig, AITool, Agent, StructuredOutputConfig, StructuredOutputFormat, TransformPipelineStep } from '@objectstack/spec/ai';
import type { AIKnowledge, AIModelConfig, AITool, Agent, StructuredOutputConfig, StructuredOutputFormat, TransformPipelineStep } from '@objectstack/spec/ai';

// Validate data
const result = AIKnowledge.parse(data);

AIKnowledge

Properties

PropertyTypeRequiredDescription
topicsstring[]Topics/Tags to recruit knowledge from
indexesstring[]Vector Store Indexes

AIModelConfig

Properties

PropertyTypeRequiredDescription
providerEnum<'openai' | 'azure_openai' | 'anthropic' | 'local'>
modelstringModel name (e.g. gpt-4, claude-3-opus)
temperaturenumber
maxTokensnumberoptional
topPnumberoptional

AITool

Properties

PropertyTypeRequiredDescription
typeEnum<'action' | 'flow' | 'query' | 'vector_search'>
namestringReference name (Action Name, Flow Name)
descriptionstringoptionalOverride description for the LLM

Agent

Properties

PropertyTypeRequiredDescription
namestringAgent unique identifier
labelstringAgent display name
avatarstringoptional
rolestringThe persona/role (e.g. "Senior Support Engineer")
instructionsstringSystem Prompt / Prime Directives
modelObjectoptional
lifecycleObjectoptionalState machine defining the agent conversation follow and constraints
toolsObject[]optionalAvailable tools
knowledgeObjectoptionalRAG access
activeboolean
accessstring[]optionalWho can chat with this agent
tenantIdstringoptionalTenant/Organization ID
visibilityEnum<'global' | 'organization' | 'private'>
planningObjectoptionalAutonomous reasoning and planning configuration
memoryObjectoptionalAgent memory management
guardrailsObjectoptionalSafety guardrails for the agent
structuredOutputObjectoptionalStructured output format and validation configuration

StructuredOutputConfig

Structured output configuration for agent responses

Properties

PropertyTypeRequiredDescription
formatEnum<'json_object' | 'json_schema' | 'regex' | 'grammar' | 'xml'>Expected output format
schemaRecord<string, any>optionalJSON Schema definition for output
strictbooleanEnforce exact schema compliance
retryOnValidationFailurebooleanRetry generation when output fails validation
maxRetriesintegerMaximum retries on validation failure
fallbackFormatEnum<'json_object' | 'json_schema' | 'regex' | 'grammar' | 'xml'>optionalFallback format if primary format fails
transformPipelineEnum<'trim' | 'parse_json' | 'validate' | 'coerce_types'>[]optionalPost-processing steps applied to output

StructuredOutputFormat

Output format for structured agent responses

Allowed Values

  • json_object
  • json_schema
  • regex
  • grammar
  • xml

TransformPipelineStep

Post-processing step for structured output

Allowed Values

  • trim
  • parse_json
  • validate
  • coerce_types

On this page