@agentica/core 0.29.1 → 0.29.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,8 +13,8 @@ import type { IMicroAgenticaConfig } from "./IMicroAgenticaConfig";
13
13
  * {@link MicroAgentica}.
14
14
  *
15
15
  * You can customize the system prompt by configuring the
16
- * {@link IAgenticaConfig.systemPrompt} property when creating a new
17
- * {@link Agentica} instance.
16
+ * {@link IMicroAgenticaConfig.systemPrompt} property when creating a new
17
+ * {@link MicroAgentica} instance.
18
18
  *
19
19
  * If you don't configure any system prompts, the default system prompts
20
20
  * would be used which are written in the below directory as markdown
@@ -28,7 +28,14 @@ export interface IMicroAgenticaSystemPrompt<Model extends ILlmSchema.Model> {
28
28
  /**
29
29
  * Common system prompt that would be used in every situation.
30
30
  *
31
- * @param config Configuration of the agent
31
+ * This prompt establishes the foundational behavior and personality of
32
+ * the Micro Agentic AI across all interaction phases. It defines the
33
+ * agent's core identity, communication style, and general operating
34
+ * principles that remain consistent throughout the streamlined conversation
35
+ * flow. Unlike the full Agentica system, MicroAgentica focuses on
36
+ * simplified, direct interactions with reduced complexity.
37
+ *
38
+ * @param config Configuration of the micro agent
32
39
  * @returns The common system prompt
33
40
  * @default https://github.com/wrtnlabs/agentica/tree/main/packages/core/prompts/common.md
34
41
  */
@@ -37,33 +44,92 @@ export interface IMicroAgenticaSystemPrompt<Model extends ILlmSchema.Model> {
37
44
  /**
38
45
  * Execute system prompt.
39
46
  *
40
- * The {@link Agentica} has a process filling the arguments of some
41
- * selected candidate functions by the LLM (Large Language Model)
42
- * function calling feature with the previous prompt histories, and
43
- * executing the arguments filled function with validation feedback.
47
+ * The {@link MicroAgentica} has a streamlined process for filling the
48
+ * arguments of functions by the LLM (Large Language Model) function
49
+ * calling feature with the previous prompt histories, and executing
50
+ * the arguments filled function with validation feedback.
51
+ *
52
+ * In that case, this `execute` system prompt would be used. This prompt
53
+ * instructs the AI to use the supplied tools to assist the user, with
54
+ * specific guidance on handling insufficient information scenarios.
55
+ * When the AI lacks enough context to compose proper function arguments,
56
+ * it is instructed to ask the user for additional information in a
57
+ * concise and clear manner.
44
58
  *
45
- * In that case, this `execute` system prompt would be used. You can
46
- * customize it by assigning this function with the given
47
- * {@link AgenticaHistory histories} parameter.
59
+ * The execute prompt also provides important context about the "tool"
60
+ * role message structure, explaining that the `function` property
61
+ * contains API operation metadata (schema, purpose, parameters, return
62
+ * types) while the `data` property contains the actual return values
63
+ * from function executions.
64
+ *
65
+ * Note: This can be set to `null` to disable the execute phase in
66
+ * MicroAgentica, making it a pure conversational agent without
67
+ * function calling capabilities.
48
68
  *
49
69
  * @param histories Histories of the previous prompts
50
70
  * @returns execute system prompt
51
- * https://github.com/wrtnlabs/agentica/tree/main/packages/core/prompts/execute.md
71
+ * @default https://github.com/wrtnlabs/agentica/tree/main/packages/core/prompts/execute.md
52
72
  */
53
73
  execute?: null | ((histories: MicroAgenticaHistory<Model>[]) => string);
54
74
 
75
+ /**
76
+ * Validation feedback system prompt.
77
+ *
78
+ * When the AI generates function arguments that fail type validation
79
+ * during the execution phase, this prompt provides the system instructions
80
+ * for analyzing {@link IValidation.IFailure} results and generating
81
+ * corrective feedback in the MicroAgentica environment.
82
+ *
83
+ * This specialized prompt enables the AI to:
84
+ * - Parse detailed validation error information from typia validation results
85
+ * - Identify specific type mismatches, missing properties, and format violations
86
+ * - Handle complex union type failures with discriminator property analysis
87
+ * - Generate actionable correction guidance for parameter regeneration
88
+ * - Distinguish between partial fixes and complete reconstruction scenarios
89
+ *
90
+ * The validation feedback agent in MicroAgentica operates with the same
91
+ * precision as the full Agentica system but in a more streamlined context.
92
+ * It acts as an intermediary between the micro AI agent and the function
93
+ * execution system, providing structured feedback that helps improve
94
+ * function calling accuracy through iterative correction.
95
+ *
96
+ * Key capabilities include:
97
+ * - Union type analysis with discriminator property detection
98
+ * - Granular error path reporting (e.g., "input.user.profile.age")
99
+ * - Format-specific guidance (UUID, email, numeric constraints)
100
+ * - Complete reconstruction recommendations for incompatible values
101
+ * - Optimized for the simplified MicroAgentica interaction model
102
+ *
103
+ * @returns validation feedback system prompt
104
+ * @default Built-in validation feedback prompt optimized for typia IValidation.IFailure processing
105
+ */
106
+ validate?: () => string;
107
+
55
108
  /**
56
109
  * Describe system prompt.
57
110
  *
58
- * The {@link Agentica} has a process describing the return values of
111
+ * The {@link MicroAgentica} has a process describing the return values of
59
112
  * the executed functions by requesting to the A.I. agent with the
60
113
  * previous prompt histories.
61
114
  *
62
- * In that case, this `describe` system prompt would be used. You can
63
- * customize it by assigning this function with the given
64
- * {@link AgenticaHistory histories} parameter.
115
+ * In that case, this `describe` system prompt would be used. This prompt
116
+ * instructs the AI to provide detailed descriptions of function call
117
+ * return values rather than brief summaries. It emphasizes comprehensive
118
+ * reporting to ensure users receive thorough information about the
119
+ * function execution results.
65
120
  *
66
- * @param histories Histories of the previous prompts
121
+ * The describe prompt specifies several formatting requirements:
122
+ * - Content must be formatted in markdown
123
+ * - Mermaid syntax should be utilized for diagrams when appropriate
124
+ * - Images should be included using markdown image syntax
125
+ * - Internationalization support with translation to user's language
126
+ * locale when the description language differs from the user's language
127
+ *
128
+ * The prompt receives execution histories specifically, allowing the AI
129
+ * to access both the function metadata and actual execution results
130
+ * for comprehensive reporting in the MicroAgentica streamlined environment.
131
+ *
132
+ * @param histories Histories of the previous prompts and their execution results
67
133
  * @returns describe system prompt
68
134
  * @default https://github.com/wrtnlabs/agentica/tree/main/packages/core/prompts/describe.md
69
135
  */