@elizaos/plugin-experience 2.0.0-alpha.5 → 2.0.0-alpha.6
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.
- package/dist/node/index.node.js +29 -5
- package/dist/node/index.node.js.map +6 -6
- package/package.json +4 -4
- package/dist/actions/index.d.ts +0 -2
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/actions/record-experience.d.ts +0 -3
- package/dist/actions/record-experience.d.ts.map +0 -1
- package/dist/build.d.ts +0 -3
- package/dist/build.d.ts.map +0 -1
- package/dist/evaluators/experienceEvaluator.d.ts +0 -3
- package/dist/evaluators/experienceEvaluator.d.ts.map +0 -1
- package/dist/generated/prompts/typescript/prompts.d.ts +0 -12
- package/dist/generated/prompts/typescript/prompts.d.ts.map +0 -1
- package/dist/generated/specs/spec-helpers.d.ts +0 -49
- package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
- package/dist/generated/specs/specs.d.ts +0 -159
- package/dist/generated/specs/specs.d.ts.map +0 -1
- package/dist/index.browser.d.ts +0 -4
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/providers/experienceProvider.d.ts +0 -3
- package/dist/providers/experienceProvider.d.ts.map +0 -1
- package/dist/service.d.ts +0 -45
- package/dist/service.d.ts.map +0 -1
- package/dist/types.d.ts +0 -89
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/confidenceDecay.d.ts +0 -34
- package/dist/utils/confidenceDecay.d.ts.map +0 -1
- package/dist/utils/experienceAnalyzer.d.ts +0 -16
- package/dist/utils/experienceAnalyzer.d.ts.map +0 -1
- package/dist/utils/experienceFormatter.d.ts +0 -23
- package/dist/utils/experienceFormatter.d.ts.map +0 -1
- package/dist/utils/experienceRelationships.d.ts +0 -25
- package/dist/utils/experienceRelationships.d.ts.map +0 -1
package/dist/node/index.node.js
CHANGED
|
@@ -220,9 +220,30 @@ var recordExperienceAction = {
|
|
|
220
220
|
similes: spec.similes ? [...spec.similes] : [],
|
|
221
221
|
description: spec.description,
|
|
222
222
|
examples: spec.examples ?? [],
|
|
223
|
-
async
|
|
224
|
-
const
|
|
225
|
-
|
|
223
|
+
validate: async (runtime, message, state, options) => {
|
|
224
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
225
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
226
|
+
const __avKeywords = ["record", "experience"];
|
|
227
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
228
|
+
const __avRegex = /\b(?:record|experience)\b/i;
|
|
229
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
230
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
231
|
+
const __avExpectedSource = "";
|
|
232
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
233
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
234
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
235
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
const __avLegacyValidate = async (_runtime, message2) => {
|
|
239
|
+
const text = message2.content.text?.toLowerCase();
|
|
240
|
+
return text?.includes("remember") || text?.includes("record") || false;
|
|
241
|
+
};
|
|
242
|
+
try {
|
|
243
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
244
|
+
} catch {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
226
247
|
},
|
|
227
248
|
async handler(runtime, message, state, _options, _callback) {
|
|
228
249
|
logger.info("Recording experience for message:", message.id);
|
|
@@ -522,6 +543,7 @@ var spec2 = requireProviderSpec("experienceProvider");
|
|
|
522
543
|
var experienceProvider = {
|
|
523
544
|
name: spec2.name,
|
|
524
545
|
description: "Provides relevant past experiences and learnings for the current context",
|
|
546
|
+
dynamic: true,
|
|
525
547
|
async get(runtime, message, _state) {
|
|
526
548
|
const experienceService = runtime.getService("EXPERIENCE");
|
|
527
549
|
if (!experienceService) {
|
|
@@ -1030,7 +1052,9 @@ class ExperienceService extends Service {
|
|
|
1030
1052
|
}
|
|
1031
1053
|
let queryEmbedding;
|
|
1032
1054
|
try {
|
|
1033
|
-
queryEmbedding = await this.runtime.useModel(ModelType2.TEXT_EMBEDDING, {
|
|
1055
|
+
queryEmbedding = await this.runtime.useModel(ModelType2.TEXT_EMBEDDING, {
|
|
1056
|
+
text
|
|
1057
|
+
});
|
|
1034
1058
|
if (!Array.isArray(queryEmbedding) || queryEmbedding.length === 0 || queryEmbedding.every((v) => v === 0)) {
|
|
1035
1059
|
logger4.warn("[ExperienceService] Query embedding is empty/zero, falling back to recency sort");
|
|
1036
1060
|
return this.fallbackSort(limit);
|
|
@@ -1254,4 +1278,4 @@ export {
|
|
|
1254
1278
|
ExperienceService
|
|
1255
1279
|
};
|
|
1256
1280
|
|
|
1257
|
-
//# debugId=
|
|
1281
|
+
//# debugId=21141D6C2118F96564756E2164756E21
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
"sources": ["../../index.ts", "../../actions/record-experience.ts", "../../generated/specs/specs.ts", "../../generated/specs/spec-helpers.ts", "../../evaluators/experienceEvaluator.ts", "../../generated/prompts/typescript/prompts.ts", "../../types.ts", "../../providers/experienceProvider.ts", "../../service.ts", "../../utils/confidenceDecay.ts", "../../utils/experienceRelationships.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { IAgentRuntime, Plugin } from \"@elizaos/core\";\nimport { logger } from \"@elizaos/core\";\nimport { recordExperienceAction } from \"./actions/record-experience\";\nimport { experienceEvaluator } from \"./evaluators/experienceEvaluator\";\nimport { experienceProvider } from \"./providers/experienceProvider\";\nimport { ExperienceService } from \"./service\";\nimport \"./types\";\n\nexport const experiencePlugin: Plugin = {\n name: \"experience\",\n description:\n \"Self-learning experience system that records and recalls transferable agent learnings\",\n\n actions: [recordExperienceAction],\n services: [ExperienceService],\n providers: [experienceProvider],\n evaluators: [experienceEvaluator],\n\n async init(config: Record<string, string>, runtime: IAgentRuntime): Promise<void> {\n logger.info(\"[ExperiencePlugin] Initializing experience learning system\");\n\n const autoRecordThreshold = parseOptionalNumber(config.AUTO_RECORD_THRESHOLD, 0.7);\n\n runtime.setSetting(\"AUTO_RECORD_THRESHOLD\", autoRecordThreshold.toString());\n\n logger.info(`[ExperiencePlugin] Configuration:\n - AUTO_RECORD_THRESHOLD: ${autoRecordThreshold}`);\n },\n};\n\nexport default experiencePlugin;\n\nexport { ExperienceService } from \"./service\";\nexport * from \"./types\";\n\nfunction parseOptionalNumber(value: string | undefined, fallback: number): number {\n if (!value) return fallback;\n const parsed = Number.parseFloat(value);\n return Number.isFinite(parsed) ? parsed : fallback;\n}\n",
|
|
6
|
-
"import {\n type Action,\n type ActionExample,\n type ActionResult,\n createUniqueUuid,\n type HandlerCallback,\n type HandlerOptions,\n type IAgentRuntime,\n logger,\n type Memory,\n type State,\n} from \"@elizaos/core\";\nimport { requireActionSpec } from \"../generated/specs/spec-helpers\";\n\nconst spec = requireActionSpec(\"RECORD_EXPERIENCE\");\n\nexport const recordExperienceAction: Action = {\n name: spec.name,\n similes: spec.similes ? [...spec.similes] : [],\n description: spec.description,\n examples: (spec.examples ?? []) as ActionExample[][],\n\n async
|
|
6
|
+
"import {\n type Action,\n type ActionExample,\n type ActionResult,\n createUniqueUuid,\n type HandlerCallback,\n type HandlerOptions,\n type IAgentRuntime,\n logger,\n type Memory,\n type State,\n} from \"@elizaos/core\";\nimport { requireActionSpec } from \"../generated/specs/spec-helpers\";\n\nconst spec = requireActionSpec(\"RECORD_EXPERIENCE\");\n\nexport const recordExperienceAction: Action = {\n name: spec.name,\n similes: spec.similes ? [...spec.similes] : [],\n description: spec.description,\n examples: (spec.examples ?? []) as ActionExample[][],\n\n validate: async (runtime: any, message: any, state?: any, options?: any): Promise<boolean> => {\n const __avTextRaw = typeof message?.content?.text === \"string\" ? message.content.text : \"\";\n const __avText = __avTextRaw.toLowerCase();\n const __avKeywords = [\"record\", \"experience\"];\n const __avKeywordOk =\n __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));\n const __avRegex = /\\b(?:record|experience)\\b/i;\n const __avRegexOk = __avRegex.test(__avText);\n const __avSource = String(message?.content?.source ?? message?.source ?? \"\");\n const __avExpectedSource = \"\";\n const __avSourceOk = __avExpectedSource\n ? __avSource === __avExpectedSource\n : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);\n const __avOptions = options && typeof options === \"object\" ? options : {};\n const __avInputOk =\n __avText.trim().length > 0 ||\n Object.keys(__avOptions as Record<string, unknown>).length > 0 ||\n Boolean(message?.content && typeof message.content === \"object\");\n\n if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {\n return false;\n }\n\n const __avLegacyValidate = async (_runtime: IAgentRuntime, message: Memory) => {\n const text = message.content.text?.toLowerCase();\n return text?.includes(\"remember\") || text?.includes(\"record\") || false;\n };\n try {\n return Boolean(await (__avLegacyValidate as any)(runtime, message, state, options));\n } catch {\n return false;\n }\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state?: State,\n _options?: HandlerOptions,\n _callback?: HandlerCallback\n ): Promise<ActionResult> {\n void _options;\n void _callback;\n\n logger.info(\"Recording experience for message:\", message.id);\n\n // Create experience memory with context\n const experienceMemory: Memory = {\n id: createUniqueUuid(runtime, `experience-${message.id}`),\n entityId: message.entityId,\n agentId: runtime.agentId,\n roomId: message.roomId,\n content: {\n text: message.content.text,\n source: message.content.source,\n type: \"experience\",\n context: state?.text,\n },\n createdAt: Date.now(),\n };\n\n // Store in experiences table\n await runtime.createMemory(experienceMemory, \"experiences\", true);\n logger.info(\"Experience recorded successfully\");\n\n return {\n success: true,\n text: \"Experience recorded.\",\n data: {\n experienceMemoryId: experienceMemory.id,\n },\n };\n },\n};\n",
|
|
7
7
|
"/**\n * Auto-generated canonical action/provider/evaluator docs for plugin-experience.\n * DO NOT EDIT - Generated from prompts/specs/**.\n */\n\nexport type ActionDoc = {\n name: string;\n description: string;\n similes?: readonly string[];\n parameters?: readonly unknown[];\n examples?: readonly (readonly unknown[])[];\n};\n\nexport type ProviderDoc = {\n name: string;\n description: string;\n position?: number;\n dynamic?: boolean;\n};\n\nexport type EvaluatorDoc = {\n name: string;\n description: string;\n similes?: readonly string[];\n alwaysRun?: boolean;\n examples?: readonly unknown[];\n};\n\nexport const coreActionsSpec = {\n version: \"1.0.0\",\n actions: [\n {\n name: \"RECORD_EXPERIENCE\",\n description:\n \"Record a learning or experience for future reference. Use this when the user explicitly asks you to remember something or when you've learned something important.\",\n similes: [\"REMEMBER\", \"LEARN\", \"STORE_EXPERIENCE\", \"SAVE_EXPERIENCE\", \"RECORD_LEARNING\"],\n parameters: [],\n examples: [\n [\n {\n name: \"{{name1}}\",\n content: {\n text: \"Remember that installing dependencies is required for Python scripts\",\n },\n },\n {\n name: \"{{name2}}\",\n content: {\n text: \"I'll record that experience. Learning: Need to install dependencies before running Python scripts.\",\n actions: [\"RECORD_EXPERIENCE\"],\n },\n },\n ],\n [\n {\n name: \"{{name1}}\",\n content: {\n text: \"Remember that users prefer shorter responses\",\n },\n },\n {\n name: \"{{name2}}\",\n content: {\n text: \"I'll remember that preference.\",\n actions: [\"RECORD_EXPERIENCE\"],\n },\n },\n ],\n [\n {\n name: \"{{name1}}\",\n content: {\n text: \"What's 2+2?\",\n },\n },\n {\n name: \"{{name2}}\",\n content: {\n text: \"2+2 equals 4.\",\n },\n },\n ],\n [\n {\n name: \"{{name1}}\",\n content: {\n text: \"Can you help me with math?\",\n },\n },\n {\n name: \"{{name2}}\",\n content: {\n text: \"Of course! What math problem do you need help with?\",\n },\n },\n ],\n ],\n },\n ],\n} as const;\nexport const allActionsSpec = {\n version: \"1.0.0\",\n actions: [\n {\n name: \"RECORD_EXPERIENCE\",\n description:\n \"Record a learning or experience for future reference. Use this when the user explicitly asks you to remember something or when you've learned something important.\",\n similes: [\"REMEMBER\", \"LEARN\", \"STORE_EXPERIENCE\", \"SAVE_EXPERIENCE\", \"RECORD_LEARNING\"],\n parameters: [],\n examples: [\n [\n {\n name: \"{{name1}}\",\n content: {\n text: \"Remember that installing dependencies is required for Python scripts\",\n },\n },\n {\n name: \"{{name2}}\",\n content: {\n text: \"I'll record that experience. Learning: Need to install dependencies before running Python scripts.\",\n actions: [\"RECORD_EXPERIENCE\"],\n },\n },\n ],\n [\n {\n name: \"{{name1}}\",\n content: {\n text: \"Remember that users prefer shorter responses\",\n },\n },\n {\n name: \"{{name2}}\",\n content: {\n text: \"I'll remember that preference.\",\n actions: [\"RECORD_EXPERIENCE\"],\n },\n },\n ],\n [\n {\n name: \"{{name1}}\",\n content: {\n text: \"What's 2+2?\",\n },\n },\n {\n name: \"{{name2}}\",\n content: {\n text: \"2+2 equals 4.\",\n },\n },\n ],\n [\n {\n name: \"{{name1}}\",\n content: {\n text: \"Can you help me with math?\",\n },\n },\n {\n name: \"{{name2}}\",\n content: {\n text: \"Of course! What math problem do you need help with?\",\n },\n },\n ],\n ],\n },\n ],\n} as const;\nexport const coreProvidersSpec = {\n version: \"1.0.0\",\n providers: [\n {\n name: \"experienceProvider\",\n description: \"Provides relevant past experiences and learnings for the current context\",\n dynamic: true,\n },\n ],\n} as const;\nexport const allProvidersSpec = {\n version: \"1.0.0\",\n providers: [\n {\n name: \"experienceProvider\",\n description: \"Provides relevant past experiences and learnings for the current context\",\n dynamic: true,\n },\n ],\n} as const;\nexport const coreEvaluatorsSpec = {\n version: \"1.0.0\",\n evaluators: [],\n} as const;\nexport const allEvaluatorsSpec = {\n version: \"1.0.0\",\n evaluators: [],\n} as const;\n\nexport const coreActionDocs: readonly ActionDoc[] = coreActionsSpec.actions;\nexport const allActionDocs: readonly ActionDoc[] = allActionsSpec.actions;\nexport const coreProviderDocs: readonly ProviderDoc[] = coreProvidersSpec.providers;\nexport const allProviderDocs: readonly ProviderDoc[] = allProvidersSpec.providers;\nexport const coreEvaluatorDocs: readonly EvaluatorDoc[] = coreEvaluatorsSpec.evaluators;\nexport const allEvaluatorDocs: readonly EvaluatorDoc[] = allEvaluatorsSpec.evaluators;\n",
|
|
8
8
|
"/**\n * Helper functions to lookup action/provider/evaluator specs by name.\n * These allow language-specific implementations to import their text content\n * (description, similes, examples) from the centralized specs.\n *\n * DO NOT EDIT the spec data - update prompts/actions.json, prompts/providers.json, prompts/evaluators.json and regenerate.\n */\n\nimport {\n type ActionDoc,\n allActionDocs,\n allEvaluatorDocs,\n allProviderDocs,\n coreActionDocs,\n coreEvaluatorDocs,\n coreProviderDocs,\n type EvaluatorDoc,\n type ProviderDoc,\n} from \"./specs\";\n\n// Build lookup maps for O(1) access\nconst coreActionMap = new Map<string, ActionDoc>(coreActionDocs.map((doc) => [doc.name, doc]));\nconst allActionMap = new Map<string, ActionDoc>(allActionDocs.map((doc) => [doc.name, doc]));\nconst coreProviderMap = new Map<string, ProviderDoc>(\n coreProviderDocs.map((doc) => [doc.name, doc])\n);\nconst allProviderMap = new Map<string, ProviderDoc>(allProviderDocs.map((doc) => [doc.name, doc]));\nconst coreEvaluatorMap = new Map<string, EvaluatorDoc>(\n coreEvaluatorDocs.map((doc) => [doc.name, doc])\n);\nconst allEvaluatorMap = new Map<string, EvaluatorDoc>(\n allEvaluatorDocs.map((doc) => [doc.name, doc])\n);\n\n/**\n * Get an action spec by name from the core specs.\n * @param name - The action name\n * @returns The action spec or undefined if not found\n */\nexport function getActionSpec(name: string): ActionDoc | undefined {\n return coreActionMap.get(name) ?? allActionMap.get(name);\n}\n\n/**\n * Get an action spec by name, throwing if not found.\n * @param name - The action name\n * @returns The action spec\n * @throws Error if the action is not found\n */\nexport function requireActionSpec(name: string): ActionDoc {\n const spec = getActionSpec(name);\n if (!spec) {\n throw new Error(`Action spec not found: ${name}`);\n }\n return spec;\n}\n\n/**\n * Get a provider spec by name from the core specs.\n * @param name - The provider name\n * @returns The provider spec or undefined if not found\n */\nexport function getProviderSpec(name: string): ProviderDoc | undefined {\n return coreProviderMap.get(name) ?? allProviderMap.get(name);\n}\n\n/**\n * Get a provider spec by name, throwing if not found.\n * @param name - The provider name\n * @returns The provider spec\n * @throws Error if the provider is not found\n */\nexport function requireProviderSpec(name: string): ProviderDoc {\n const spec = getProviderSpec(name);\n if (!spec) {\n throw new Error(`Provider spec not found: ${name}`);\n }\n return spec;\n}\n\n/**\n * Get an evaluator spec by name from the core specs.\n * @param name - The evaluator name\n * @returns The evaluator spec or undefined if not found\n */\nexport function getEvaluatorSpec(name: string): EvaluatorDoc | undefined {\n return coreEvaluatorMap.get(name) ?? allEvaluatorMap.get(name);\n}\n\n/**\n * Get an evaluator spec by name, throwing if not found.\n * @param name - The evaluator name\n * @returns The evaluator spec\n * @throws Error if the evaluator is not found\n */\nexport function requireEvaluatorSpec(name: string): EvaluatorDoc {\n const spec = getEvaluatorSpec(name);\n if (!spec) {\n throw new Error(`Evaluator spec not found: ${name}`);\n }\n return spec;\n}\n\n// Re-export types for convenience\nexport type { ActionDoc, ProviderDoc, EvaluatorDoc };\n",
|
|
9
9
|
"import {\n type ActionResult,\n composePrompt,\n type Evaluator,\n type HandlerCallback,\n type HandlerOptions,\n type IAgentRuntime,\n logger,\n type Memory,\n ModelType,\n type State,\n} from \"@elizaos/core\";\nimport { EXTRACT_EXPERIENCES_TEMPLATE } from \"../generated/prompts/typescript/prompts.js\";\nimport type { ExperienceService } from \"../service\";\nimport { ExperienceType, OutcomeType } from \"../types\";\n\ntype ExtractedExperience = {\n type?: string;\n learning?: string;\n context?: string;\n confidence?: number;\n reasoning?: string;\n};\n\nexport const experienceEvaluator: Evaluator = {\n name: \"EXPERIENCE_EVALUATOR\",\n similes: [\"experience recorder\", \"learning evaluator\", \"self-reflection\"],\n description: \"Periodically analyzes conversation patterns to extract novel learning experiences\",\n alwaysRun: false,\n\n examples: [\n {\n prompt: \"The agent successfully executed a shell command after initially failing\",\n messages: [\n {\n name: \"Autoliza\",\n content: {\n text: \"Let me try to run this Python script.\",\n },\n },\n {\n name: \"Autoliza\",\n content: {\n text: \"Error: ModuleNotFoundError for pandas. I need to install it first.\",\n },\n },\n {\n name: \"Autoliza\",\n content: {\n text: \"After installing pandas, the script ran successfully and produced the expected output.\",\n },\n },\n ],\n outcome:\n \"Record a CORRECTION experience about needing to install dependencies before running Python scripts\",\n },\n {\n prompt: \"The agent discovered a new system capability\",\n messages: [\n {\n name: \"Autoliza\",\n content: {\n text: \"I found that the system has jq installed, which is perfect for parsing JSON data.\",\n },\n },\n ],\n outcome: \"Record a DISCOVERY experience about the availability of jq for JSON processing\",\n },\n ],\n\n async validate(runtime: IAgentRuntime, message: Memory, _state?: State): Promise<boolean> {\n // Only run every 10 messages and only on agent messages\n if (message.entityId !== runtime.agentId) {\n return false;\n }\n\n // Check cooldown - only extract experiences every 25 messages to reduce token cost\n const lastExtractionKey = \"experience-extraction:last-message-count\";\n const currentCount = (await runtime.getCache<string>(lastExtractionKey)) || \"0\";\n const messageCount = Number.parseInt(currentCount, 10);\n const newMessageCount = messageCount + 1;\n\n await runtime.setCache(lastExtractionKey, newMessageCount.toString());\n\n // Trigger extraction every 25 messages (was 10 — reduced to cut LLM costs by ~60%)\n const shouldExtract = newMessageCount % 25 === 0;\n\n if (shouldExtract) {\n logger.info(\n `[experienceEvaluator] Triggering experience extraction after ${newMessageCount} messages`\n );\n }\n\n return shouldExtract;\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state?: State,\n _options?: HandlerOptions,\n _callback?: HandlerCallback,\n _responses?: Memory[]\n ): Promise<ActionResult | undefined> {\n void _options;\n void _callback;\n void _responses;\n void state;\n\n const experienceService = runtime.getService(\"EXPERIENCE\") as ExperienceService | null;\n\n if (!experienceService) {\n logger.warn(\"[experienceEvaluator] Experience service not available\");\n return;\n }\n\n const recentMessages = await runtime.getMemories({\n tableName: \"messages\",\n roomId: message.roomId,\n count: 10,\n unique: false,\n });\n\n if (recentMessages.length < 3) {\n logger.debug(\"[experienceEvaluator] Not enough messages for experience extraction\");\n return;\n }\n\n // Combine recent messages into analysis context\n const conversationContext = recentMessages\n .map((m: Memory) => m.content.text)\n .filter(Boolean)\n .join(\" \");\n\n // NOTE: We intentionally do NOT query existing experiences to embed in the prompt.\n // That added ~500-1000 tokens per call for dedup the LLM can't reliably do anyway.\n // Deduplication happens post-extraction via similarity check before recording.\n\n const extractionPrompt = composePrompt({\n state: {\n conversation_context: conversationContext,\n existing_experiences: \"None\",\n },\n template: EXTRACT_EXPERIENCES_TEMPLATE,\n });\n\n // Use TEXT_SMALL — extraction is a structured JSON task, not complex reasoning.\n // Saves 5-10x in token cost vs TEXT_LARGE.\n const response = await runtime.useModel(ModelType.TEXT_SMALL, {\n prompt: extractionPrompt,\n });\n\n const experiences = parseExtractedExperiences(response);\n\n const threshold = getNumberSetting(runtime, \"AUTO_RECORD_THRESHOLD\", 0.6);\n\n // Record each novel experience\n const experienceTypeMap: Record<string, ExperienceType> = {\n DISCOVERY: ExperienceType.DISCOVERY,\n CORRECTION: ExperienceType.CORRECTION,\n SUCCESS: ExperienceType.SUCCESS,\n LEARNING: ExperienceType.LEARNING,\n };\n\n for (const exp of experiences.slice(0, 3)) {\n // Max 3 experiences per extraction\n if (!exp.learning || typeof exp.confidence !== \"number\" || exp.confidence < threshold) {\n continue;\n }\n\n // Post-extraction dedup: skip if a very similar experience already exists\n const similar = await experienceService.findSimilarExperiences(exp.learning, 1);\n if (similar.length > 0) {\n // If the most similar existing experience shares a lot of the same words,\n // it's likely a duplicate — skip recording\n const existingLearning = similar[0].learning.toLowerCase();\n const newLearning = exp.learning.toLowerCase();\n const existingWords = new Set(existingLearning.split(/\\s+/).filter((w) => w.length > 3));\n const newWords = new Set(newLearning.split(/\\s+/).filter((w) => w.length > 3));\n const overlap = [...newWords].filter((w) => existingWords.has(w)).length;\n const union = new Set([...existingWords, ...newWords]).size;\n if (union > 0 && overlap / union > 0.6) {\n logger.debug(\n `[experienceEvaluator] Skipping duplicate experience: \"${exp.learning.substring(0, 80)}...\"`\n );\n continue;\n }\n }\n\n const normalizedType = typeof exp.type === \"string\" ? exp.type.toUpperCase() : \"\";\n const experienceType = experienceTypeMap[normalizedType] ?? ExperienceType.LEARNING;\n const experienceTag = experienceType;\n\n await experienceService.recordExperience({\n type: experienceType,\n outcome:\n experienceType === ExperienceType.CORRECTION ? OutcomeType.POSITIVE : OutcomeType.NEUTRAL,\n context: sanitizeContext(exp.context || \"Conversation analysis\"),\n action: \"pattern_recognition\",\n result: exp.learning,\n learning: sanitizeContext(exp.learning),\n domain: detectDomain(exp.learning),\n tags: [\"extracted\", \"novel\", experienceTag],\n confidence: Math.min(exp.confidence, 0.9), // Cap confidence\n importance: 0.8, // High importance for extracted experiences\n });\n\n logger.info(\n `[experienceEvaluator] Recorded novel experience: ${exp.learning.substring(0, 100)}...`\n );\n }\n\n if (experiences.length > 0) {\n logger.info(\n `[experienceEvaluator] Extracted ${experiences.length} novel experiences from conversation`\n );\n } else {\n logger.debug(\"[experienceEvaluator] No novel experiences found in recent conversation\");\n }\n\n return {\n success: true,\n data: {\n extractedCount: experiences.length,\n },\n values: {\n extractedCount: experiences.length.toString(),\n },\n };\n },\n};\n\nfunction parseExtractedExperiences(response: string): ExtractedExperience[] {\n const jsonMatch = response.match(/\\[[\\s\\S]*\\]/);\n if (!jsonMatch) return [];\n\n try {\n const parsed = JSON.parse(jsonMatch[0]) as ExtractedExperience[];\n if (!Array.isArray(parsed)) return [];\n return parsed.filter((item) => item && typeof item === \"object\");\n } catch {\n return [];\n }\n}\n\nfunction getNumberSetting(runtime: IAgentRuntime, key: string, fallback: number): number {\n const value = runtime.getSetting(key);\n if (typeof value === \"number\") return value;\n if (typeof value === \"string\") {\n const parsed = Number.parseFloat(value);\n return Number.isFinite(parsed) ? parsed : fallback;\n }\n return fallback;\n}\n\nfunction sanitizeContext(text: string): string {\n if (!text) return \"Unknown context\";\n\n // Remove user-specific details while preserving technical context\n return text\n .replace(/\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b/g, \"[EMAIL]\") // emails\n .replace(/\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b/g, \"[IP]\") // IP addresses\n .replace(/\\/Users\\/[^/\\s]+/g, \"/Users/[USER]\") // user directories\n .replace(/\\/home\\/[^/\\s]+/g, \"/home/[USER]\") // home directories\n .replace(/\\b[A-Z0-9]{20,}\\b/g, \"[TOKEN]\") // API keys/tokens\n .replace(/\\b(user|person|someone|they)\\s+(said|asked|told|mentioned)/gi, \"when asked\") // personal references\n .substring(0, 200); // limit length\n}\n\nfunction detectDomain(text: string): string {\n const domains: Record<string, string[]> = {\n shell: [\"command\", \"terminal\", \"bash\", \"shell\", \"execute\", \"script\", \"cli\"],\n coding: [\n \"code\",\n \"function\",\n \"variable\",\n \"syntax\",\n \"programming\",\n \"debug\",\n \"typescript\",\n \"javascript\",\n ],\n system: [\"file\", \"directory\", \"process\", \"memory\", \"cpu\", \"system\", \"install\", \"package\"],\n network: [\"http\", \"api\", \"request\", \"response\", \"url\", \"network\", \"fetch\", \"curl\"],\n data: [\"json\", \"csv\", \"database\", \"query\", \"data\", \"sql\", \"table\"],\n ai: [\"model\", \"llm\", \"embedding\", \"prompt\", \"token\", \"inference\"],\n };\n\n const lowerText = text.toLowerCase();\n\n for (const [domain, keywords] of Object.entries(domains)) {\n if (keywords.some((keyword) => lowerText.includes(keyword))) {\n return domain;\n }\n }\n\n return \"general\";\n}\n",
|
|
10
|
-
"/**\n * Auto-generated prompt templates\n * DO NOT EDIT - Generated from ../../../../prompts/*.txt\n *\n * These prompts use Handlebars-style template syntax:\n * - {{variableName}} for simple substitution\n * - {{#each items}}...{{/each}} for iteration\n * - {{#if condition}}...{{/if}} for conditionals\n */\n\nexport const extractExperiencesTemplate = `# Task: Extract Novel Learning Experiences\n\nAnalyze this conversation for novel learning experiences that would be surprising or valuable to remember.\n\n## Conversation context\n{{conversation_context}}\n\n## Existing similar experiences\n{{existing_experiences}}\n\n## Instructions\nExtract ONLY experiences that are:\n1. Genuinely novel (not in existing experiences)\n2. Actionable learnings about how things work\n3. Corrections of previous mistakes or assumptions\n4. Discoveries of new capabilities or patterns\n5. Surprising outcomes that contradict expectations\n\nFocus on technical knowledge, patterns, and cause-effect relationships that transfer to other contexts.\nAvoid personal details, user-specific information, or routine interactions.\n\nRespond with JSON array of experiences (max 3):\n[{\n \"type\": \"DISCOVERY|CORRECTION|SUCCESS|LEARNING\",\n \"learning\": \"What was learned (generic, transferable)\",\n \"context\": \"What situation triggered this (anonymized)\",\n \"confidence\": 0.0-1.0,\n \"reasoning\": \"Why this is novel and valuable\"\n}]\n\nReturn empty array [] if no novel experiences found.`;\n\nexport const EXTRACT_EXPERIENCES_TEMPLATE = extractExperiencesTemplate;\n
|
|
10
|
+
"/**\n * Auto-generated prompt templates\n * DO NOT EDIT - Generated from ../../../../prompts/*.txt\n *\n * These prompts use Handlebars-style template syntax:\n * - {{variableName}} for simple substitution\n * - {{#each items}}...{{/each}} for iteration\n * - {{#if condition}}...{{/if}} for conditionals\n */\n\nexport const extractExperiencesTemplate = `# Task: Extract Novel Learning Experiences\n\nAnalyze this conversation for novel learning experiences that would be surprising or valuable to remember.\n\n## Conversation context\n{{conversation_context}}\n\n## Existing similar experiences\n{{existing_experiences}}\n\n## Instructions\nExtract ONLY experiences that are:\n1. Genuinely novel (not in existing experiences)\n2. Actionable learnings about how things work\n3. Corrections of previous mistakes or assumptions\n4. Discoveries of new capabilities or patterns\n5. Surprising outcomes that contradict expectations\n\nFocus on technical knowledge, patterns, and cause-effect relationships that transfer to other contexts.\nAvoid personal details, user-specific information, or routine interactions.\n\nRespond with JSON array of experiences (max 3):\n[{\n \"type\": \"DISCOVERY|CORRECTION|SUCCESS|LEARNING\",\n \"learning\": \"What was learned (generic, transferable)\",\n \"context\": \"What situation triggered this (anonymized)\",\n \"confidence\": 0.0-1.0,\n \"reasoning\": \"Why this is novel and valuable\"\n}]\n\nReturn empty array [] if no novel experiences found.`;\n\nexport const EXTRACT_EXPERIENCES_TEMPLATE = extractExperiencesTemplate;\n",
|
|
11
11
|
"import type { Memory, ServiceTypeRegistry, UUID } from \"@elizaos/core\";\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };\nexport type JsonObject = { [key: string]: JsonValue };\n\n// Extend the core service types with experience service\ndeclare module \"@elizaos/core\" {\n interface ServiceTypeRegistry {\n EXPERIENCE: \"EXPERIENCE\";\n }\n}\n\n// Export service type constant\nexport const ExperienceServiceType = {\n EXPERIENCE: \"EXPERIENCE\" as const,\n} satisfies Partial<ServiceTypeRegistry>;\n\nexport enum ExperienceType {\n SUCCESS = \"success\", // Agent accomplished something\n FAILURE = \"failure\", // Agent failed at something\n DISCOVERY = \"discovery\", // Agent discovered new information\n CORRECTION = \"correction\", // Agent corrected a mistake\n LEARNING = \"learning\", // Agent learned something new\n HYPOTHESIS = \"hypothesis\", // Agent formed a hypothesis\n VALIDATION = \"validation\", // Agent validated a hypothesis\n WARNING = \"warning\", // Agent encountered a warning/limitation\n}\n\nexport enum OutcomeType {\n POSITIVE = \"positive\",\n NEGATIVE = \"negative\",\n NEUTRAL = \"neutral\",\n MIXED = \"mixed\",\n}\n\nexport interface Experience {\n id: UUID;\n agentId: UUID;\n type: ExperienceType;\n outcome: OutcomeType;\n\n // Context and details\n context: string; // What was happening\n action: string; // What the agent tried to do\n result: string; // What actually happened\n learning: string; // What was learned\n\n // Categorization\n tags: string[]; // Tags for categorization\n domain: string; // Domain of experience (e.g., 'shell', 'coding', 'system')\n\n // Related experiences\n relatedExperiences?: UUID[]; // Links to related experiences\n supersedes?: UUID; // If this experience updates/replaces another\n\n // Confidence and importance\n confidence: number; // 0-1, how confident the agent is in this learning\n importance: number; // 0-1, how important this experience is\n\n // Temporal information\n createdAt: number;\n updatedAt: number;\n lastAccessedAt?: number;\n accessCount: number;\n\n // For corrections\n previousBelief?: string; // What the agent previously believed\n correctedBelief?: string; // The corrected understanding\n\n // Memory integration\n embedding?: number[]; // For semantic search\n memoryIds?: UUID[]; // Related memory IDs\n}\n\nexport interface ExperienceQuery {\n query?: string; // Text query for semantic search\n type?: ExperienceType | ExperienceType[];\n outcome?: OutcomeType | OutcomeType[];\n domain?: string | string[];\n tags?: string[];\n minImportance?: number;\n minConfidence?: number;\n timeRange?: {\n start?: number;\n end?: number;\n };\n limit?: number;\n includeRelated?: boolean;\n}\n\nexport interface ExperienceAnalysis {\n pattern?: string; // Detected pattern\n frequency?: number; // How often this occurs\n reliability?: number; // How reliable this knowledge is\n alternatives?: string[]; // Alternative approaches discovered\n recommendations?: string[]; // Recommendations based on experience\n}\n\nexport interface ExperienceEvent {\n experienceId: UUID;\n eventType: \"created\" | \"accessed\" | \"updated\" | \"superseded\";\n timestamp: number;\n metadata?: JsonObject;\n}\n\nexport interface ExperienceMemory extends Memory {\n experienceId: string;\n experienceType: ExperienceType;\n}\n",
|
|
12
|
-
"import {\n type IAgentRuntime,\n logger,\n type Memory,\n type Provider,\n type ProviderResult,\n type State,\n} from \"@elizaos/core\";\nimport { requireProviderSpec } from \"../generated/specs/spec-helpers\";\nimport type { ExperienceService } from \"../service\";\n\n/**\n * Simple experience provider that injects relevant experiences into context\n * Similar to the knowledge provider but focused on agent learnings\n */\nconst spec = requireProviderSpec(\"experienceProvider\");\n\nexport const experienceProvider: Provider = {\n name: spec.name,\n description: \"Provides relevant past experiences and learnings for the current context\",\n\n async get(runtime: IAgentRuntime, message: Memory, _state?: State): Promise<ProviderResult> {\n const experienceService = runtime.getService(\"EXPERIENCE\") as ExperienceService | null;\n\n if (!experienceService) {\n return { text: \"\", data: {}, values: {} };\n }\n\n // Get message text for context\n const messageText = message.content.text || \"\";\n if (messageText.length < 10) {\n return { text: \"\", data: {}, values: {} };\n }\n\n // Find relevant experiences using semantic search\n const relevantExperiences = await experienceService.queryExperiences({\n query: messageText,\n limit: 5,\n minConfidence: 0.6,\n minImportance: 0.5,\n });\n\n if (relevantExperiences.length === 0) {\n return { text: \"\", data: {}, values: {} };\n }\n\n // Format experiences for context injection\n const experienceText = relevantExperiences\n .map((exp, index) => {\n return `Experience ${index + 1}: In ${exp.domain} context, when ${exp.context}, I learned: ${exp.learning}`;\n })\n .join(\"\\n\");\n\n const contextText = `[RELEVANT EXPERIENCES]\\n${experienceText}\\n[/RELEVANT EXPERIENCES]`;\n\n logger.debug(\n `[experienceProvider] Injecting ${relevantExperiences.length} relevant experiences`\n );\n\n return {\n text: contextText,\n data: {\n experiences: relevantExperiences,\n count: relevantExperiences.length,\n },\n values: {\n experienceCount: relevantExperiences.length.toString(),\n },\n };\n },\n};\n",
|
|
13
|
-
"import {\n type IAgentRuntime,\n logger,\n ModelType,\n Service,\n type ServiceTypeName,\n type UUID,\n} from \"@elizaos/core\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport {\n type Experience,\n type ExperienceAnalysis,\n type ExperienceQuery,\n ExperienceServiceType,\n ExperienceType,\n OutcomeType,\n} from \"./types\";\nimport { ConfidenceDecayManager } from \"./utils/confidenceDecay\";\nimport { ExperienceRelationshipManager } from \"./utils/experienceRelationships\";\n\nexport class ExperienceService extends Service {\n static override serviceType: ServiceTypeName = ExperienceServiceType.EXPERIENCE;\n override capabilityDescription =\n \"Manages agent experiences, learning from successes and failures to improve future decisions\";\n\n private experiences: Map<UUID, Experience> = new Map();\n private experiencesByDomain: Map<string, Set<UUID>> = new Map();\n private experiencesByType: Map<ExperienceType, Set<UUID>> = new Map();\n private dirtyExperiences: Set<UUID> = new Set();\n private persistTimer: ReturnType<typeof setInterval> | null = null;\n private decayManager: ConfidenceDecayManager;\n private relationshipManager: ExperienceRelationshipManager;\n\n constructor(runtime: IAgentRuntime) {\n super(runtime);\n this.decayManager = new ConfidenceDecayManager();\n this.relationshipManager = new ExperienceRelationshipManager();\n\n void this.loadExperiences();\n\n // Batch-persist dirty access counts every 60 seconds\n this.persistTimer = setInterval(() => {\n void this.persistDirtyExperiences();\n }, 60_000);\n }\n\n static async start(runtime: IAgentRuntime): Promise<ExperienceService> {\n const service = new ExperienceService(runtime);\n // loadExperiences is triggered in constructor\n return service;\n }\n\n private async loadExperiences(): Promise<void> {\n // Load experiences from the \"experiences\" table (same table we write to)\n const memories = await this.runtime.getMemories({\n entityId: this.runtime.agentId,\n tableName: \"experiences\",\n });\n\n for (const memory of memories) {\n const experienceData = memory.content.data as Partial<Experience> | null;\n if (experienceData?.id) {\n const memoryCreatedAt =\n typeof memory.createdAt === \"number\" ? memory.createdAt : Date.now();\n\n const toTimestamp = (value: number | Date | undefined, fallback: number): number => {\n if (value === undefined) return fallback;\n if (typeof value === \"number\") return value;\n if (value instanceof Date) return value.getTime();\n return fallback;\n };\n\n const experience: Experience = {\n id: experienceData.id as UUID,\n agentId: this.runtime.agentId,\n type: experienceData.type || ExperienceType.LEARNING,\n outcome: experienceData.outcome || OutcomeType.NEUTRAL,\n context: experienceData.context || \"\",\n action: experienceData.action || \"\",\n result: experienceData.result || \"\",\n learning: experienceData.learning || \"\",\n domain: experienceData.domain || \"general\",\n tags: experienceData.tags || [],\n confidence: experienceData.confidence || 0.5,\n importance: experienceData.importance || 0.5,\n createdAt: toTimestamp(\n experienceData.createdAt as number | Date | undefined,\n memoryCreatedAt\n ),\n updatedAt: toTimestamp(\n experienceData.updatedAt as number | Date | undefined,\n memoryCreatedAt\n ),\n accessCount: experienceData.accessCount ?? 0,\n lastAccessedAt: toTimestamp(\n experienceData.lastAccessedAt as number | Date | undefined,\n memoryCreatedAt\n ),\n embedding: experienceData.embedding,\n relatedExperiences: experienceData.relatedExperiences,\n supersedes: experienceData.supersedes,\n previousBelief: experienceData.previousBelief,\n correctedBelief: experienceData.correctedBelief,\n };\n\n this.experiences.set(experience.id, experience);\n\n // Update indexes\n if (!this.experiencesByDomain.has(experience.domain)) {\n this.experiencesByDomain.set(experience.domain, new Set());\n }\n this.experiencesByDomain.get(experience.domain)?.add(experience.id);\n\n if (!this.experiencesByType.has(experience.type)) {\n this.experiencesByType.set(experience.type, new Set());\n }\n this.experiencesByType.get(experience.type)?.add(experience.id);\n }\n }\n\n logger.info(`[ExperienceService] Loaded ${this.experiences.size} experiences from memory`);\n }\n\n async recordExperience(experienceData: Partial<Experience>): Promise<Experience> {\n // Generate embedding for the experience (graceful fallback if unavailable)\n const embeddingText = `${experienceData.context} ${experienceData.action} ${experienceData.result} ${experienceData.learning}`;\n let embedding: number[] | undefined;\n try {\n const result = await this.runtime.useModel(ModelType.TEXT_EMBEDDING, {\n text: embeddingText,\n });\n // Validate the embedding is non-zero (some providers return zero vectors on error)\n if (Array.isArray(result) && result.length > 0 && result.some((v: number) => v !== 0)) {\n embedding = result;\n } else {\n logger.warn(\n \"[ExperienceService] Embedding model returned empty/zero vector, storing without embedding\"\n );\n }\n } catch (err) {\n logger.warn(\n `[ExperienceService] Embedding generation failed, storing without embedding: ${err}`\n );\n }\n\n const now = Date.now();\n\n const experience: Experience = {\n id: uuidv4() as UUID,\n agentId: this.runtime.agentId,\n type: experienceData.type || ExperienceType.LEARNING,\n outcome: experienceData.outcome || OutcomeType.NEUTRAL,\n context: experienceData.context || \"\",\n action: experienceData.action || \"\",\n result: experienceData.result || \"\",\n learning: experienceData.learning || \"\",\n domain: experienceData.domain || \"general\",\n tags: experienceData.tags || [],\n confidence: experienceData.confidence || 0.5,\n importance: experienceData.importance || 0.5,\n createdAt: now,\n updatedAt: now,\n accessCount: 0,\n lastAccessedAt: now,\n embedding,\n relatedExperiences: experienceData.relatedExperiences,\n supersedes: experienceData.supersedes,\n previousBelief: experienceData.previousBelief,\n correctedBelief: experienceData.correctedBelief,\n };\n\n // Store the experience\n this.experiences.set(experience.id, experience);\n\n // Update indexes\n if (!this.experiencesByDomain.has(experience.domain)) {\n this.experiencesByDomain.set(experience.domain, new Set());\n }\n this.experiencesByDomain.get(experience.domain)?.add(experience.id);\n\n if (!this.experiencesByType.has(experience.type)) {\n this.experiencesByType.set(experience.type, new Set());\n }\n this.experiencesByType.get(experience.type)?.add(experience.id);\n\n // Save to memory service\n await this.saveExperienceToMemory(experience);\n\n // Check for contradictions and add relationships\n const allExperiences = Array.from(this.experiences.values());\n const contradictions = this.relationshipManager.findContradictions(experience, allExperiences);\n\n for (const contradiction of contradictions) {\n this.relationshipManager.addRelationship({\n fromId: experience.id,\n toId: contradiction.id,\n type: \"contradicts\",\n strength: 0.8,\n });\n }\n\n logger.info(`[ExperienceService] Recorded experience: ${experience.id} (${experience.type})`);\n\n return experience;\n }\n\n private async saveExperienceToMemory(experience: Experience): Promise<void> {\n const memory = {\n id: experience.id,\n entityId: this.runtime.agentId,\n agentId: this.runtime.agentId,\n roomId: this.runtime.agentId,\n content: {\n text: `Experience: ${experience.learning}`,\n type: \"experience\",\n data: {\n id: experience.id,\n agentId: experience.agentId,\n type: experience.type,\n outcome: experience.outcome,\n context: experience.context,\n action: experience.action,\n result: experience.result,\n learning: experience.learning,\n domain: experience.domain,\n tags: experience.tags,\n confidence: experience.confidence,\n importance: experience.importance,\n createdAt: experience.createdAt,\n updatedAt: experience.updatedAt,\n accessCount: experience.accessCount,\n lastAccessedAt: experience.lastAccessedAt,\n // NOTE: embedding intentionally excluded — it's large (1-6KB per experience)\n // and stored separately by adapters that support vector search.\n // Keeping it only in the in-memory map for similarity calculations.\n relatedExperiences: experience.relatedExperiences,\n supersedes: experience.supersedes,\n previousBelief: experience.previousBelief,\n correctedBelief: experience.correctedBelief,\n },\n },\n createdAt: experience.createdAt,\n };\n\n await this.runtime.createMemory(memory, \"experiences\", true);\n }\n\n private async persistDirtyExperiences(): Promise<void> {\n if (this.dirtyExperiences.size === 0) return;\n\n const toSave = Array.from(this.dirtyExperiences);\n this.dirtyExperiences.clear();\n\n let saved = 0;\n for (const id of toSave) {\n const exp = this.experiences.get(id);\n if (exp) {\n try {\n await this.saveExperienceToMemory(exp);\n saved++;\n } catch {\n // Re-mark as dirty so it retries next cycle\n this.dirtyExperiences.add(id);\n }\n }\n }\n\n if (saved > 0) {\n logger.debug(`[ExperienceService] Persisted ${saved} dirty experiences`);\n }\n }\n\n async queryExperiences(query: ExperienceQuery): Promise<Experience[]> {\n let results: Experience[] = [];\n const limit = query.limit || 10;\n\n if (query.query) {\n // Semantic search path: over-fetch when filters will reduce the set\n const hasFilters = !!(\n query.type || query.outcome || query.domain ||\n (query.tags && query.tags.length > 0) ||\n query.minConfidence !== undefined ||\n query.minImportance !== undefined ||\n query.timeRange\n );\n const fetchLimit = hasFilters ? Math.max(limit * 5, 50) : limit;\n const candidates = this.applyFilters(\n await this.findSimilarExperiences(query.query, fetchLimit),\n query,\n );\n results = candidates.slice(0, limit);\n } else {\n // Non-semantic path: filter then sort by quality\n const candidates = this.applyFilters(\n Array.from(this.experiences.values()),\n query,\n );\n candidates.sort((a, b) => {\n const scoreA = this.decayManager.getDecayedConfidence(a) * a.importance;\n const scoreB = this.decayManager.getDecayedConfidence(b) * b.importance;\n return scoreB - scoreA;\n });\n results = candidates.slice(0, limit);\n }\n\n // Include related experiences if requested\n if (query.includeRelated) {\n const relatedIds = new Set<UUID>();\n for (const exp of results) {\n if (exp.relatedExperiences) {\n exp.relatedExperiences.forEach((id) => {\n relatedIds.add(id);\n });\n }\n }\n\n const related = Array.from(relatedIds)\n .map((id) => this.experiences.get(id))\n .filter((exp): exp is Experience => exp !== undefined)\n .filter((exp) => !results.some((r) => r.id === exp.id));\n\n results.push(...related);\n }\n\n // Update access counts and mark dirty for batch persistence\n for (const exp of results) {\n exp.accessCount++;\n exp.lastAccessedAt = Date.now();\n this.dirtyExperiences.add(exp.id);\n }\n\n return results;\n }\n\n /** Apply query filters (type, outcome, domain, tags, confidence, importance, timeRange). */\n private applyFilters(candidates: Experience[], query: ExperienceQuery): Experience[] {\n let filtered = candidates;\n\n if (query.type) {\n const types = Array.isArray(query.type) ? query.type : [query.type];\n filtered = filtered.filter((e) => types.includes(e.type));\n }\n if (query.outcome) {\n filtered = filtered.filter((e) => e.outcome === query.outcome);\n }\n if (query.domain) {\n const domains = Array.isArray(query.domain) ? query.domain : [query.domain];\n filtered = filtered.filter((e) => domains.includes(e.domain));\n }\n if (query.tags && query.tags.length > 0) {\n filtered = filtered.filter((e) => query.tags?.some((t) => e.tags.includes(t)));\n }\n if (query.minConfidence !== undefined) {\n const min = query.minConfidence;\n filtered = filtered.filter((e) => this.decayManager.getDecayedConfidence(e) >= min);\n }\n if (query.minImportance !== undefined) {\n const min = query.minImportance;\n filtered = filtered.filter((e) => e.importance >= min);\n }\n if (query.timeRange) {\n const { start, end } = query.timeRange;\n filtered = filtered.filter((e) => {\n if (start && e.createdAt < start) return false;\n if (end && e.createdAt > end) return false;\n return true;\n });\n }\n\n return filtered;\n }\n\n /**\n * Find similar experiences using vector search + reranking.\n *\n * Reranking strategy:\n * Vector similarity is the dominant signal (70%) — an irrelevant experience\n * should never outrank a relevant one just because it has high confidence.\n * Quality signals (confidence, importance) act as tiebreakers among\n * similarly-relevant results (30% combined).\n *\n * A minimum similarity threshold filters out noise so quality signals\n * can't promote genuinely irrelevant experiences.\n */\n async findSimilarExperiences(text: string, limit = 5): Promise<Experience[]> {\n if (!text || this.experiences.size === 0) {\n return [];\n }\n\n let queryEmbedding: number[];\n try {\n queryEmbedding = await this.runtime.useModel(ModelType.TEXT_EMBEDDING, { text });\n if (\n !Array.isArray(queryEmbedding) ||\n queryEmbedding.length === 0 ||\n queryEmbedding.every((v: number) => v === 0)\n ) {\n logger.warn(\n \"[ExperienceService] Query embedding is empty/zero, falling back to recency sort\"\n );\n return this.fallbackSort(limit);\n }\n } catch {\n logger.warn(\"[ExperienceService] Query embedding failed, falling back to recency sort\");\n return this.fallbackSort(limit);\n }\n\n // Minimum cosine similarity to be considered a candidate at all.\n // Prevents high-quality but irrelevant experiences from appearing.\n const SIMILARITY_FLOOR = 0.05;\n\n const scored: Array<{ experience: Experience; score: number }> = [];\n const now = Date.now();\n\n for (const experience of this.experiences.values()) {\n if (!experience.embedding) continue;\n\n const similarity = this.cosineSimilarity(queryEmbedding, experience.embedding);\n if (similarity < SIMILARITY_FLOOR) continue;\n\n // --- Quality signals (all normalized 0-1) ---\n\n // Confidence with time-decay applied\n const decayedConfidence = this.decayManager.getDecayedConfidence(experience);\n\n // Smooth recency: half-life of 30 days, never goes to zero\n const ageDays = Math.max(0, (now - experience.createdAt) / (24 * 60 * 60 * 1000));\n const recencyFactor = 1 / (1 + ageDays / 30);\n\n // Access frequency: log-scaled, capped at 1.0\n // ~0 at 0 accesses, ~0.33 at 1, ~0.66 at 3, ~1.0 at 9+\n const accessFactor = Math.min(1, Math.log2(experience.accessCount + 1) / Math.log2(10));\n\n // Weighted quality score (0-1 range)\n const qualityScore =\n decayedConfidence * 0.45 +\n experience.importance * 0.35 +\n recencyFactor * 0.12 +\n accessFactor * 0.08;\n\n // Final reranking score: similarity dominates (70%), quality tiebreaks (30%)\n const rerankScore = similarity * 0.7 + qualityScore * 0.3;\n\n scored.push({ experience, score: rerankScore });\n }\n\n // Sort by combined reranking score (highest first)\n scored.sort((a, b) => b.score - a.score);\n const results = scored.slice(0, limit).map((item) => item.experience);\n\n for (const exp of results) {\n exp.accessCount++;\n exp.lastAccessedAt = now;\n this.dirtyExperiences.add(exp.id);\n }\n\n return results;\n }\n\n /** Fallback when embeddings are unavailable: sort by decayed confidence * importance. */\n private fallbackSort(limit: number): Experience[] {\n const all = Array.from(this.experiences.values());\n all.sort((a, b) => {\n const sa = this.decayManager.getDecayedConfidence(a) * a.importance;\n const sb = this.decayManager.getDecayedConfidence(b) * b.importance;\n return sb - sa;\n });\n return all.slice(0, limit);\n }\n\n async analyzeExperiences(domain?: string, type?: ExperienceType): Promise<ExperienceAnalysis> {\n const experiences = await this.queryExperiences({\n domain: domain ? [domain] : undefined,\n type: type ? [type] : undefined,\n limit: 100,\n });\n\n if (experiences.length === 0) {\n return {\n pattern: \"No experiences found for analysis\",\n frequency: 0,\n reliability: 0,\n alternatives: [],\n recommendations: [],\n };\n }\n\n const learnings = experiences.map((exp) => exp.learning);\n const commonWords = this.findCommonPatterns(learnings);\n\n const avgConfidence =\n experiences.reduce((sum, exp) => sum + exp.confidence, 0) / experiences.length;\n const outcomeConsistency = this.calculateOutcomeConsistency(experiences);\n const reliability = (avgConfidence + outcomeConsistency) / 2;\n\n const alternatives = this.extractAlternatives(experiences);\n const recommendations = this.generateRecommendations(experiences, reliability);\n\n return {\n pattern:\n commonWords.length > 0\n ? `Common patterns: ${commonWords.join(\", \")}`\n : \"No clear patterns detected\",\n frequency: experiences.length,\n reliability,\n alternatives,\n recommendations,\n };\n }\n\n private cosineSimilarity(a: number[], b: number[]): number {\n if (a.length !== b.length) return 0;\n\n let dotProduct = 0;\n let normA = 0;\n let normB = 0;\n\n for (let i = 0; i < a.length; i++) {\n const valueA = a[i] ?? 0;\n const valueB = b[i] ?? 0;\n dotProduct += valueA * valueB;\n normA += valueA * valueA;\n normB += valueB * valueB;\n }\n\n if (normA === 0 || normB === 0) return 0;\n return dotProduct / (Math.sqrt(normA) * Math.sqrt(normB));\n }\n\n private findCommonPatterns(texts: string[]): string[] {\n const wordFreq = new Map<string, number>();\n\n for (const text of texts) {\n const words = text.toLowerCase().split(/\\s+/);\n for (const word of words) {\n if (word.length > 3) {\n wordFreq.set(word, (wordFreq.get(word) || 0) + 1);\n }\n }\n }\n\n const threshold = texts.length * 0.3;\n return Array.from(wordFreq.entries())\n .filter(([_, count]) => count >= threshold)\n .sort((a, b) => b[1] - a[1])\n .slice(0, 5)\n .map(([word]) => word);\n }\n\n private calculateOutcomeConsistency(experiences: Experience[]): number {\n if (experiences.length === 0) return 0;\n\n const outcomeCounts = new Map<OutcomeType, number>();\n for (const exp of experiences) {\n outcomeCounts.set(exp.outcome, (outcomeCounts.get(exp.outcome) || 0) + 1);\n }\n\n const maxCount = Math.max(...outcomeCounts.values());\n return maxCount / experiences.length;\n }\n\n private extractAlternatives(experiences: Experience[]): string[] {\n const alternatives = new Set<string>();\n\n for (const exp of experiences) {\n if (exp.type === ExperienceType.CORRECTION && exp.correctedBelief) {\n alternatives.add(exp.correctedBelief);\n }\n if (exp.outcome === OutcomeType.NEGATIVE && exp.learning.includes(\"instead\")) {\n const match = exp.learning.match(/instead\\s+(.+?)(?:\\.|$)/i);\n const alternative = match?.[1]?.trim();\n if (alternative) {\n alternatives.add(alternative);\n }\n }\n }\n\n return Array.from(alternatives).slice(0, 5);\n }\n\n private generateRecommendations(experiences: Experience[], reliability: number): string[] {\n const recommendations: string[] = [];\n\n if (reliability > 0.8) {\n recommendations.push(\"Continue using successful approaches\");\n recommendations.push(\"Document and share these reliable methods\");\n } else if (reliability > 0.6) {\n recommendations.push(\"Continue using successful approaches with caution\");\n recommendations.push(\"Monitor for potential issues\");\n recommendations.push(\"Consider backup strategies\");\n } else if (reliability > 0.4) {\n recommendations.push(\"Review and improve current approaches\");\n recommendations.push(\"Investigate failure patterns\");\n recommendations.push(\"Consider alternative methods\");\n } else {\n recommendations.push(\"Significant changes needed to current approach\");\n recommendations.push(\"Analyze failure causes thoroughly\");\n recommendations.push(\"Seek alternative solutions\");\n }\n\n const failureTypes = new Map<string, number>();\n experiences\n .filter((e) => e.outcome === OutcomeType.NEGATIVE)\n .forEach((e) => {\n const key = e.learning.toLowerCase();\n failureTypes.set(key, (failureTypes.get(key) || 0) + 1);\n });\n\n if (failureTypes.size > 0) {\n const mostCommonFailure = Array.from(failureTypes.entries()).sort((a, b) => b[1] - a[1])[0];\n\n if (mostCommonFailure && mostCommonFailure[1] > 1) {\n recommendations.push(`Address recurring issue: ${mostCommonFailure[0]}`);\n }\n }\n\n const domains = new Set(experiences.map((e) => e.domain));\n if (domains.has(\"shell\")) {\n recommendations.push(\"Verify command syntax and permissions\");\n }\n if (domains.has(\"coding\")) {\n recommendations.push(\"Test thoroughly before deployment\");\n }\n if (domains.has(\"network\")) {\n recommendations.push(\"Implement retry logic and error handling\");\n }\n\n return recommendations.slice(0, 5);\n }\n\n async stop(): Promise<void> {\n logger.info(\"[ExperienceService] Stopping...\");\n\n // Stop the persistence timer\n if (this.persistTimer) {\n clearInterval(this.persistTimer);\n this.persistTimer = null;\n }\n\n // Final persist of all dirty experiences + full save\n const experiencesToSave = Array.from(this.experiences.values());\n let savedCount = 0;\n\n for (const experience of experiencesToSave) {\n try {\n await this.saveExperienceToMemory(experience);\n savedCount++;\n } catch (err) {\n logger.warn(`[ExperienceService] Failed to save experience ${experience.id}: ${err}`);\n }\n }\n\n this.dirtyExperiences.clear();\n logger.info(`[ExperienceService] Saved ${savedCount} experiences`);\n }\n}\n",
|
|
12
|
+
"import {\n type IAgentRuntime,\n logger,\n type Memory,\n type Provider,\n type ProviderResult,\n type State,\n} from \"@elizaos/core\";\nimport { requireProviderSpec } from \"../generated/specs/spec-helpers\";\nimport type { ExperienceService } from \"../service\";\n\n/**\n * Simple experience provider that injects relevant experiences into context\n * Similar to the knowledge provider but focused on agent learnings\n */\nconst spec = requireProviderSpec(\"experienceProvider\");\n\nexport const experienceProvider: Provider = {\n name: spec.name,\n description: \"Provides relevant past experiences and learnings for the current context\",\n\n dynamic: true,\n async get(runtime: IAgentRuntime, message: Memory, _state?: State): Promise<ProviderResult> {\n const experienceService = runtime.getService(\"EXPERIENCE\") as ExperienceService | null;\n\n if (!experienceService) {\n return { text: \"\", data: {}, values: {} };\n }\n\n // Get message text for context\n const messageText = message.content.text || \"\";\n if (messageText.length < 10) {\n return { text: \"\", data: {}, values: {} };\n }\n\n // Find relevant experiences using semantic search\n const relevantExperiences = await experienceService.queryExperiences({\n query: messageText,\n limit: 5,\n minConfidence: 0.6,\n minImportance: 0.5,\n });\n\n if (relevantExperiences.length === 0) {\n return { text: \"\", data: {}, values: {} };\n }\n\n // Format experiences for context injection\n const experienceText = relevantExperiences\n .map((exp, index) => {\n return `Experience ${index + 1}: In ${exp.domain} context, when ${exp.context}, I learned: ${exp.learning}`;\n })\n .join(\"\\n\");\n\n const contextText = `[RELEVANT EXPERIENCES]\\n${experienceText}\\n[/RELEVANT EXPERIENCES]`;\n\n logger.debug(\n `[experienceProvider] Injecting ${relevantExperiences.length} relevant experiences`\n );\n\n return {\n text: contextText,\n data: {\n experiences: relevantExperiences,\n count: relevantExperiences.length,\n },\n values: {\n experienceCount: relevantExperiences.length.toString(),\n },\n };\n },\n};\n",
|
|
13
|
+
"import {\n type IAgentRuntime,\n logger,\n ModelType,\n Service,\n type ServiceTypeName,\n type UUID,\n} from \"@elizaos/core\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport {\n type Experience,\n type ExperienceAnalysis,\n type ExperienceQuery,\n ExperienceServiceType,\n ExperienceType,\n OutcomeType,\n} from \"./types\";\nimport { ConfidenceDecayManager } from \"./utils/confidenceDecay\";\nimport { ExperienceRelationshipManager } from \"./utils/experienceRelationships\";\n\nexport class ExperienceService extends Service {\n static override serviceType: ServiceTypeName = ExperienceServiceType.EXPERIENCE;\n override capabilityDescription =\n \"Manages agent experiences, learning from successes and failures to improve future decisions\";\n\n private experiences: Map<UUID, Experience> = new Map();\n private experiencesByDomain: Map<string, Set<UUID>> = new Map();\n private experiencesByType: Map<ExperienceType, Set<UUID>> = new Map();\n private dirtyExperiences: Set<UUID> = new Set();\n private persistTimer: ReturnType<typeof setInterval> | null = null;\n private decayManager: ConfidenceDecayManager;\n private relationshipManager: ExperienceRelationshipManager;\n\n constructor(runtime: IAgentRuntime) {\n super(runtime);\n this.decayManager = new ConfidenceDecayManager();\n this.relationshipManager = new ExperienceRelationshipManager();\n\n void this.loadExperiences();\n\n // Batch-persist dirty access counts every 60 seconds\n this.persistTimer = setInterval(() => {\n void this.persistDirtyExperiences();\n }, 60_000);\n }\n\n static async start(runtime: IAgentRuntime): Promise<ExperienceService> {\n const service = new ExperienceService(runtime);\n // loadExperiences is triggered in constructor\n return service;\n }\n\n private async loadExperiences(): Promise<void> {\n // Load experiences from the \"experiences\" table (same table we write to)\n const memories = await this.runtime.getMemories({\n entityId: this.runtime.agentId,\n tableName: \"experiences\",\n });\n\n for (const memory of memories) {\n const experienceData = memory.content.data as Partial<Experience> | null;\n if (experienceData?.id) {\n const memoryCreatedAt =\n typeof memory.createdAt === \"number\" ? memory.createdAt : Date.now();\n\n const toTimestamp = (value: number | Date | undefined, fallback: number): number => {\n if (value === undefined) return fallback;\n if (typeof value === \"number\") return value;\n if (value instanceof Date) return value.getTime();\n return fallback;\n };\n\n const experience: Experience = {\n id: experienceData.id as UUID,\n agentId: this.runtime.agentId,\n type: experienceData.type || ExperienceType.LEARNING,\n outcome: experienceData.outcome || OutcomeType.NEUTRAL,\n context: experienceData.context || \"\",\n action: experienceData.action || \"\",\n result: experienceData.result || \"\",\n learning: experienceData.learning || \"\",\n domain: experienceData.domain || \"general\",\n tags: experienceData.tags || [],\n confidence: experienceData.confidence || 0.5,\n importance: experienceData.importance || 0.5,\n createdAt: toTimestamp(\n experienceData.createdAt as number | Date | undefined,\n memoryCreatedAt\n ),\n updatedAt: toTimestamp(\n experienceData.updatedAt as number | Date | undefined,\n memoryCreatedAt\n ),\n accessCount: experienceData.accessCount ?? 0,\n lastAccessedAt: toTimestamp(\n experienceData.lastAccessedAt as number | Date | undefined,\n memoryCreatedAt\n ),\n embedding: experienceData.embedding,\n relatedExperiences: experienceData.relatedExperiences,\n supersedes: experienceData.supersedes,\n previousBelief: experienceData.previousBelief,\n correctedBelief: experienceData.correctedBelief,\n };\n\n this.experiences.set(experience.id, experience);\n\n // Update indexes\n if (!this.experiencesByDomain.has(experience.domain)) {\n this.experiencesByDomain.set(experience.domain, new Set());\n }\n this.experiencesByDomain.get(experience.domain)?.add(experience.id);\n\n if (!this.experiencesByType.has(experience.type)) {\n this.experiencesByType.set(experience.type, new Set());\n }\n this.experiencesByType.get(experience.type)?.add(experience.id);\n }\n }\n\n logger.info(`[ExperienceService] Loaded ${this.experiences.size} experiences from memory`);\n }\n\n async recordExperience(experienceData: Partial<Experience>): Promise<Experience> {\n // Generate embedding for the experience (graceful fallback if unavailable)\n const embeddingText = `${experienceData.context} ${experienceData.action} ${experienceData.result} ${experienceData.learning}`;\n let embedding: number[] | undefined;\n try {\n const result = await this.runtime.useModel(ModelType.TEXT_EMBEDDING, {\n text: embeddingText,\n });\n // Validate the embedding is non-zero (some providers return zero vectors on error)\n if (Array.isArray(result) && result.length > 0 && result.some((v: number) => v !== 0)) {\n embedding = result;\n } else {\n logger.warn(\n \"[ExperienceService] Embedding model returned empty/zero vector, storing without embedding\"\n );\n }\n } catch (err) {\n logger.warn(\n `[ExperienceService] Embedding generation failed, storing without embedding: ${err}`\n );\n }\n\n const now = Date.now();\n\n const experience: Experience = {\n id: uuidv4() as UUID,\n agentId: this.runtime.agentId,\n type: experienceData.type || ExperienceType.LEARNING,\n outcome: experienceData.outcome || OutcomeType.NEUTRAL,\n context: experienceData.context || \"\",\n action: experienceData.action || \"\",\n result: experienceData.result || \"\",\n learning: experienceData.learning || \"\",\n domain: experienceData.domain || \"general\",\n tags: experienceData.tags || [],\n confidence: experienceData.confidence || 0.5,\n importance: experienceData.importance || 0.5,\n createdAt: now,\n updatedAt: now,\n accessCount: 0,\n lastAccessedAt: now,\n embedding,\n relatedExperiences: experienceData.relatedExperiences,\n supersedes: experienceData.supersedes,\n previousBelief: experienceData.previousBelief,\n correctedBelief: experienceData.correctedBelief,\n };\n\n // Store the experience\n this.experiences.set(experience.id, experience);\n\n // Update indexes\n if (!this.experiencesByDomain.has(experience.domain)) {\n this.experiencesByDomain.set(experience.domain, new Set());\n }\n this.experiencesByDomain.get(experience.domain)?.add(experience.id);\n\n if (!this.experiencesByType.has(experience.type)) {\n this.experiencesByType.set(experience.type, new Set());\n }\n this.experiencesByType.get(experience.type)?.add(experience.id);\n\n // Save to memory service\n await this.saveExperienceToMemory(experience);\n\n // Check for contradictions and add relationships\n const allExperiences = Array.from(this.experiences.values());\n const contradictions = this.relationshipManager.findContradictions(experience, allExperiences);\n\n for (const contradiction of contradictions) {\n this.relationshipManager.addRelationship({\n fromId: experience.id,\n toId: contradiction.id,\n type: \"contradicts\",\n strength: 0.8,\n });\n }\n\n logger.info(`[ExperienceService] Recorded experience: ${experience.id} (${experience.type})`);\n\n return experience;\n }\n\n private async saveExperienceToMemory(experience: Experience): Promise<void> {\n const memory = {\n id: experience.id,\n entityId: this.runtime.agentId,\n agentId: this.runtime.agentId,\n roomId: this.runtime.agentId,\n content: {\n text: `Experience: ${experience.learning}`,\n type: \"experience\",\n data: {\n id: experience.id,\n agentId: experience.agentId,\n type: experience.type,\n outcome: experience.outcome,\n context: experience.context,\n action: experience.action,\n result: experience.result,\n learning: experience.learning,\n domain: experience.domain,\n tags: experience.tags,\n confidence: experience.confidence,\n importance: experience.importance,\n createdAt: experience.createdAt,\n updatedAt: experience.updatedAt,\n accessCount: experience.accessCount,\n lastAccessedAt: experience.lastAccessedAt,\n // NOTE: embedding intentionally excluded — it's large (1-6KB per experience)\n // and stored separately by adapters that support vector search.\n // Keeping it only in the in-memory map for similarity calculations.\n relatedExperiences: experience.relatedExperiences,\n supersedes: experience.supersedes,\n previousBelief: experience.previousBelief,\n correctedBelief: experience.correctedBelief,\n },\n },\n createdAt: experience.createdAt,\n };\n\n await this.runtime.createMemory(memory, \"experiences\", true);\n }\n\n private async persistDirtyExperiences(): Promise<void> {\n if (this.dirtyExperiences.size === 0) return;\n\n const toSave = Array.from(this.dirtyExperiences);\n this.dirtyExperiences.clear();\n\n let saved = 0;\n for (const id of toSave) {\n const exp = this.experiences.get(id);\n if (exp) {\n try {\n await this.saveExperienceToMemory(exp);\n saved++;\n } catch {\n // Re-mark as dirty so it retries next cycle\n this.dirtyExperiences.add(id);\n }\n }\n }\n\n if (saved > 0) {\n logger.debug(`[ExperienceService] Persisted ${saved} dirty experiences`);\n }\n }\n\n async queryExperiences(query: ExperienceQuery): Promise<Experience[]> {\n let results: Experience[] = [];\n const limit = query.limit || 10;\n\n if (query.query) {\n // Semantic search path: over-fetch when filters will reduce the set\n const hasFilters = !!(\n query.type ||\n query.outcome ||\n query.domain ||\n (query.tags && query.tags.length > 0) ||\n query.minConfidence !== undefined ||\n query.minImportance !== undefined ||\n query.timeRange\n );\n const fetchLimit = hasFilters ? Math.max(limit * 5, 50) : limit;\n const candidates = this.applyFilters(\n await this.findSimilarExperiences(query.query, fetchLimit),\n query\n );\n results = candidates.slice(0, limit);\n } else {\n // Non-semantic path: filter then sort by quality\n const candidates = this.applyFilters(Array.from(this.experiences.values()), query);\n candidates.sort((a, b) => {\n const scoreA = this.decayManager.getDecayedConfidence(a) * a.importance;\n const scoreB = this.decayManager.getDecayedConfidence(b) * b.importance;\n return scoreB - scoreA;\n });\n results = candidates.slice(0, limit);\n }\n\n // Include related experiences if requested\n if (query.includeRelated) {\n const relatedIds = new Set<UUID>();\n for (const exp of results) {\n if (exp.relatedExperiences) {\n exp.relatedExperiences.forEach((id) => {\n relatedIds.add(id);\n });\n }\n }\n\n const related = Array.from(relatedIds)\n .map((id) => this.experiences.get(id))\n .filter((exp): exp is Experience => exp !== undefined)\n .filter((exp) => !results.some((r) => r.id === exp.id));\n\n results.push(...related);\n }\n\n // Update access counts and mark dirty for batch persistence\n for (const exp of results) {\n exp.accessCount++;\n exp.lastAccessedAt = Date.now();\n this.dirtyExperiences.add(exp.id);\n }\n\n return results;\n }\n\n /** Apply query filters (type, outcome, domain, tags, confidence, importance, timeRange). */\n private applyFilters(candidates: Experience[], query: ExperienceQuery): Experience[] {\n let filtered = candidates;\n\n if (query.type) {\n const types = Array.isArray(query.type) ? query.type : [query.type];\n filtered = filtered.filter((e) => types.includes(e.type));\n }\n if (query.outcome) {\n filtered = filtered.filter((e) => e.outcome === query.outcome);\n }\n if (query.domain) {\n const domains = Array.isArray(query.domain) ? query.domain : [query.domain];\n filtered = filtered.filter((e) => domains.includes(e.domain));\n }\n if (query.tags && query.tags.length > 0) {\n filtered = filtered.filter((e) => query.tags?.some((t) => e.tags.includes(t)));\n }\n if (query.minConfidence !== undefined) {\n const min = query.minConfidence;\n filtered = filtered.filter((e) => this.decayManager.getDecayedConfidence(e) >= min);\n }\n if (query.minImportance !== undefined) {\n const min = query.minImportance;\n filtered = filtered.filter((e) => e.importance >= min);\n }\n if (query.timeRange) {\n const { start, end } = query.timeRange;\n filtered = filtered.filter((e) => {\n if (start && e.createdAt < start) return false;\n if (end && e.createdAt > end) return false;\n return true;\n });\n }\n\n return filtered;\n }\n\n /**\n * Find similar experiences using vector search + reranking.\n *\n * Reranking strategy:\n * Vector similarity is the dominant signal (70%) — an irrelevant experience\n * should never outrank a relevant one just because it has high confidence.\n * Quality signals (confidence, importance) act as tiebreakers among\n * similarly-relevant results (30% combined).\n *\n * A minimum similarity threshold filters out noise so quality signals\n * can't promote genuinely irrelevant experiences.\n */\n async findSimilarExperiences(text: string, limit = 5): Promise<Experience[]> {\n if (!text || this.experiences.size === 0) {\n return [];\n }\n\n let queryEmbedding: number[];\n try {\n queryEmbedding = await this.runtime.useModel(ModelType.TEXT_EMBEDDING, {\n text,\n });\n if (\n !Array.isArray(queryEmbedding) ||\n queryEmbedding.length === 0 ||\n queryEmbedding.every((v: number) => v === 0)\n ) {\n logger.warn(\n \"[ExperienceService] Query embedding is empty/zero, falling back to recency sort\"\n );\n return this.fallbackSort(limit);\n }\n } catch {\n logger.warn(\"[ExperienceService] Query embedding failed, falling back to recency sort\");\n return this.fallbackSort(limit);\n }\n\n // Minimum cosine similarity to be considered a candidate at all.\n // Prevents high-quality but irrelevant experiences from appearing.\n const SIMILARITY_FLOOR = 0.05;\n\n const scored: Array<{ experience: Experience; score: number }> = [];\n const now = Date.now();\n\n for (const experience of this.experiences.values()) {\n if (!experience.embedding) continue;\n\n const similarity = this.cosineSimilarity(queryEmbedding, experience.embedding);\n if (similarity < SIMILARITY_FLOOR) continue;\n\n // --- Quality signals (all normalized 0-1) ---\n\n // Confidence with time-decay applied\n const decayedConfidence = this.decayManager.getDecayedConfidence(experience);\n\n // Smooth recency: half-life of 30 days, never goes to zero\n const ageDays = Math.max(0, (now - experience.createdAt) / (24 * 60 * 60 * 1000));\n const recencyFactor = 1 / (1 + ageDays / 30);\n\n // Access frequency: log-scaled, capped at 1.0\n // ~0 at 0 accesses, ~0.33 at 1, ~0.66 at 3, ~1.0 at 9+\n const accessFactor = Math.min(1, Math.log2(experience.accessCount + 1) / Math.log2(10));\n\n // Weighted quality score (0-1 range)\n const qualityScore =\n decayedConfidence * 0.45 +\n experience.importance * 0.35 +\n recencyFactor * 0.12 +\n accessFactor * 0.08;\n\n // Final reranking score: similarity dominates (70%), quality tiebreaks (30%)\n const rerankScore = similarity * 0.7 + qualityScore * 0.3;\n\n scored.push({ experience, score: rerankScore });\n }\n\n // Sort by combined reranking score (highest first)\n scored.sort((a, b) => b.score - a.score);\n const results = scored.slice(0, limit).map((item) => item.experience);\n\n for (const exp of results) {\n exp.accessCount++;\n exp.lastAccessedAt = now;\n this.dirtyExperiences.add(exp.id);\n }\n\n return results;\n }\n\n /** Fallback when embeddings are unavailable: sort by decayed confidence * importance. */\n private fallbackSort(limit: number): Experience[] {\n const all = Array.from(this.experiences.values());\n all.sort((a, b) => {\n const sa = this.decayManager.getDecayedConfidence(a) * a.importance;\n const sb = this.decayManager.getDecayedConfidence(b) * b.importance;\n return sb - sa;\n });\n return all.slice(0, limit);\n }\n\n async analyzeExperiences(domain?: string, type?: ExperienceType): Promise<ExperienceAnalysis> {\n const experiences = await this.queryExperiences({\n domain: domain ? [domain] : undefined,\n type: type ? [type] : undefined,\n limit: 100,\n });\n\n if (experiences.length === 0) {\n return {\n pattern: \"No experiences found for analysis\",\n frequency: 0,\n reliability: 0,\n alternatives: [],\n recommendations: [],\n };\n }\n\n const learnings = experiences.map((exp) => exp.learning);\n const commonWords = this.findCommonPatterns(learnings);\n\n const avgConfidence =\n experiences.reduce((sum, exp) => sum + exp.confidence, 0) / experiences.length;\n const outcomeConsistency = this.calculateOutcomeConsistency(experiences);\n const reliability = (avgConfidence + outcomeConsistency) / 2;\n\n const alternatives = this.extractAlternatives(experiences);\n const recommendations = this.generateRecommendations(experiences, reliability);\n\n return {\n pattern:\n commonWords.length > 0\n ? `Common patterns: ${commonWords.join(\", \")}`\n : \"No clear patterns detected\",\n frequency: experiences.length,\n reliability,\n alternatives,\n recommendations,\n };\n }\n\n private cosineSimilarity(a: number[], b: number[]): number {\n if (a.length !== b.length) return 0;\n\n let dotProduct = 0;\n let normA = 0;\n let normB = 0;\n\n for (let i = 0; i < a.length; i++) {\n const valueA = a[i] ?? 0;\n const valueB = b[i] ?? 0;\n dotProduct += valueA * valueB;\n normA += valueA * valueA;\n normB += valueB * valueB;\n }\n\n if (normA === 0 || normB === 0) return 0;\n return dotProduct / (Math.sqrt(normA) * Math.sqrt(normB));\n }\n\n private findCommonPatterns(texts: string[]): string[] {\n const wordFreq = new Map<string, number>();\n\n for (const text of texts) {\n const words = text.toLowerCase().split(/\\s+/);\n for (const word of words) {\n if (word.length > 3) {\n wordFreq.set(word, (wordFreq.get(word) || 0) + 1);\n }\n }\n }\n\n const threshold = texts.length * 0.3;\n return Array.from(wordFreq.entries())\n .filter(([_, count]) => count >= threshold)\n .sort((a, b) => b[1] - a[1])\n .slice(0, 5)\n .map(([word]) => word);\n }\n\n private calculateOutcomeConsistency(experiences: Experience[]): number {\n if (experiences.length === 0) return 0;\n\n const outcomeCounts = new Map<OutcomeType, number>();\n for (const exp of experiences) {\n outcomeCounts.set(exp.outcome, (outcomeCounts.get(exp.outcome) || 0) + 1);\n }\n\n const maxCount = Math.max(...outcomeCounts.values());\n return maxCount / experiences.length;\n }\n\n private extractAlternatives(experiences: Experience[]): string[] {\n const alternatives = new Set<string>();\n\n for (const exp of experiences) {\n if (exp.type === ExperienceType.CORRECTION && exp.correctedBelief) {\n alternatives.add(exp.correctedBelief);\n }\n if (exp.outcome === OutcomeType.NEGATIVE && exp.learning.includes(\"instead\")) {\n const match = exp.learning.match(/instead\\s+(.+?)(?:\\.|$)/i);\n const alternative = match?.[1]?.trim();\n if (alternative) {\n alternatives.add(alternative);\n }\n }\n }\n\n return Array.from(alternatives).slice(0, 5);\n }\n\n private generateRecommendations(experiences: Experience[], reliability: number): string[] {\n const recommendations: string[] = [];\n\n if (reliability > 0.8) {\n recommendations.push(\"Continue using successful approaches\");\n recommendations.push(\"Document and share these reliable methods\");\n } else if (reliability > 0.6) {\n recommendations.push(\"Continue using successful approaches with caution\");\n recommendations.push(\"Monitor for potential issues\");\n recommendations.push(\"Consider backup strategies\");\n } else if (reliability > 0.4) {\n recommendations.push(\"Review and improve current approaches\");\n recommendations.push(\"Investigate failure patterns\");\n recommendations.push(\"Consider alternative methods\");\n } else {\n recommendations.push(\"Significant changes needed to current approach\");\n recommendations.push(\"Analyze failure causes thoroughly\");\n recommendations.push(\"Seek alternative solutions\");\n }\n\n const failureTypes = new Map<string, number>();\n experiences\n .filter((e) => e.outcome === OutcomeType.NEGATIVE)\n .forEach((e) => {\n const key = e.learning.toLowerCase();\n failureTypes.set(key, (failureTypes.get(key) || 0) + 1);\n });\n\n if (failureTypes.size > 0) {\n const mostCommonFailure = Array.from(failureTypes.entries()).sort((a, b) => b[1] - a[1])[0];\n\n if (mostCommonFailure && mostCommonFailure[1] > 1) {\n recommendations.push(`Address recurring issue: ${mostCommonFailure[0]}`);\n }\n }\n\n const domains = new Set(experiences.map((e) => e.domain));\n if (domains.has(\"shell\")) {\n recommendations.push(\"Verify command syntax and permissions\");\n }\n if (domains.has(\"coding\")) {\n recommendations.push(\"Test thoroughly before deployment\");\n }\n if (domains.has(\"network\")) {\n recommendations.push(\"Implement retry logic and error handling\");\n }\n\n return recommendations.slice(0, 5);\n }\n\n async stop(): Promise<void> {\n logger.info(\"[ExperienceService] Stopping...\");\n\n // Stop the persistence timer\n if (this.persistTimer) {\n clearInterval(this.persistTimer);\n this.persistTimer = null;\n }\n\n // Final persist of all dirty experiences + full save\n const experiencesToSave = Array.from(this.experiences.values());\n let savedCount = 0;\n\n for (const experience of experiencesToSave) {\n try {\n await this.saveExperienceToMemory(experience);\n savedCount++;\n } catch (err) {\n logger.warn(`[ExperienceService] Failed to save experience ${experience.id}: ${err}`);\n }\n }\n\n this.dirtyExperiences.clear();\n logger.info(`[ExperienceService] Saved ${savedCount} experiences`);\n }\n}\n",
|
|
14
14
|
"import type { Experience } from \"../types\";\nimport { ExperienceType } from \"../types\";\n\nexport interface DecayConfig {\n halfLife: number; // Time in milliseconds for confidence to decay by half\n minConfidence: number; // Minimum confidence level (never decays below this)\n decayStartDelay: number; // Time before decay starts (grace period)\n}\n\nconst DEFAULT_DECAY_CONFIG: DecayConfig = {\n halfLife: 30 * 24 * 60 * 60 * 1000, // 30 days\n minConfidence: 0.1, // 10% minimum\n decayStartDelay: 7 * 24 * 60 * 60 * 1000, // 7 days grace period\n};\n\nexport class ConfidenceDecayManager {\n private config: DecayConfig;\n\n constructor(config: Partial<DecayConfig> = {}) {\n this.config = { ...DEFAULT_DECAY_CONFIG, ...config };\n }\n\n /**\n * Calculate the decayed confidence for an experience\n */\n getDecayedConfidence(experience: Experience): number {\n const now = Date.now();\n const age = now - experience.createdAt;\n const specificConfig = this.getDomainSpecificDecay(experience);\n\n // No decay during grace period\n if (age < specificConfig.decayStartDelay) {\n return experience.confidence;\n }\n\n // Calculate decay based on half-life\n const decayTime = age - specificConfig.decayStartDelay;\n const halfLives = decayTime / specificConfig.halfLife;\n const decayFactor = 0.5 ** halfLives;\n\n // Apply decay but respect minimum\n const decayedConfidence = experience.confidence * decayFactor;\n return Math.max(specificConfig.minConfidence, decayedConfidence);\n }\n\n /**\n * Get experiences that need reinforcement (low confidence due to decay)\n */\n getExperiencesNeedingReinforcement(experiences: Experience[], threshold = 0.3): Experience[] {\n return experiences.filter((exp) => {\n const decayed = this.getDecayedConfidence(exp);\n return decayed < threshold && decayed > this.config.minConfidence;\n });\n }\n\n /**\n * Calculate reinforcement boost when an experience is validated\n */\n calculateReinforcementBoost(experience: Experience, validationStrength = 1.0): number {\n const currentConfidence = this.getDecayedConfidence(experience);\n const boost = (1 - currentConfidence) * validationStrength * 0.5;\n return Math.min(1, currentConfidence + boost);\n }\n\n /**\n * Adjust decay rate based on experience type and domain\n */\n getDomainSpecificDecay(experience: Experience): DecayConfig {\n const config = { ...this.config };\n\n // Facts and discoveries decay slower\n if (\n experience.type === ExperienceType.DISCOVERY ||\n experience.type === ExperienceType.LEARNING\n ) {\n config.halfLife *= 2; // Double the half-life\n }\n\n // Warnings and corrections decay slower (important to remember)\n if (\n experience.type === ExperienceType.WARNING ||\n experience.type === ExperienceType.CORRECTION\n ) {\n config.halfLife *= 1.5;\n config.minConfidence = 0.2; // Higher minimum\n }\n\n // Domain-specific adjustments\n switch (experience.domain) {\n case \"security\":\n case \"safety\":\n config.halfLife *= 3; // Security lessons decay very slowly\n config.minConfidence = 0.3;\n break;\n case \"performance\":\n config.halfLife *= 0.5; // Performance insights may change quickly\n break;\n case \"user_preference\":\n config.halfLife *= 0.7; // User preferences can change\n break;\n }\n\n return config;\n }\n\n /**\n * Get confidence trend for an experience over time\n */\n getConfidenceTrend(\n experience: Experience,\n points = 10\n ): Array<{ timestamp: number; confidence: number }> {\n const trend: Array<{ timestamp: number; confidence: number }> = [];\n const now = Date.now();\n const totalTime = now - experience.createdAt;\n const interval = totalTime / (points - 1);\n const specificConfig = this.getDomainSpecificDecay(experience);\n\n for (let i = 0; i < points; i++) {\n const timestamp = experience.createdAt + interval * i;\n const age = timestamp - experience.createdAt;\n\n let confidence: number;\n if (age < specificConfig.decayStartDelay) {\n confidence = experience.confidence;\n } else {\n const decayTime = age - specificConfig.decayStartDelay;\n const halfLives = decayTime / specificConfig.halfLife;\n const decayFactor = 0.5 ** halfLives;\n confidence = Math.max(specificConfig.minConfidence, experience.confidence * decayFactor);\n }\n\n trend.push({ timestamp, confidence });\n }\n\n return trend;\n }\n}\n",
|
|
15
15
|
"import type { UUID } from \"@elizaos/core\";\nimport type { Experience, JsonObject } from \"../types\";\nimport { ExperienceType, OutcomeType } from \"../types\";\n\nexport interface ExperienceChain {\n rootExperience: string; // UUID of the root experience\n chain: string[]; // Ordered list of experience IDs\n strength: number; // How strong the causal relationship is\n validated: boolean; // Whether the chain has been validated\n}\n\nexport interface ExperienceRelationship {\n fromId: string;\n toId: string;\n type: \"causes\" | \"contradicts\" | \"supports\" | \"supersedes\" | \"related\";\n strength: number; // 0-1\n metadata?: JsonObject;\n}\n\nexport class ExperienceRelationshipManager {\n private relationships: Map<string, ExperienceRelationship[]> = new Map();\n\n addRelationship(relationship: ExperienceRelationship): void {\n const { fromId } = relationship;\n if (!this.relationships.has(fromId)) {\n this.relationships.set(fromId, []);\n }\n this.relationships.get(fromId)?.push(relationship);\n }\n\n findRelationships(experienceId: string, type?: string): ExperienceRelationship[] {\n const rels = this.relationships.get(experienceId) || [];\n if (type) {\n return rels.filter((r) => r.type === type);\n }\n return rels;\n }\n\n detectCausalChain(experiences: Experience[]): ExperienceChain[] {\n const chains: ExperienceChain[] = [];\n\n // Sort experiences by timestamp\n const sorted = [...experiences].sort((a, b) => a.createdAt - b.createdAt);\n\n // Look for sequences where validation follows hypothesis\n for (let i = 0; i < sorted.length - 1; i++) {\n const current = sorted[i];\n if (!current) {\n continue;\n }\n\n if (current.type === ExperienceType.HYPOTHESIS) {\n const chain: string[] = [current.id];\n let j = i + 1;\n\n // Look for related experiences\n while (j < sorted.length) {\n const next = sorted[j];\n if (!next) {\n j++;\n continue;\n }\n\n // Check if next experience validates or contradicts the hypothesis\n if (next.relatedExperiences?.includes(current.id) || this.isRelated(current, next)) {\n chain.push(next.id);\n\n // If we found a validation, create a chain\n if (next.type === ExperienceType.VALIDATION) {\n chains.push({\n rootExperience: current.id,\n chain,\n strength: next.confidence,\n validated: next.outcome === OutcomeType.POSITIVE,\n });\n break;\n }\n }\n j++;\n }\n }\n }\n\n return chains;\n }\n\n private isRelated(exp1: Experience, exp2: Experience): boolean {\n // Check domain match\n if (exp1.domain === exp2.domain) {\n // Check temporal proximity (within 5 minutes)\n const timeDiff = Math.abs(exp2.createdAt - exp1.createdAt);\n if (timeDiff < 5 * 60 * 1000) {\n // Check content similarity\n if (this.contentSimilarity(exp1, exp2) > 0.7) {\n return true;\n }\n }\n }\n return false;\n }\n\n private contentSimilarity(exp1: Experience, exp2: Experience): number {\n // Simple keyword overlap for now\n const words1 = new Set(exp1.learning.toLowerCase().split(/\\s+/));\n const words2 = new Set(exp2.learning.toLowerCase().split(/\\s+/));\n\n const intersection = new Set([...words1].filter((x) => words2.has(x)));\n const union = new Set([...words1, ...words2]);\n\n return intersection.size / union.size;\n }\n\n findContradictions(experience: Experience, allExperiences: Experience[]): Experience[] {\n const contradictions: Experience[] = [];\n\n for (const other of allExperiences) {\n if (other.id === experience.id) continue;\n\n // Same action, different outcome\n if (\n other.action === experience.action &&\n other.outcome !== experience.outcome &&\n other.domain === experience.domain\n ) {\n contradictions.push(other);\n }\n\n // Explicit contradiction relationship\n const rels = this.findRelationships(experience.id, \"contradicts\");\n if (rels.some((r) => r.toId === other.id)) {\n contradictions.push(other);\n }\n }\n\n return contradictions;\n }\n\n getExperienceImpact(experienceId: string, allExperiences: Experience[]): number {\n let impact = 0;\n\n for (const exp of allExperiences) {\n if (exp.relatedExperiences?.includes(experienceId as UUID)) {\n impact += exp.importance;\n }\n }\n\n // Add impact from relationships\n const relationships = this.findRelationships(experienceId);\n for (const rel of relationships) {\n if (rel.type === \"causes\") {\n impact += rel.strength;\n }\n }\n\n return impact;\n }\n}\n"
|
|
16
16
|
],
|
|
17
|
-
"mappings": ";AACA,mBAAS;;;ACDT;AAAA;AAAA;AAAA;;;AC4BO,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,EACT,SAAS;AAAA,IACP;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,MACF,SAAS,CAAC,YAAY,SAAS,oBAAoB,mBAAmB,iBAAiB;AAAA,MACvF,YAAY,CAAC;AAAA,MACb,UAAU;AAAA,QACR;AAAA,UACE;AAAA,YACE,MAAM;AAAA,YACN,SAAS;AAAA,cACP,MAAM;AAAA,YACR;AAAA,UACF;AAAA,UACA;AAAA,YACE,MAAM;AAAA,YACN,SAAS;AAAA,cACP,MAAM;AAAA,cACN,SAAS,CAAC,mBAAmB;AAAA,YAC/B;AAAA,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;AAAA,EAC9B,YAAY,CAAC,mBAAmB;AAAA,OAE1B,KAAI,CAAC,QAAgC,SAAuC;AAAA,IAChF,QAAO,KAAK,4DAA4D;AAAA,IAExE,MAAM,sBAAsB,oBAAoB,OAAO,uBAAuB,GAAG;AAAA,IAEjF,QAAQ,WAAW,yBAAyB,oBAAoB,SAAS,CAAC;AAAA,IAE1E,QAAO,KAAK;AAAA,+BACe,qBAAqB;AAAA;AAEpD;AAEA,IAAe;AAKf,SAAS,mBAAmB,CAAC,OAA2B,UAA0B;AAAA,EAChF,IAAI,CAAC;AAAA,IAAO,OAAO;AAAA,EACnB,MAAM,SAAS,OAAO,WAAW,KAAK;AAAA,EACtC,OAAO,OAAO,SAAS,MAAM,IAAI,SAAS;AAAA;",
|
|
18
|
+
"debugId": "21141D6C2118F96564756E2164756E21",
|
|
19
19
|
"names": []
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-experience",
|
|
3
3
|
"description": "Experience learning plugin for ElizaOS - records and recalls transferable agent learnings",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/node/index.node.js",
|
|
7
7
|
"module": "dist/node/index.node.js",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"format": "bunx @biomejs/biome format --write .",
|
|
61
61
|
"format:check": "bunx @biomejs/biome format .",
|
|
62
62
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
63
|
-
"test": "vitest run
|
|
64
|
-
"test:unit": "vitest run tests
|
|
63
|
+
"test": "npx -y vitest@4.0.18 run --passWithNoTests",
|
|
64
|
+
"test:unit": "npx -y vitest@4.0.18 run tests --passWithNoTests",
|
|
65
65
|
"test:watch": "vitest",
|
|
66
66
|
"lint": "bunx @biomejs/biome check --write --unsafe .",
|
|
67
67
|
"lint:check": "bunx @biomejs/biome check .",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"description": "Records and recalls transferable agent learnings."
|
|
85
85
|
},
|
|
86
|
-
"
|
|
86
|
+
"milady": {
|
|
87
87
|
"platforms": [
|
|
88
88
|
"node"
|
|
89
89
|
],
|
package/dist/actions/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record-experience.d.ts","sourceRoot":"","sources":["../../actions/record-experience.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAUZ,MAAM,eAAe,CAAC;AAKvB,eAAO,MAAM,sBAAsB,EAAE,MAkDpC,CAAC"}
|
package/dist/build.d.ts
DELETED
package/dist/build.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../build.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experienceEvaluator.d.ts","sourceRoot":"","sources":["../../evaluators/experienceEvaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAQf,MAAM,eAAe,CAAC;AAavB,eAAO,MAAM,mBAAmB,EAAE,SA8MjC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-generated prompt templates
|
|
3
|
-
* DO NOT EDIT - Generated from ../../../../prompts/*.txt
|
|
4
|
-
*
|
|
5
|
-
* These prompts use Handlebars-style template syntax:
|
|
6
|
-
* - {{variableName}} for simple substitution
|
|
7
|
-
* - {{#each items}}...{{/each}} for iteration
|
|
8
|
-
* - {{#if condition}}...{{/if}} for conditionals
|
|
9
|
-
*/
|
|
10
|
-
export declare const extractExperiencesTemplate = "# Task: Extract Novel Learning Experiences\n\nAnalyze this conversation for novel learning experiences that would be surprising or valuable to remember.\n\n## Conversation context\n{{conversation_context}}\n\n## Existing similar experiences\n{{existing_experiences}}\n\n## Instructions\nExtract ONLY experiences that are:\n1. Genuinely novel (not in existing experiences)\n2. Actionable learnings about how things work\n3. Corrections of previous mistakes or assumptions\n4. Discoveries of new capabilities or patterns\n5. Surprising outcomes that contradict expectations\n\nFocus on technical knowledge, patterns, and cause-effect relationships that transfer to other contexts.\nAvoid personal details, user-specific information, or routine interactions.\n\nRespond with JSON array of experiences (max 3):\n[{\n \"type\": \"DISCOVERY|CORRECTION|SUCCESS|LEARNING\",\n \"learning\": \"What was learned (generic, transferable)\",\n \"context\": \"What situation triggered this (anonymized)\",\n \"confidence\": 0.0-1.0,\n \"reasoning\": \"Why this is novel and valuable\"\n}]\n\nReturn empty array [] if no novel experiences found.";
|
|
11
|
-
export declare const EXTRACT_EXPERIENCES_TEMPLATE = "# Task: Extract Novel Learning Experiences\n\nAnalyze this conversation for novel learning experiences that would be surprising or valuable to remember.\n\n## Conversation context\n{{conversation_context}}\n\n## Existing similar experiences\n{{existing_experiences}}\n\n## Instructions\nExtract ONLY experiences that are:\n1. Genuinely novel (not in existing experiences)\n2. Actionable learnings about how things work\n3. Corrections of previous mistakes or assumptions\n4. Discoveries of new capabilities or patterns\n5. Surprising outcomes that contradict expectations\n\nFocus on technical knowledge, patterns, and cause-effect relationships that transfer to other contexts.\nAvoid personal details, user-specific information, or routine interactions.\n\nRespond with JSON array of experiences (max 3):\n[{\n \"type\": \"DISCOVERY|CORRECTION|SUCCESS|LEARNING\",\n \"learning\": \"What was learned (generic, transferable)\",\n \"context\": \"What situation triggered this (anonymized)\",\n \"confidence\": 0.0-1.0,\n \"reasoning\": \"Why this is novel and valuable\"\n}]\n\nReturn empty array [] if no novel experiences found.";
|
|
12
|
-
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../generated/prompts/typescript/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,0BAA0B,mnCA8Bc,CAAC;AAEtD,eAAO,MAAM,4BAA4B,mnCAA6B,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper functions to lookup action/provider/evaluator specs by name.
|
|
3
|
-
* These allow language-specific implementations to import their text content
|
|
4
|
-
* (description, similes, examples) from the centralized specs.
|
|
5
|
-
*
|
|
6
|
-
* DO NOT EDIT the spec data - update prompts/actions.json, prompts/providers.json, prompts/evaluators.json and regenerate.
|
|
7
|
-
*/
|
|
8
|
-
import { type ActionDoc, type EvaluatorDoc, type ProviderDoc } from "./specs";
|
|
9
|
-
/**
|
|
10
|
-
* Get an action spec by name from the core specs.
|
|
11
|
-
* @param name - The action name
|
|
12
|
-
* @returns The action spec or undefined if not found
|
|
13
|
-
*/
|
|
14
|
-
export declare function getActionSpec(name: string): ActionDoc | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Get an action spec by name, throwing if not found.
|
|
17
|
-
* @param name - The action name
|
|
18
|
-
* @returns The action spec
|
|
19
|
-
* @throws Error if the action is not found
|
|
20
|
-
*/
|
|
21
|
-
export declare function requireActionSpec(name: string): ActionDoc;
|
|
22
|
-
/**
|
|
23
|
-
* Get a provider spec by name from the core specs.
|
|
24
|
-
* @param name - The provider name
|
|
25
|
-
* @returns The provider spec or undefined if not found
|
|
26
|
-
*/
|
|
27
|
-
export declare function getProviderSpec(name: string): ProviderDoc | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Get a provider spec by name, throwing if not found.
|
|
30
|
-
* @param name - The provider name
|
|
31
|
-
* @returns The provider spec
|
|
32
|
-
* @throws Error if the provider is not found
|
|
33
|
-
*/
|
|
34
|
-
export declare function requireProviderSpec(name: string): ProviderDoc;
|
|
35
|
-
/**
|
|
36
|
-
* Get an evaluator spec by name from the core specs.
|
|
37
|
-
* @param name - The evaluator name
|
|
38
|
-
* @returns The evaluator spec or undefined if not found
|
|
39
|
-
*/
|
|
40
|
-
export declare function getEvaluatorSpec(name: string): EvaluatorDoc | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Get an evaluator spec by name, throwing if not found.
|
|
43
|
-
* @param name - The evaluator name
|
|
44
|
-
* @returns The evaluator spec
|
|
45
|
-
* @throws Error if the evaluator is not found
|
|
46
|
-
*/
|
|
47
|
-
export declare function requireEvaluatorSpec(name: string): EvaluatorDoc;
|
|
48
|
-
export type { ActionDoc, ProviderDoc, EvaluatorDoc };
|
|
49
|
-
//# sourceMappingURL=spec-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec-helpers.d.ts","sourceRoot":"","sources":["../../../generated/specs/spec-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,SAAS,EAOd,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AAgBjB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAMzD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAM7D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAM/D;AAGD,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-generated canonical action/provider/evaluator docs for plugin-experience.
|
|
3
|
-
* DO NOT EDIT - Generated from prompts/specs/**.
|
|
4
|
-
*/
|
|
5
|
-
export type ActionDoc = {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
similes?: readonly string[];
|
|
9
|
-
parameters?: readonly unknown[];
|
|
10
|
-
examples?: readonly (readonly unknown[])[];
|
|
11
|
-
};
|
|
12
|
-
export type ProviderDoc = {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
position?: number;
|
|
16
|
-
dynamic?: boolean;
|
|
17
|
-
};
|
|
18
|
-
export type EvaluatorDoc = {
|
|
19
|
-
name: string;
|
|
20
|
-
description: string;
|
|
21
|
-
similes?: readonly string[];
|
|
22
|
-
alwaysRun?: boolean;
|
|
23
|
-
examples?: readonly unknown[];
|
|
24
|
-
};
|
|
25
|
-
export declare const coreActionsSpec: {
|
|
26
|
-
readonly version: "1.0.0";
|
|
27
|
-
readonly actions: readonly [{
|
|
28
|
-
readonly name: "RECORD_EXPERIENCE";
|
|
29
|
-
readonly description: "Record a learning or experience for future reference. Use this when the user explicitly asks you to remember something or when you've learned something important.";
|
|
30
|
-
readonly similes: readonly ["REMEMBER", "LEARN", "STORE_EXPERIENCE", "SAVE_EXPERIENCE", "RECORD_LEARNING"];
|
|
31
|
-
readonly parameters: readonly [];
|
|
32
|
-
readonly examples: readonly [readonly [{
|
|
33
|
-
readonly name: "{{name1}}";
|
|
34
|
-
readonly content: {
|
|
35
|
-
readonly text: "Remember that installing dependencies is required for Python scripts";
|
|
36
|
-
};
|
|
37
|
-
}, {
|
|
38
|
-
readonly name: "{{name2}}";
|
|
39
|
-
readonly content: {
|
|
40
|
-
readonly text: "I'll record that experience. Learning: Need to install dependencies before running Python scripts.";
|
|
41
|
-
readonly actions: readonly ["RECORD_EXPERIENCE"];
|
|
42
|
-
};
|
|
43
|
-
}], readonly [{
|
|
44
|
-
readonly name: "{{name1}}";
|
|
45
|
-
readonly content: {
|
|
46
|
-
readonly text: "Remember that users prefer shorter responses";
|
|
47
|
-
};
|
|
48
|
-
}, {
|
|
49
|
-
readonly name: "{{name2}}";
|
|
50
|
-
readonly content: {
|
|
51
|
-
readonly text: "I'll remember that preference.";
|
|
52
|
-
readonly actions: readonly ["RECORD_EXPERIENCE"];
|
|
53
|
-
};
|
|
54
|
-
}], readonly [{
|
|
55
|
-
readonly name: "{{name1}}";
|
|
56
|
-
readonly content: {
|
|
57
|
-
readonly text: "What's 2+2?";
|
|
58
|
-
};
|
|
59
|
-
}, {
|
|
60
|
-
readonly name: "{{name2}}";
|
|
61
|
-
readonly content: {
|
|
62
|
-
readonly text: "2+2 equals 4.";
|
|
63
|
-
};
|
|
64
|
-
}], readonly [{
|
|
65
|
-
readonly name: "{{name1}}";
|
|
66
|
-
readonly content: {
|
|
67
|
-
readonly text: "Can you help me with math?";
|
|
68
|
-
};
|
|
69
|
-
}, {
|
|
70
|
-
readonly name: "{{name2}}";
|
|
71
|
-
readonly content: {
|
|
72
|
-
readonly text: "Of course! What math problem do you need help with?";
|
|
73
|
-
};
|
|
74
|
-
}]];
|
|
75
|
-
}];
|
|
76
|
-
};
|
|
77
|
-
export declare const allActionsSpec: {
|
|
78
|
-
readonly version: "1.0.0";
|
|
79
|
-
readonly actions: readonly [{
|
|
80
|
-
readonly name: "RECORD_EXPERIENCE";
|
|
81
|
-
readonly description: "Record a learning or experience for future reference. Use this when the user explicitly asks you to remember something or when you've learned something important.";
|
|
82
|
-
readonly similes: readonly ["REMEMBER", "LEARN", "STORE_EXPERIENCE", "SAVE_EXPERIENCE", "RECORD_LEARNING"];
|
|
83
|
-
readonly parameters: readonly [];
|
|
84
|
-
readonly examples: readonly [readonly [{
|
|
85
|
-
readonly name: "{{name1}}";
|
|
86
|
-
readonly content: {
|
|
87
|
-
readonly text: "Remember that installing dependencies is required for Python scripts";
|
|
88
|
-
};
|
|
89
|
-
}, {
|
|
90
|
-
readonly name: "{{name2}}";
|
|
91
|
-
readonly content: {
|
|
92
|
-
readonly text: "I'll record that experience. Learning: Need to install dependencies before running Python scripts.";
|
|
93
|
-
readonly actions: readonly ["RECORD_EXPERIENCE"];
|
|
94
|
-
};
|
|
95
|
-
}], readonly [{
|
|
96
|
-
readonly name: "{{name1}}";
|
|
97
|
-
readonly content: {
|
|
98
|
-
readonly text: "Remember that users prefer shorter responses";
|
|
99
|
-
};
|
|
100
|
-
}, {
|
|
101
|
-
readonly name: "{{name2}}";
|
|
102
|
-
readonly content: {
|
|
103
|
-
readonly text: "I'll remember that preference.";
|
|
104
|
-
readonly actions: readonly ["RECORD_EXPERIENCE"];
|
|
105
|
-
};
|
|
106
|
-
}], readonly [{
|
|
107
|
-
readonly name: "{{name1}}";
|
|
108
|
-
readonly content: {
|
|
109
|
-
readonly text: "What's 2+2?";
|
|
110
|
-
};
|
|
111
|
-
}, {
|
|
112
|
-
readonly name: "{{name2}}";
|
|
113
|
-
readonly content: {
|
|
114
|
-
readonly text: "2+2 equals 4.";
|
|
115
|
-
};
|
|
116
|
-
}], readonly [{
|
|
117
|
-
readonly name: "{{name1}}";
|
|
118
|
-
readonly content: {
|
|
119
|
-
readonly text: "Can you help me with math?";
|
|
120
|
-
};
|
|
121
|
-
}, {
|
|
122
|
-
readonly name: "{{name2}}";
|
|
123
|
-
readonly content: {
|
|
124
|
-
readonly text: "Of course! What math problem do you need help with?";
|
|
125
|
-
};
|
|
126
|
-
}]];
|
|
127
|
-
}];
|
|
128
|
-
};
|
|
129
|
-
export declare const coreProvidersSpec: {
|
|
130
|
-
readonly version: "1.0.0";
|
|
131
|
-
readonly providers: readonly [{
|
|
132
|
-
readonly name: "experienceProvider";
|
|
133
|
-
readonly description: "Provides relevant past experiences and learnings for the current context";
|
|
134
|
-
readonly dynamic: true;
|
|
135
|
-
}];
|
|
136
|
-
};
|
|
137
|
-
export declare const allProvidersSpec: {
|
|
138
|
-
readonly version: "1.0.0";
|
|
139
|
-
readonly providers: readonly [{
|
|
140
|
-
readonly name: "experienceProvider";
|
|
141
|
-
readonly description: "Provides relevant past experiences and learnings for the current context";
|
|
142
|
-
readonly dynamic: true;
|
|
143
|
-
}];
|
|
144
|
-
};
|
|
145
|
-
export declare const coreEvaluatorsSpec: {
|
|
146
|
-
readonly version: "1.0.0";
|
|
147
|
-
readonly evaluators: readonly [];
|
|
148
|
-
};
|
|
149
|
-
export declare const allEvaluatorsSpec: {
|
|
150
|
-
readonly version: "1.0.0";
|
|
151
|
-
readonly evaluators: readonly [];
|
|
152
|
-
};
|
|
153
|
-
export declare const coreActionDocs: readonly ActionDoc[];
|
|
154
|
-
export declare const allActionDocs: readonly ActionDoc[];
|
|
155
|
-
export declare const coreProviderDocs: readonly ProviderDoc[];
|
|
156
|
-
export declare const allProviderDocs: readonly ProviderDoc[];
|
|
157
|
-
export declare const coreEvaluatorDocs: readonly EvaluatorDoc[];
|
|
158
|
-
export declare const allEvaluatorDocs: readonly EvaluatorDoc[];
|
|
159
|
-
//# sourceMappingURL=specs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../generated/specs/specs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,O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dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAM3D,OAAO,SAAS,CAAC;AAEjB,eAAO,MAAM,gBAAgB,EAAE,MAoB9B,CAAC;AAEF,eAAe,gBAAgB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experienceProvider.d.ts","sourceRoot":"","sources":["../../providers/experienceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EAGd,MAAM,eAAe,CAAC;AAUvB,eAAO,MAAM,kBAAkB,EAAE,QAqDhC,CAAC"}
|
package/dist/service.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type IAgentRuntime, Service, type ServiceTypeName } from "@elizaos/core";
|
|
2
|
-
import { type Experience, type ExperienceAnalysis, type ExperienceQuery, ExperienceType } from "./types";
|
|
3
|
-
export declare class ExperienceService extends Service {
|
|
4
|
-
static serviceType: ServiceTypeName;
|
|
5
|
-
capabilityDescription: string;
|
|
6
|
-
private experiences;
|
|
7
|
-
private experiencesByDomain;
|
|
8
|
-
private experiencesByType;
|
|
9
|
-
private dirtyExperiences;
|
|
10
|
-
private persistTimer;
|
|
11
|
-
private decayManager;
|
|
12
|
-
private relationshipManager;
|
|
13
|
-
constructor(runtime: IAgentRuntime);
|
|
14
|
-
static start(runtime: IAgentRuntime): Promise<ExperienceService>;
|
|
15
|
-
private loadExperiences;
|
|
16
|
-
recordExperience(experienceData: Partial<Experience>): Promise<Experience>;
|
|
17
|
-
private saveExperienceToMemory;
|
|
18
|
-
private persistDirtyExperiences;
|
|
19
|
-
queryExperiences(query: ExperienceQuery): Promise<Experience[]>;
|
|
20
|
-
/** Apply query filters (type, outcome, domain, tags, confidence, importance, timeRange). */
|
|
21
|
-
private applyFilters;
|
|
22
|
-
/**
|
|
23
|
-
* Find similar experiences using vector search + reranking.
|
|
24
|
-
*
|
|
25
|
-
* Reranking strategy:
|
|
26
|
-
* Vector similarity is the dominant signal (70%) — an irrelevant experience
|
|
27
|
-
* should never outrank a relevant one just because it has high confidence.
|
|
28
|
-
* Quality signals (confidence, importance) act as tiebreakers among
|
|
29
|
-
* similarly-relevant results (30% combined).
|
|
30
|
-
*
|
|
31
|
-
* A minimum similarity threshold filters out noise so quality signals
|
|
32
|
-
* can't promote genuinely irrelevant experiences.
|
|
33
|
-
*/
|
|
34
|
-
findSimilarExperiences(text: string, limit?: number): Promise<Experience[]>;
|
|
35
|
-
/** Fallback when embeddings are unavailable: sort by decayed confidence * importance. */
|
|
36
|
-
private fallbackSort;
|
|
37
|
-
analyzeExperiences(domain?: string, type?: ExperienceType): Promise<ExperienceAnalysis>;
|
|
38
|
-
private cosineSimilarity;
|
|
39
|
-
private findCommonPatterns;
|
|
40
|
-
private calculateOutcomeConsistency;
|
|
41
|
-
private extractAlternatives;
|
|
42
|
-
private generateRecommendations;
|
|
43
|
-
stop(): Promise<void>;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=service.d.ts.map
|
package/dist/service.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGlB,OAAO,EACP,KAAK,eAAe,EAErB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,eAAe,EAEpB,cAAc,EAEf,MAAM,SAAS,CAAC;AAIjB,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,OAAgB,WAAW,EAAE,eAAe,CAAoC;IACvE,qBAAqB,SACkE;IAEhG,OAAO,CAAC,WAAW,CAAoC;IACvD,OAAO,CAAC,mBAAmB,CAAqC;IAChE,OAAO,CAAC,iBAAiB,CAA6C;IACtE,OAAO,CAAC,gBAAgB,CAAwB;IAChD,OAAO,CAAC,YAAY,CAA+C;IACnE,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,mBAAmB,CAAgC;gBAE/C,OAAO,EAAE,aAAa;WAarB,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAMxD,eAAe;IAuEvB,gBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;YAmFlE,sBAAsB;YAyCtB,uBAAuB;IAyB/B,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IA8DrE,4FAA4F;IAC5F,OAAO,CAAC,YAAY;IAqCpB;;;;;;;;;;;OAWG;IACG,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IA2E5E,yFAAyF;IACzF,OAAO,CAAC,YAAY;IAUd,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAwC7F,OAAO,CAAC,gBAAgB;IAmBxB,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,uBAAuB;IAkDzB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAyB5B"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { Memory, UUID } from "@elizaos/core";
|
|
2
|
-
export type JsonPrimitive = string | number | boolean | null;
|
|
3
|
-
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
4
|
-
[key: string]: JsonValue;
|
|
5
|
-
};
|
|
6
|
-
export type JsonObject = {
|
|
7
|
-
[key: string]: JsonValue;
|
|
8
|
-
};
|
|
9
|
-
declare module "@elizaos/core" {
|
|
10
|
-
interface ServiceTypeRegistry {
|
|
11
|
-
EXPERIENCE: "EXPERIENCE";
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export declare const ExperienceServiceType: {
|
|
15
|
-
EXPERIENCE: "EXPERIENCE";
|
|
16
|
-
};
|
|
17
|
-
export declare enum ExperienceType {
|
|
18
|
-
SUCCESS = "success",// Agent accomplished something
|
|
19
|
-
FAILURE = "failure",// Agent failed at something
|
|
20
|
-
DISCOVERY = "discovery",// Agent discovered new information
|
|
21
|
-
CORRECTION = "correction",// Agent corrected a mistake
|
|
22
|
-
LEARNING = "learning",// Agent learned something new
|
|
23
|
-
HYPOTHESIS = "hypothesis",// Agent formed a hypothesis
|
|
24
|
-
VALIDATION = "validation",// Agent validated a hypothesis
|
|
25
|
-
WARNING = "warning"
|
|
26
|
-
}
|
|
27
|
-
export declare enum OutcomeType {
|
|
28
|
-
POSITIVE = "positive",
|
|
29
|
-
NEGATIVE = "negative",
|
|
30
|
-
NEUTRAL = "neutral",
|
|
31
|
-
MIXED = "mixed"
|
|
32
|
-
}
|
|
33
|
-
export interface Experience {
|
|
34
|
-
id: UUID;
|
|
35
|
-
agentId: UUID;
|
|
36
|
-
type: ExperienceType;
|
|
37
|
-
outcome: OutcomeType;
|
|
38
|
-
context: string;
|
|
39
|
-
action: string;
|
|
40
|
-
result: string;
|
|
41
|
-
learning: string;
|
|
42
|
-
tags: string[];
|
|
43
|
-
domain: string;
|
|
44
|
-
relatedExperiences?: UUID[];
|
|
45
|
-
supersedes?: UUID;
|
|
46
|
-
confidence: number;
|
|
47
|
-
importance: number;
|
|
48
|
-
createdAt: number;
|
|
49
|
-
updatedAt: number;
|
|
50
|
-
lastAccessedAt?: number;
|
|
51
|
-
accessCount: number;
|
|
52
|
-
previousBelief?: string;
|
|
53
|
-
correctedBelief?: string;
|
|
54
|
-
embedding?: number[];
|
|
55
|
-
memoryIds?: UUID[];
|
|
56
|
-
}
|
|
57
|
-
export interface ExperienceQuery {
|
|
58
|
-
query?: string;
|
|
59
|
-
type?: ExperienceType | ExperienceType[];
|
|
60
|
-
outcome?: OutcomeType | OutcomeType[];
|
|
61
|
-
domain?: string | string[];
|
|
62
|
-
tags?: string[];
|
|
63
|
-
minImportance?: number;
|
|
64
|
-
minConfidence?: number;
|
|
65
|
-
timeRange?: {
|
|
66
|
-
start?: number;
|
|
67
|
-
end?: number;
|
|
68
|
-
};
|
|
69
|
-
limit?: number;
|
|
70
|
-
includeRelated?: boolean;
|
|
71
|
-
}
|
|
72
|
-
export interface ExperienceAnalysis {
|
|
73
|
-
pattern?: string;
|
|
74
|
-
frequency?: number;
|
|
75
|
-
reliability?: number;
|
|
76
|
-
alternatives?: string[];
|
|
77
|
-
recommendations?: string[];
|
|
78
|
-
}
|
|
79
|
-
export interface ExperienceEvent {
|
|
80
|
-
experienceId: UUID;
|
|
81
|
-
eventType: "created" | "accessed" | "updated" | "superseded";
|
|
82
|
-
timestamp: number;
|
|
83
|
-
metadata?: JsonObject;
|
|
84
|
-
}
|
|
85
|
-
export interface ExperienceMemory extends Memory {
|
|
86
|
-
experienceId: string;
|
|
87
|
-
experienceType: ExperienceType;
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAuB,IAAI,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,M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0 @@
|
|
|
1
|
-
import type { Experience } from "../types";
|
|
2
|
-
export interface DecayConfig {
|
|
3
|
-
halfLife: number;
|
|
4
|
-
minConfidence: number;
|
|
5
|
-
decayStartDelay: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class ConfidenceDecayManager {
|
|
8
|
-
private config;
|
|
9
|
-
constructor(config?: Partial<DecayConfig>);
|
|
10
|
-
/**
|
|
11
|
-
* Calculate the decayed confidence for an experience
|
|
12
|
-
*/
|
|
13
|
-
getDecayedConfidence(experience: Experience): number;
|
|
14
|
-
/**
|
|
15
|
-
* Get experiences that need reinforcement (low confidence due to decay)
|
|
16
|
-
*/
|
|
17
|
-
getExperiencesNeedingReinforcement(experiences: Experience[], threshold?: number): Experience[];
|
|
18
|
-
/**
|
|
19
|
-
* Calculate reinforcement boost when an experience is validated
|
|
20
|
-
*/
|
|
21
|
-
calculateReinforcementBoost(experience: Experience, validationStrength?: number): number;
|
|
22
|
-
/**
|
|
23
|
-
* Adjust decay rate based on experience type and domain
|
|
24
|
-
*/
|
|
25
|
-
getDomainSpecificDecay(experience: Experience): DecayConfig;
|
|
26
|
-
/**
|
|
27
|
-
* Get confidence trend for an experience over time
|
|
28
|
-
*/
|
|
29
|
-
getConfidenceTrend(experience: Experience, points?: number): Array<{
|
|
30
|
-
timestamp: number;
|
|
31
|
-
confidence: number;
|
|
32
|
-
}>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=confidenceDecay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confidenceDecay.d.ts","sourceRoot":"","sources":["../../utils/confidenceDecay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB;AAQD,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAc;gBAEhB,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM;IAI7C;;OAEG;IACH,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;IAoBpD;;OAEG;IACH,kCAAkC,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,SAAS,SAAM,GAAG,UAAU,EAAE;IAO5F;;OAEG;IACH,2BAA2B,CAAC,UAAU,EAAE,UAAU,EAAE,kBAAkB,SAAM,GAAG,MAAM;IAMrF;;OAEG;IACH,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW;IAsC3D;;OAEG;IACH,kBAAkB,CAChB,UAAU,EAAE,UAAU,EACtB,MAAM,SAAK,GACV,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CA0BpD"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Experience } from "../types";
|
|
2
|
-
export interface ExperienceAnalysis {
|
|
3
|
-
isSignificant: boolean;
|
|
4
|
-
learning?: string;
|
|
5
|
-
confidence: number;
|
|
6
|
-
relatedExperiences?: string[];
|
|
7
|
-
actionableInsights?: string[];
|
|
8
|
-
}
|
|
9
|
-
export declare function analyzeExperience(partialExperience: Partial<Experience>, recentExperiences: Experience[]): Promise<ExperienceAnalysis>;
|
|
10
|
-
export declare function detectPatterns(experiences: Experience[]): Promise<Array<{
|
|
11
|
-
description: string;
|
|
12
|
-
frequency: number;
|
|
13
|
-
experiences: string[];
|
|
14
|
-
significance: "low" | "medium" | "high";
|
|
15
|
-
}>>;
|
|
16
|
-
//# sourceMappingURL=experienceAnalyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experienceAnalyzer.d.ts","sourceRoot":"","sources":["../../utils/experienceAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,wBAAsB,iBAAiB,CACrC,iBAAiB,EAAE,OAAO,CAAC,UAAU,CAAC,EACtC,iBAAiB,EAAE,UAAU,EAAE,GAC9B,OAAO,CAAC,kBAAkB,CAAC,CA4D7B;AAiED,wBAAsB,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CACtE,KAAK,CAAC;IACJ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACzC,CAAC,CACH,CAqFA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Experience } from "../types";
|
|
2
|
-
import { ExperienceType, OutcomeType } from "../types";
|
|
3
|
-
export declare function formatExperienceForDisplay(experience: Experience): string;
|
|
4
|
-
export declare function formatExperienceSummary(experience: Experience): string;
|
|
5
|
-
export declare function formatExperienceList(experiences: Experience[]): string;
|
|
6
|
-
export declare function formatPatternSummary(pattern: {
|
|
7
|
-
description: string;
|
|
8
|
-
frequency: number;
|
|
9
|
-
significance: string;
|
|
10
|
-
}): string;
|
|
11
|
-
export declare function groupExperiencesByDomain(experiences: Experience[]): Map<string, Experience[]>;
|
|
12
|
-
export declare function getExperienceStats(experiences: Experience[]): {
|
|
13
|
-
total: number;
|
|
14
|
-
byType: Record<ExperienceType, number>;
|
|
15
|
-
byOutcome: Record<OutcomeType, number>;
|
|
16
|
-
byDomain: Record<string, number>;
|
|
17
|
-
averageConfidence: number;
|
|
18
|
-
averageImportance: number;
|
|
19
|
-
successRate: number;
|
|
20
|
-
};
|
|
21
|
-
export declare function formatExperienceForRAG(experience: Experience): string;
|
|
22
|
-
export declare function extractKeywords(experience: Experience): string[];
|
|
23
|
-
//# sourceMappingURL=experienceFormatter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experienceFormatter.d.ts","sourceRoot":"","sources":["../../utils/experienceFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvD,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAWzE;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAGtE;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAQtE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAST;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAU7F;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB,CA2CA;AAiBD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAwBrE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,EAAE,CA+BhE"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Experience, JsonObject } from "../types";
|
|
2
|
-
export interface ExperienceChain {
|
|
3
|
-
rootExperience: string;
|
|
4
|
-
chain: string[];
|
|
5
|
-
strength: number;
|
|
6
|
-
validated: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface ExperienceRelationship {
|
|
9
|
-
fromId: string;
|
|
10
|
-
toId: string;
|
|
11
|
-
type: "causes" | "contradicts" | "supports" | "supersedes" | "related";
|
|
12
|
-
strength: number;
|
|
13
|
-
metadata?: JsonObject;
|
|
14
|
-
}
|
|
15
|
-
export declare class ExperienceRelationshipManager {
|
|
16
|
-
private relationships;
|
|
17
|
-
addRelationship(relationship: ExperienceRelationship): void;
|
|
18
|
-
findRelationships(experienceId: string, type?: string): ExperienceRelationship[];
|
|
19
|
-
detectCausalChain(experiences: Experience[]): ExperienceChain[];
|
|
20
|
-
private isRelated;
|
|
21
|
-
private contentSimilarity;
|
|
22
|
-
findContradictions(experience: Experience, allExperiences: Experience[]): Experience[];
|
|
23
|
-
getExperienceImpact(experienceId: string, allExperiences: Experience[]): number;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=experienceRelationships.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experienceRelationships.d.ts","sourceRoot":"","sources":["../../utils/experienceRelationships.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,aAAa,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,qBAAa,6BAA6B;IACxC,OAAO,CAAC,aAAa,CAAoD;IAEzE,eAAe,CAAC,YAAY,EAAE,sBAAsB,GAAG,IAAI;IAQ3D,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,sBAAsB,EAAE;IAQhF,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE;IAgD/D,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,iBAAiB;IAWzB,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE;IAyBtF,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,MAAM;CAmBhF"}
|