S
StockBud Docs

StockBud.io AI Agents Schema

Schema for AI agent system, personas, and learning memory in StockBud.io

🤖 StockBud.io AI Agents Schema

Version: 1.0.0

Schema for AI agent system, personas, and learning memory in StockBud.io

Overview

This schema defines 11 data structures:


Definitions

PersonaProfile

Complete persona profile with psychological depth

Properties

PropertyTypeRequiredDescription
idstringUnique persona identifier
namestringPersona name
avatar_urlstringAvatar image URL
ageintegerPersona age
professionstringProfession or occupation
locationstringGeographic location
personality_typeenum: 'conservative', 'aggressive', 'analytical', 'social', 'pragmatic', 'novice', 'visionary', 'skeptical'Core personality archetype
risk_toleranceenum: 'very_low', 'low', 'moderate', 'high', 'very_high'Risk tolerance level
decision_styleenum: 'analytical', 'intuitive', 'collaborative', 'directive'Decision-making style
learning_styleenum: 'visual', 'auditory', 'kinesthetic', 'reading_writing', 'multimodal'Preferred learning style
psychometricsPsychometricProfile
interaction_preferencesInteractionPreference
background_storystringDetailed background story
goalsArray<PersonaGoal>List of persona goals
pain_pointsArray<string>List of pain points
motivationsArray<string>List of motivations
fearsArray<string>List of fears
behavioral_patternsArray<BehavioralPattern>Behavioral patterns
preferred_featuresArray<string>Preferred features
avoided_featuresArray<string>Features to avoid
trusted_sourcesArray<string>Trusted information sources
current_moodstringCurrent emotional state
stress_levelnumberCurrent stress level (0-1)
engagement_levelnumberCurrent engagement level (0-1)
trust_levelnumberTrust level in system (0-1)
created_atstringCreation timestamp
last_updatedstringLast update timestamp

TypeScript

interface PersonaProfile {
  /** Unique persona identifier */
  id: string;
  /** Persona name */
  name: string;
  /** Avatar image URL */
  avatar_url?: string;
  /** Persona age */
  age?: number;
  /** Profession or occupation */
  profession?: string;
  /** Geographic location */
  location?: string;
  /** Core personality archetype */
  personality_type: "conservative" | "aggressive" | "analytical" | "social" | "pragmatic" | "novice" | "visionary" | "skeptical";
  /** Risk tolerance level */
  risk_tolerance: "very_low" | "low" | "moderate" | "high" | "very_high";
  /** Decision-making style */
  decision_style: "analytical" | "intuitive" | "collaborative" | "directive";
  /** Preferred learning style */
  learning_style: "visual" | "auditory" | "kinesthetic" | "reading_writing" | "multimodal";
  psychometrics?: PsychometricProfile;
  interaction_preferences?: InteractionPreference;
  /** Detailed background story */
  background_story?: string;
  /** List of persona goals */
  goals?: PersonaGoal[];
  /** List of pain points */
  pain_points?: string[];
  /** List of motivations */
  motivations?: string[];
  /** List of fears */
  fears?: string[];
  /** Behavioral patterns */
  behavioral_patterns?: BehavioralPattern[];
  /** Preferred features */
  preferred_features?: string[];
  /** Features to avoid */
  avoided_features?: string[];
  /** Trusted information sources */
  trusted_sources?: string[];
  /** Current emotional state */
  current_mood?: string;
  /** Current stress level (0-1) */
  stress_level?: number;
  /** Current engagement level (0-1) */
  engagement_level?: number;
  /** Trust level in system (0-1) */
  trust_level?: number;
  /** Creation timestamp */
  created_at?: string;
  /** Last update timestamp */
  last_updated?: string;
}

PsychometricProfile

Detailed psychometric scoring based on Big Five model

Properties

PropertyTypeRequiredDescription
opennessnumberOpenness to new experiences (0-1)
conscientiousnessnumberOrganization and dependability (0-1)
extraversionnumberSocial engagement (0-1)
agreeablenessnumberCooperation and trust (0-1)
neuroticismnumberEmotional stability (inverse, 0-1)
risk_appetitenumberWillingness to take risks (0-1)
tech_savvinessnumberComfort with technology (0-1)
patience_levelnumberTolerance for delays/complexity (0-1)
detail_orientationnumberAttention to details (0-1)

TypeScript

interface PsychometricProfile {
  /** Openness to new experiences (0-1) */
  openness: number;
  /** Organization and dependability (0-1) */
  conscientiousness: number;
  /** Social engagement (0-1) */
  extraversion: number;
  /** Cooperation and trust (0-1) */
  agreeableness: number;
  /** Emotional stability (inverse, 0-1) */
  neuroticism: number;
  /** Willingness to take risks (0-1) */
  risk_appetite?: number;
  /** Comfort with technology (0-1) */
  tech_savviness?: number;
  /** Tolerance for delays/complexity (0-1) */
  patience_level?: number;
  /** Attention to details (0-1) */
  detail_orientation?: number;
}

InteractionPreference

Interaction and communication preferences

Properties

PropertyTypeRequiredDescription
communication_styleenum: 'direct', 'diplomatic', 'casual', 'formal'Preferred communication style
information_densityenum: 'brief', 'moderate', 'detailed', 'comprehensive'Preferred information density
feedback_frequencyenum: 'minimal', 'periodic', 'frequent', 'continuous'Desired feedback frequency
guidance_levelnumberNeed for guidance/hand-holding (0-1)
autonomy_desirenumberDesire for self-direction (0-1)

TypeScript

interface InteractionPreference {
  /** Preferred communication style */
  communication_style?: "direct" | "diplomatic" | "casual" | "formal";
  /** Preferred information density */
  information_density?: "brief" | "moderate" | "detailed" | "comprehensive";
  /** Desired feedback frequency */
  feedback_frequency?: "minimal" | "periodic" | "frequent" | "continuous";
  /** Need for guidance/hand-holding (0-1) */
  guidance_level?: number;
  /** Desire for self-direction (0-1) */
  autonomy_desire?: number;
}

PersonaGoal

Specific goal for a persona

Properties

PropertyTypeRequiredDescription
goalstringGoal description
priorityenum: 'low', 'medium', 'high', 'critical'Goal priority
timeframeenum: 'short_term', 'medium_term', 'long_term'Goal timeframe
progressnumberProgress towards goal (0-1)

TypeScript

interface PersonaGoal {
  /** Goal description */
  goal: string;
  /** Goal priority */
  priority: "low" | "medium" | "high" | "critical";
  /** Goal timeframe */
  timeframe: "short_term" | "medium_term" | "long_term";
  /** Progress towards goal (0-1) */
  progress?: number;
}

BehavioralPattern

Behavioral pattern definition

Properties

PropertyTypeRequiredDescription
triggerstringWhat triggers this behavior
behaviorstringThe behavioral response
contextArray<string>Contexts where this pattern applies
frequencynumberHow often this pattern occurs (0-1)
intensitynumberIntensity of the behavioral response (0-1)

TypeScript

interface BehavioralPattern {
  /** What triggers this behavior */
  trigger: string;
  /** The behavioral response */
  behavior: string;
  /** Contexts where this pattern applies */
  context: string[];
  /** How often this pattern occurs (0-1) */
  frequency?: number;
  /** Intensity of the behavioral response (0-1) */
  intensity?: number;
}

Memory

Individual memory record in the learning system

Properties

PropertyTypeRequiredDescription
idstringUnique memory identifier
memory_typeenum: 'episodic', 'semantic', 'procedural', 'working'Type of memory storage
contentobjectMemory content (flexible structure)
contextobjectContextual information
importancenumberMemory importance score (0-1)
confidencenumberConfidence in memory accuracy (0-1)
access_countintegerNumber of times accessed
last_accessedstringLast access timestamp
tagsArray<string>Memory tags for categorization
related_memoriesArray<string>IDs of related memories
decay_factornumberMemory decay rate (0-1)
timestampstringMemory creation timestamp

TypeScript

interface Memory {
  /** Unique memory identifier */
  id: string;
  /** Type of memory storage */
  memory_type: "episodic" | "semantic" | "procedural" | "working";
  /** Memory content (flexible structure) */
  content: Record<string, unknown>;
  /** Contextual information */
  context?: Record<string, unknown>;
  /** Memory importance score (0-1) */
  importance: number;
  /** Confidence in memory accuracy (0-1) */
  confidence?: number;
  /** Number of times accessed */
  access_count?: number;
  /** Last access timestamp */
  last_accessed?: string;
  /** Memory tags for categorization */
  tags?: string[];
  /** IDs of related memories */
  related_memories?: string[];
  /** Memory decay rate (0-1) */
  decay_factor?: number;
  /** Memory creation timestamp */
  timestamp: string;
}

Pattern

Learned pattern from experience

Properties

PropertyTypeRequiredDescription
idstringUnique pattern identifier
pattern_typeenum: 'behavioral', 'market', 'user_preference', 'performance', 'risk', 'temporal', 'correlation'Type of pattern
conditionsobjectPattern conditions/triggers
outcomeobjectExpected outcome/result
confidencenumberPattern confidence (0-1)
support_countintegerNumber of supporting instances
success_ratenumberHistorical success rate (0-1)
last_validationstringLast validation timestamp
created_atstringPattern creation timestamp
updated_atstringLast update timestamp

TypeScript

interface Pattern {
  /** Unique pattern identifier */
  id: string;
  /** Type of pattern */
  pattern_type: "behavioral" | "market" | "user_preference" | "performance" | "risk" | "temporal" | "correlation";
  /** Pattern conditions/triggers */
  conditions: Record<string, unknown>;
  /** Expected outcome/result */
  outcome: Record<string, unknown>;
  /** Pattern confidence (0-1) */
  confidence: number;
  /** Number of supporting instances */
  support_count?: number;
  /** Historical success rate (0-1) */
  success_rate?: number;
  /** Last validation timestamp */
  last_validation?: string;
  /** Pattern creation timestamp */
  created_at?: string;
  /** Last update timestamp */
  updated_at?: string;
}

LearningEvent

Learning event that contributes to pattern formation

Properties

PropertyTypeRequiredDescription
event_typestringType of learning event
contextobjectEvent context
actionobjectAction taken
outcomeobjectEvent outcome
successbooleanWhether the event was successful
feedbackobjectFeedback received
timestampstringEvent timestamp

TypeScript

interface LearningEvent {
  /** Type of learning event */
  event_type: string;
  /** Event context */
  context: Record<string, unknown>;
  /** Action taken */
  action?: Record<string, unknown>;
  /** Event outcome */
  outcome: Record<string, unknown>;
  /** Whether the event was successful */
  success?: boolean;
  /** Feedback received */
  feedback?: Record<string, unknown>;
  /** Event timestamp */
  timestamp: string;
}

AgentCapability

Capability definition for an AI agent

Properties

PropertyTypeRequiredDescription
namestringCapability name
descriptionstringCapability description
input_schemaobjectJSON schema for input validation
output_schemaobjectJSON schema for output validation
performance_metricsobjectPerformance tracking metrics

TypeScript

interface AgentCapability {
  /** Capability name */
  name: string;
  /** Capability description */
  description: string;
  /** JSON schema for input validation */
  input_schema: Record<string, unknown>;
  /** JSON schema for output validation */
  output_schema: Record<string, unknown>;
  /** Performance tracking metrics */
  performance_metrics?: Record<string, unknown>;
}

TaskDefinition

Task definition for agent orchestration

Properties

PropertyTypeRequiredDescription
idstringUnique task identifier
namestringTask name
descriptionstringTask description
required_capabilitiesArray<string>Required agent capabilities
priorityenum: 'low', 'medium', 'high', 'critical'Task priority
deadlinestringTask deadline
dependenciesArray<string>Task dependencies
contextobjectTask context and parameters

TypeScript

interface TaskDefinition {
  /** Unique task identifier */
  id: string;
  /** Task name */
  name: string;
  /** Task description */
  description: string;
  /** Required agent capabilities */
  required_capabilities: string[];
  /** Task priority */
  priority?: "low" | "medium" | "high" | "critical";
  /** Task deadline */
  deadline?: string;
  /** Task dependencies */
  dependencies?: string[];
  /** Task context and parameters */
  context?: Record<string, unknown>;
}

TaskResult

Result from task execution

Properties

PropertyTypeRequiredDescription
task_idstringAssociated task identifier
agent_idstringExecuting agent identifier
statusenum: 'pending', 'in_progress', 'completed', 'failed', 'cancelled'Task execution status
resultobjectTask result data
errorstringError message if failed
execution_timenumberExecution time in seconds
confidencenumberConfidence in result (0-1)
metadataobjectAdditional result metadata
timestampstringResult timestamp

TypeScript

interface TaskResult {
  /** Associated task identifier */
  task_id: string;
  /** Executing agent identifier */
  agent_id: string;
  /** Task execution status */
  status: "pending" | "in_progress" | "completed" | "failed" | "cancelled";
  /** Task result data */
  result?: Record<string, unknown>;
  /** Error message if failed */
  error?: string;
  /** Execution time in seconds */
  execution_time?: number;
  /** Confidence in result (0-1) */
  confidence?: number;
  /** Additional result metadata */
  metadata?: Record<string, unknown>;
  /** Result timestamp */
  timestamp: string;
}

Usage Example

import type { PersonaProfile, PsychometricProfile, InteractionPreference, PersonaGoal, BehavioralPattern, Memory, Pattern, LearningEvent, AgentCapability, TaskDefinition, TaskResult } from '@stockbud/schemas';
 
// Create a new PersonaProfile
const example: PersonaProfile = {
  id: "example-value",
  name: "example-value",
  personality_type: "example-value",
  risk_tolerance: "example-value",
  decision_style: "example-value",
};

Full JSON Schema

Click to expand raw JSON Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "StockBud.io AI Agents Schema",
  "description": "Schema for AI agent system, personas, and learning memory in StockBud.io",
  "version": "1.0.0",
  "type": "object",
  "definitions": {
    "PersonaProfile": {
      "type": "object",
      "description": "Complete persona profile with psychological depth",
      "required": [
        "id",
        "name",
        "personality_type",
        "risk_tolerance",
        "decision_style",
        "learning_style"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique persona identifier"
        },
        "name": {
          "type": "string",
          "description": "Persona name"
        },
        "avatar_url": {
          "type": "string",
          "format": "uri",
          "description": "Avatar image URL"
        },
        "age": {
          "type": "integer",
          "minimum": 18,
          "maximum": 100,
          "description": "Persona age"
        },
        "profession": {
          "type": "string",
          "description": "Profession or occupation"
        },
        "location": {
          "type": "string",
          "description": "Geographic location"
        },
        "personality_type": {
          "type": "string",
          "enum": [
            "conservative",
            "aggressive",
            "analytical",
            "social",
            "pragmatic",
            "novice",
            "visionary",
            "skeptical"
          ],
          "description": "Core personality archetype"
        },
        "risk_tolerance": {
          "type": "string",
          "enum": [
            "very_low",
            "low",
            "moderate",
            "high",
            "very_high"
          ],
          "description": "Risk tolerance level"
        },
        "decision_style": {
          "type": "string",
          "enum": [
            "analytical",
            "intuitive",
            "collaborative",
            "directive"
          ],
          "description": "Decision-making style"
        },
        "learning_style": {
          "type": "string",
          "enum": [
            "visual",
            "auditory",
            "kinesthetic",
            "reading_writing",
            "multimodal"
          ],
          "description": "Preferred learning style"
        },
        "psychometrics": {
          "$ref": "#/definitions/PsychometricProfile"
        },
        "interaction_preferences": {
          "$ref": "#/definitions/InteractionPreference"
        },
        "background_story": {
          "type": "string",
          "description": "Detailed background story"
        },
        "goals": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PersonaGoal"
          },
          "description": "List of persona goals"
        },
        "pain_points": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of pain points"
        },
        "motivations": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of motivations"
        },
        "fears": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of fears"
        },
        "behavioral_patterns": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BehavioralPattern"
          },
          "description": "Behavioral patterns"
        },
        "preferred_features": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Preferred features"
        },
        "avoided_features": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Features to avoid"
        },
        "trusted_sources": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Trusted information sources"
        },
        "current_mood": {
          "type": "string",
          "default": "neutral",
          "description": "Current emotional state"
        },
        "stress_level": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.3,
          "description": "Current stress level (0-1)"
        },
        "engagement_level": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.7,
          "description": "Current engagement level (0-1)"
        },
        "trust_level": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.5,
          "description": "Trust level in system (0-1)"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Creation timestamp"
        },
        "last_updated": {
          "type": "string",
          "format": "date-time",
          "description": "Last update timestamp"
        }
      }
    },
    "PsychometricProfile": {
      "type": "object",
      "description": "Detailed psychometric scoring based on Big Five model",
      "required": [
        "openness",
        "conscientiousness",
        "extraversion",
        "agreeableness",
        "neuroticism"
      ],
      "properties": {
        "openness": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Openness to new experiences (0-1)"
        },
        "conscientiousness": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Organization and dependability (0-1)"
        },
        "extraversion": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Social engagement (0-1)"
        },
        "agreeableness": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Cooperation and trust (0-1)"
        },
        "neuroticism": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Emotional stability (inverse, 0-1)"
        },
        "risk_appetite": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Willingness to take risks (0-1)"
        },
        "tech_savviness": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Comfort with technology (0-1)"
        },
        "patience_level": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Tolerance for delays/complexity (0-1)"
        },
        "detail_orientation": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Attention to details (0-1)"
        }
      }
    },
    "InteractionPreference": {
      "type": "object",
      "description": "Interaction and communication preferences",
      "properties": {
        "communication_style": {
          "type": "string",
          "enum": [
            "direct",
            "diplomatic",
            "casual",
            "formal"
          ],
          "description": "Preferred communication style"
        },
        "information_density": {
          "type": "string",
          "enum": [
            "brief",
            "moderate",
            "detailed",
            "comprehensive"
          ],
          "description": "Preferred information density"
        },
        "feedback_frequency": {
          "type": "string",
          "enum": [
            "minimal",
            "periodic",
            "frequent",
            "continuous"
          ],
          "description": "Desired feedback frequency"
        },
        "guidance_level": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Need for guidance/hand-holding (0-1)"
        },
        "autonomy_desire": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Desire for self-direction (0-1)"
        }
      }
    },
    "PersonaGoal": {
      "type": "object",
      "description": "Specific goal for a persona",
      "required": [
        "goal",
        "priority",
        "timeframe"
      ],
      "properties": {
        "goal": {
          "type": "string",
          "description": "Goal description"
        },
        "priority": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high",
            "critical"
          ],
          "description": "Goal priority"
        },
        "timeframe": {
          "type": "string",
          "enum": [
            "short_term",
            "medium_term",
            "long_term"
          ],
          "description": "Goal timeframe"
        },
        "progress": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0,
          "description": "Progress towards goal (0-1)"
        }
      }
    },
    "BehavioralPattern": {
      "type": "object",
      "description": "Behavioral pattern definition",
      "required": [
        "trigger",
        "behavior",
        "context"
      ],
      "properties": {
        "trigger": {
          "type": "string",
          "description": "What triggers this behavior"
        },
        "behavior": {
          "type": "string",
          "description": "The behavioral response"
        },
        "context": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Contexts where this pattern applies"
        },
        "frequency": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.5,
          "description": "How often this pattern occurs (0-1)"
        },
        "intensity": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.5,
          "description": "Intensity of the behavioral response (0-1)"
        }
      }
    },
    "Memory": {
      "type": "object",
      "description": "Individual memory record in the learning system",
      "required": [
        "id",
        "memory_type",
        "content",
        "importance",
        "timestamp"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique memory identifier"
        },
        "memory_type": {
          "type": "string",
          "enum": [
            "episodic",
            "semantic",
            "procedural",
            "working"
          ],
          "description": "Type of memory storage"
        },
        "content": {
          "type": "object",
          "description": "Memory content (flexible structure)"
        },
        "context": {
          "type": "object",
          "description": "Contextual information"
        },
        "importance": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Memory importance score (0-1)"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence in memory accuracy (0-1)"
        },
        "access_count": {
          "type": "integer",
          "minimum": 0,
          "default": 0,
          "description": "Number of times accessed"
        },
        "last_accessed": {
          "type": "string",
          "format": "date-time",
          "description": "Last access timestamp"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Memory tags for categorization"
        },
        "related_memories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IDs of related memories"
        },
        "decay_factor": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.1,
          "description": "Memory decay rate (0-1)"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Memory creation timestamp"
        }
      }
    },
    "Pattern": {
      "type": "object",
      "description": "Learned pattern from experience",
      "required": [
        "id",
        "pattern_type",
        "conditions",
        "outcome",
        "confidence"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique pattern identifier"
        },
        "pattern_type": {
          "type": "string",
          "enum": [
            "behavioral",
            "market",
            "user_preference",
            "performance",
            "risk",
            "temporal",
            "correlation"
          ],
          "description": "Type of pattern"
        },
        "conditions": {
          "type": "object",
          "description": "Pattern conditions/triggers"
        },
        "outcome": {
          "type": "object",
          "description": "Expected outcome/result"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Pattern confidence (0-1)"
        },
        "support_count": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of supporting instances"
        },
        "success_rate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Historical success rate (0-1)"
        },
        "last_validation": {
          "type": "string",
          "format": "date-time",
          "description": "Last validation timestamp"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Pattern creation timestamp"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Last update timestamp"
        }
      }
    },
    "LearningEvent": {
      "type": "object",
      "description": "Learning event that contributes to pattern formation",
      "required": [
        "event_type",
        "context",
        "outcome",
        "timestamp"
      ],
      "properties": {
        "event_type": {
          "type": "string",
          "description": "Type of learning event"
        },
        "context": {
          "type": "object",
          "description": "Event context"
        },
        "action": {
          "type": "object",
          "description": "Action taken"
        },
        "outcome": {
          "type": "object",
          "description": "Event outcome"
        },
        "success": {
          "type": "boolean",
          "description": "Whether the event was successful"
        },
        "feedback": {
          "type": "object",
          "description": "Feedback received"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Event timestamp"
        }
      }
    },
    "AgentCapability": {
      "type": "object",
      "description": "Capability definition for an AI agent",
      "required": [
        "name",
        "description",
        "input_schema",
        "output_schema"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Capability name"
        },
        "description": {
          "type": "string",
          "description": "Capability description"
        },
        "input_schema": {
          "type": "object",
          "description": "JSON schema for input validation"
        },
        "output_schema": {
          "type": "object",
          "description": "JSON schema for output validation"
        },
        "performance_metrics": {
          "type": "object",
          "description": "Performance tracking metrics"
        }
      }
    },
    "TaskDefinition": {
      "type": "object",
      "description": "Task definition for agent orchestration",
      "required": [
        "id",
        "name",
        "description",
        "required_capabilities"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique task identifier"
        },
        "name": {
          "type": "string",
          "description": "Task name"
        },
        "description": {
          "type": "string",
          "description": "Task description"
        },
        "required_capabilities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Required agent capabilities"
        },
        "priority": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high",
            "critical"
          ],
          "description": "Task priority"
        },
        "deadline": {
          "type": "string",
          "format": "date-time",
          "description": "Task deadline"
        },
        "dependencies": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Task dependencies"
        },
        "context": {
          "type": "object",
          "description": "Task context and parameters"
        }
      }
    },
    "TaskResult": {
      "type": "object",
      "description": "Result from task execution",
      "required": [
        "task_id",
        "agent_id",
        "status",
        "timestamp"
      ],
      "properties": {
        "task_id": {
          "type": "string",
          "description": "Associated task identifier"
        },
        "agent_id": {
          "type": "string",
          "description": "Executing agent identifier"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "in_progress",
            "completed",
            "failed",
            "cancelled"
          ],
          "description": "Task execution status"
        },
        "result": {
          "type": "object",
          "description": "Task result data"
        },
        "error": {
          "type": "string",
          "description": "Error message if failed"
        },
        "execution_time": {
          "type": "number",
          "minimum": 0,
          "description": "Execution time in seconds"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence in result (0-1)"
        },
        "metadata": {
          "type": "object",
          "description": "Additional result metadata"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Result timestamp"
        }
      }
    }
  },
  "properties": {
    "personas": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/PersonaProfile"
      }
    },
    "memories": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Memory"
      }
    },
    "patterns": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Pattern"
      }
    },
    "learning_events": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/LearningEvent"
      }
    },
    "agent_capabilities": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/AgentCapability"
      }
    },
    "tasks": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/TaskDefinition"
      }
    },
    "task_results": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/TaskResult"
      }
    }
  }
}