@elizaos/plugin-memory 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.browser.js +20 -14
- package/dist/browser/index.browser.js.map +4 -4
- package/dist/cjs/index.node.cjs +200 -32
- package/dist/cjs/index.node.js.map +4 -4
- package/dist/evaluators/summarization.d.ts +17 -2
- package/dist/node/index.node.js +206 -34
- package/dist/node/index.node.js.map +4 -4
- package/dist/providers/short-term-memory.d.ts +12 -6
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var BA=Object.defineProperty;var JA=(A,J)=>{for(var Q in J)BA(A,Q,{get:J[Q],enumerable:!0,configurable:!0,set:(K)=>J[Q]=()=>K})};import{Service as jA,logger as H}from"@elizaos/core";import{eq as j,and as T,desc as k,sql as s,cosineDistance as GA,gte as FA}from"drizzle-orm";var w={};JA(w,{sessionSummaries:()=>V,memoryAccessLogs:()=>a,longTermMemories:()=>N});import{sql as d}from"drizzle-orm";import{pgTable as KA,text as x,integer as QA,jsonb as WA,real as g,index as z,varchar as I,timestamp as S}from"drizzle-orm/pg-core";var N=KA("long_term_memories",{id:I("id",{length:36}).primaryKey(),agentId:I("agent_id",{length:36}).notNull(),entityId:I("entity_id",{length:36}).notNull(),category:x("category").notNull(),content:x("content").notNull(),metadata:WA("metadata"),embedding:g("embedding").array(),confidence:g("confidence").default(1),source:x("source"),createdAt:S("created_at").default(d`now()`).notNull(),updatedAt:S("updated_at").default(d`now()`).notNull(),lastAccessedAt:S("last_accessed_at"),accessCount:QA("access_count").default(0)},(A)=>({agentEntityIdx:z("long_term_memories_agent_entity_idx").on(A.agentId,A.entityId),categoryIdx:z("long_term_memories_category_idx").on(A.category),confidenceIdx:z("long_term_memories_confidence_idx").on(A.confidence),createdAtIdx:z("long_term_memories_created_at_idx").on(A.createdAt)}));import{sql as u}from"drizzle-orm";import{pgTable as YA,text as ZA,integer as n,jsonb as i,real as _A,index as M,varchar as f,timestamp as C}from"drizzle-orm/pg-core";var V=YA("session_summaries",{id:f("id",{length:36}).primaryKey(),agentId:f("agent_id",{length:36}).notNull(),roomId:f("room_id",{length:36}).notNull(),entityId:f("entity_id",{length:36}),summary:ZA("summary").notNull(),messageCount:n("message_count").notNull(),lastMessageOffset:n("last_message_offset").notNull().default(0),startTime:C("start_time").notNull(),endTime:C("end_time").notNull(),topics:i("topics"),metadata:i("metadata"),embedding:_A("embedding").array(),createdAt:C("created_at").default(u`now()`).notNull(),updatedAt:C("updated_at").default(u`now()`).notNull()},(A)=>({agentRoomIdx:M("session_summaries_agent_room_idx").on(A.agentId,A.roomId),entityIdx:M("session_summaries_entity_idx").on(A.entityId),startTimeIdx:M("session_summaries_start_time_idx").on(A.startTime)}));import{sql as $A}from"drizzle-orm";import{pgTable as NA,text as UA,integer as VA,real as HA,index as p,varchar as b,timestamp as XA}from"drizzle-orm/pg-core";var a=NA("memory_access_logs",{id:b("id",{length:36}).primaryKey(),agentId:b("agent_id",{length:36}).notNull(),memoryId:b("memory_id",{length:36}).notNull(),memoryType:UA("memory_type").notNull(),accessedAt:XA("accessed_at").default($A`now()`).notNull(),roomId:b("room_id",{length:36}),relevanceScore:HA("relevance_score"),wasUseful:VA("was_useful")},(A)=>({memoryIdx:p("memory_access_logs_memory_idx").on(A.memoryId),agentIdx:p("memory_access_logs_agent_idx").on(A.agentId),accessedAtIdx:p("memory_access_logs_accessed_at_idx").on(A.accessedAt)}));class D extends jA{static serviceType="memory";sessionMessageCounts;memoryConfig;lastExtractionCheckpoints;capabilityDescription="Advanced memory management with short-term summarization and long-term persistent facts";constructor(A){super(A);this.sessionMessageCounts=new Map,this.lastExtractionCheckpoints=new Map,this.memoryConfig={shortTermSummarizationThreshold:5,shortTermRetainRecent:10,longTermExtractionEnabled:!0,longTermVectorSearchEnabled:!1,longTermConfidenceThreshold:0.7,longTermExtractionInterval:5,summaryModelType:"TEXT_LARGE",summaryMaxTokens:2500}}static async start(A){let J=new D(A);return await J.initialize(A),J}async stop(){H.info("MemoryService stopped")}async initialize(A){this.runtime=A;let J=A.getSetting("MEMORY_SUMMARIZATION_THRESHOLD");if(J)this.memoryConfig.shortTermSummarizationThreshold=parseInt(J,10);let Q=A.getSetting("MEMORY_RETAIN_RECENT");if(Q)this.memoryConfig.shortTermRetainRecent=parseInt(Q,10);let K=A.getSetting("MEMORY_LONG_TERM_ENABLED");if(K==="false")this.memoryConfig.longTermExtractionEnabled=!1;else if(K==="true")this.memoryConfig.longTermExtractionEnabled=!0;let B=A.getSetting("MEMORY_CONFIDENCE_THRESHOLD");if(B)this.memoryConfig.longTermConfidenceThreshold=parseFloat(B);H.info({summarizationThreshold:this.memoryConfig.shortTermSummarizationThreshold,retainRecent:this.memoryConfig.shortTermRetainRecent,longTermEnabled:this.memoryConfig.longTermExtractionEnabled,extractionInterval:this.memoryConfig.longTermExtractionInterval,confidenceThreshold:this.memoryConfig.longTermConfidenceThreshold},"MemoryService initialized")}getDb(){let A=this.runtime.db;if(!A)throw Error("Database not available");return A}getConfig(){return{...this.memoryConfig}}updateConfig(A){this.memoryConfig={...this.memoryConfig,...A}}incrementMessageCount(A){let Q=(this.sessionMessageCounts.get(A)||0)+1;return this.sessionMessageCounts.set(A,Q),Q}resetMessageCount(A){this.sessionMessageCounts.set(A,0)}async shouldSummarize(A){return await this.runtime.countMemories(A,!1,"messages")>=this.memoryConfig.shortTermSummarizationThreshold}getExtractionKey(A,J){return`memory:extraction:${A}:${J}`}async getLastExtractionCheckpoint(A,J){let Q=this.getExtractionKey(A,J),K=this.lastExtractionCheckpoints.get(Q);if(K!==void 0)return K;try{let W=await this.runtime.getCache(Q)??0;return this.lastExtractionCheckpoints.set(Q,W),W}catch(B){return H.warn({error:B},"Failed to get extraction checkpoint from cache"),0}}async setLastExtractionCheckpoint(A,J,Q){let K=this.getExtractionKey(A,J);this.lastExtractionCheckpoints.set(K,Q);try{await this.runtime.setCache(K,Q),H.debug(`Set extraction checkpoint for ${A} in room ${J} at message count ${Q}`)}catch(B){H.error({error:B},"Failed to persist extraction checkpoint to cache")}}async shouldRunExtraction(A,J,Q){let K=this.memoryConfig.longTermExtractionInterval,B=await this.getLastExtractionCheckpoint(A,J),W=Math.floor(Q/K)*K,Z=Q>=K&&W>B;return H.debug({entityId:A,roomId:J,currentMessageCount:Q,interval:K,lastCheckpoint:B,currentCheckpoint:W,shouldRun:Z},"Extraction check"),Z}async storeLongTermMemory(A){let J=this.getDb(),Q=crypto.randomUUID(),K=new Date,B={id:Q,createdAt:K,updatedAt:K,accessCount:0,...A};try{await J.insert(N).values({id:B.id,agentId:B.agentId,entityId:B.entityId,category:B.category,content:B.content,metadata:B.metadata||{},embedding:B.embedding,confidence:B.confidence,source:B.source,accessCount:B.accessCount,createdAt:K,updatedAt:K,lastAccessedAt:B.lastAccessedAt})}catch(W){throw H.error({error:W},"Failed to store long-term memory"),W}return H.info(`Stored long-term memory: ${B.category} for entity ${B.entityId}`),B}async getLongTermMemories(A,J,Q=10){let K=this.getDb(),B=[j(N.agentId,this.runtime.agentId),j(N.entityId,A)];if(J)B.push(j(N.category,J));return(await K.select().from(N).where(T(...B)).orderBy(k(N.confidence),k(N.updatedAt)).limit(Q)).map((Z)=>({id:Z.id,agentId:Z.agentId,entityId:Z.entityId,category:Z.category,content:Z.content,metadata:Z.metadata,embedding:Z.embedding,confidence:Z.confidence,source:Z.source,createdAt:Z.createdAt,updatedAt:Z.updatedAt,lastAccessedAt:Z.lastAccessedAt,accessCount:Z.accessCount}))}async updateLongTermMemory(A,J){let Q=this.getDb(),K={updatedAt:new Date};if(J.content!==void 0)K.content=J.content;if(J.metadata!==void 0)K.metadata=J.metadata;if(J.confidence!==void 0)K.confidence=J.confidence;if(J.embedding!==void 0)K.embedding=J.embedding;if(J.lastAccessedAt!==void 0)K.lastAccessedAt=J.lastAccessedAt;if(J.accessCount!==void 0)K.accessCount=J.accessCount;await Q.update(N).set(K).where(j(N.id,A)),H.info(`Updated long-term memory: ${A}`)}async deleteLongTermMemory(A){await this.getDb().delete(N).where(j(N.id,A)),H.info(`Deleted long-term memory: ${A}`)}async getCurrentSessionSummary(A){let Q=await this.getDb().select().from(V).where(T(j(V.agentId,this.runtime.agentId),j(V.roomId,A))).orderBy(k(V.updatedAt)).limit(1);if(Q.length===0)return null;let K=Q[0];return{id:K.id,agentId:K.agentId,roomId:K.roomId,entityId:K.entityId,summary:K.summary,messageCount:K.messageCount,lastMessageOffset:K.lastMessageOffset,startTime:K.startTime,endTime:K.endTime,topics:K.topics||[],metadata:K.metadata,embedding:K.embedding,createdAt:K.createdAt,updatedAt:K.updatedAt}}async storeSessionSummary(A){let J=this.getDb(),Q=crypto.randomUUID(),K=new Date,B={id:Q,createdAt:K,updatedAt:K,...A};return await J.insert(V).values({id:B.id,agentId:B.agentId,roomId:B.roomId,entityId:B.entityId||null,summary:B.summary,messageCount:B.messageCount,lastMessageOffset:B.lastMessageOffset,startTime:B.startTime,endTime:B.endTime,topics:B.topics||[],metadata:B.metadata||{},embedding:B.embedding,createdAt:K,updatedAt:K}),H.info(`Stored session summary for room ${B.roomId}`),B}async updateSessionSummary(A,J){let Q=this.getDb(),K={updatedAt:new Date};if(J.summary!==void 0)K.summary=J.summary;if(J.messageCount!==void 0)K.messageCount=J.messageCount;if(J.lastMessageOffset!==void 0)K.lastMessageOffset=J.lastMessageOffset;if(J.endTime!==void 0)K.endTime=J.endTime;if(J.topics!==void 0)K.topics=J.topics;if(J.metadata!==void 0)K.metadata=J.metadata;if(J.embedding!==void 0)K.embedding=J.embedding;await Q.update(V).set(K).where(j(V.id,A)),H.info(`Updated session summary: ${A}`)}async getSessionSummaries(A,J=5){return(await this.getDb().select().from(V).where(T(j(V.agentId,this.runtime.agentId),j(V.roomId,A))).orderBy(k(V.updatedAt)).limit(J)).map((B)=>({id:B.id,agentId:B.agentId,roomId:B.roomId,entityId:B.entityId,summary:B.summary,messageCount:B.messageCount,lastMessageOffset:B.lastMessageOffset,startTime:B.startTime,endTime:B.endTime,topics:B.topics||[],metadata:B.metadata,embedding:B.embedding,createdAt:B.createdAt,updatedAt:B.updatedAt}))}async searchLongTermMemories(A,J,Q=5,K=0.7){if(!this.memoryConfig.longTermVectorSearchEnabled)return H.warn("Vector search is not enabled, falling back to recent memories"),this.getLongTermMemories(A,void 0,Q);let B=this.getDb();try{let W=J.map((Y)=>Number.isFinite(Y)?Number(Y.toFixed(6)):0),Z=s`1 - (${GA(N.embedding,W)})`,U=[j(N.agentId,this.runtime.agentId),j(N.entityId,A),s`${N.embedding} IS NOT NULL`];if(K>0)U.push(FA(Z,K));return(await B.select({memory:N,similarity:Z}).from(N).where(T(...U)).orderBy(k(Z)).limit(Q)).map((Y)=>({id:Y.memory.id,agentId:Y.memory.agentId,entityId:Y.memory.entityId,category:Y.memory.category,content:Y.memory.content,metadata:Y.memory.metadata,embedding:Y.memory.embedding,confidence:Y.memory.confidence,source:Y.memory.source,createdAt:Y.memory.createdAt,updatedAt:Y.memory.updatedAt,lastAccessedAt:Y.memory.lastAccessedAt,accessCount:Y.memory.accessCount,similarity:Y.similarity}))}catch(W){return H.warn({error:W},"Vector search failed, falling back to recent memories"),this.getLongTermMemories(A,void 0,Q)}}async getFormattedLongTermMemories(A){let J=await this.getLongTermMemories(A,void 0,20);if(J.length===0)return"";let Q=new Map;for(let B of J){if(!Q.has(B.category))Q.set(B.category,[]);Q.get(B.category)?.push(B)}let K=[];for(let[B,W]of Q.entries()){let Z=B.split("_").map(($)=>$.charAt(0).toUpperCase()+$.slice(1)).join(" "),U=W.map(($)=>`- ${$.content}`).join(`
|
|
2
|
-
`);
|
|
3
|
-
${U}`)}return
|
|
1
|
+
var zJ=Object.defineProperty;var DJ=(J,Q)=>{for(var Y in Q)zJ(J,Y,{get:Q[Y],enumerable:!0,configurable:!0,set:(W)=>Q[Y]=()=>W})};import{Service as MJ,logger as L}from"@elizaos/core";import{eq as D,and as g,desc as p,sql as GJ,cosineDistance as yJ,gte as lJ}from"drizzle-orm";var r={};DJ(r,{sessionSummaries:()=>k,memoryAccessLogs:()=>VJ,longTermMemories:()=>G});import{sql as ZJ}from"drizzle-orm";import{pgTable as RJ,text as a,integer as bJ,jsonb as CJ,real as _J,index as l,varchar as o,timestamp as m}from"drizzle-orm/pg-core";var G=RJ("long_term_memories",{id:o("id",{length:36}).primaryKey(),agentId:o("agent_id",{length:36}).notNull(),entityId:o("entity_id",{length:36}).notNull(),category:a("category").notNull(),content:a("content").notNull(),metadata:CJ("metadata"),embedding:_J("embedding").array(),confidence:_J("confidence").default(1),source:a("source"),createdAt:m("created_at").default(ZJ`now()`).notNull(),updatedAt:m("updated_at").default(ZJ`now()`).notNull(),lastAccessedAt:m("last_accessed_at"),accessCount:bJ("access_count").default(0)},(J)=>({agentEntityIdx:l("long_term_memories_agent_entity_idx").on(J.agentId,J.entityId),categoryIdx:l("long_term_memories_category_idx").on(J.category),confidenceIdx:l("long_term_memories_confidence_idx").on(J.confidence),createdAtIdx:l("long_term_memories_created_at_idx").on(J.createdAt)}));import{sql as $J}from"drizzle-orm";import{pgTable as fJ,text as hJ,integer as AJ,jsonb as UJ,real as vJ,index as s,varchar as c,timestamp as d}from"drizzle-orm/pg-core";var k=fJ("session_summaries",{id:c("id",{length:36}).primaryKey(),agentId:c("agent_id",{length:36}).notNull(),roomId:c("room_id",{length:36}).notNull(),entityId:c("entity_id",{length:36}),summary:hJ("summary").notNull(),messageCount:AJ("message_count").notNull(),lastMessageOffset:AJ("last_message_offset").notNull().default(0),startTime:d("start_time").notNull(),endTime:d("end_time").notNull(),topics:UJ("topics"),metadata:UJ("metadata"),embedding:vJ("embedding").array(),createdAt:d("created_at").default($J`now()`).notNull(),updatedAt:d("updated_at").default($J`now()`).notNull()},(J)=>({agentRoomIdx:s("session_summaries_agent_room_idx").on(J.agentId,J.roomId),entityIdx:s("session_summaries_entity_idx").on(J.entityId),startTimeIdx:s("session_summaries_start_time_idx").on(J.startTime)}));import{sql as TJ}from"drizzle-orm";import{pgTable as IJ,text as xJ,integer as SJ,real as pJ,index as t,varchar as u,timestamp as wJ}from"drizzle-orm/pg-core";var VJ=IJ("memory_access_logs",{id:u("id",{length:36}).primaryKey(),agentId:u("agent_id",{length:36}).notNull(),memoryId:u("memory_id",{length:36}).notNull(),memoryType:xJ("memory_type").notNull(),accessedAt:wJ("accessed_at").default(TJ`now()`).notNull(),roomId:u("room_id",{length:36}),relevanceScore:pJ("relevance_score"),wasUseful:SJ("was_useful")},(J)=>({memoryIdx:t("memory_access_logs_memory_idx").on(J.memoryId),agentIdx:t("memory_access_logs_agent_idx").on(J.agentId),accessedAtIdx:t("memory_access_logs_accessed_at_idx").on(J.accessedAt)}));class w extends MJ{static serviceType="memory";sessionMessageCounts;memoryConfig;lastExtractionCheckpoints;capabilityDescription="Advanced memory management with short-term summarization and long-term persistent facts";constructor(J){super(J);this.sessionMessageCounts=new Map,this.lastExtractionCheckpoints=new Map,this.memoryConfig={shortTermSummarizationThreshold:5,shortTermRetainRecent:10,longTermExtractionEnabled:!0,longTermVectorSearchEnabled:!1,longTermConfidenceThreshold:0.7,longTermExtractionInterval:5,summaryModelType:"TEXT_LARGE",summaryMaxTokens:2500}}static async start(J){let Q=new w(J);return await Q.initialize(J),Q}async stop(){L.info("MemoryService stopped")}async initialize(J){this.runtime=J;let Q=J.getSetting("MEMORY_SUMMARIZATION_THRESHOLD");if(Q)this.memoryConfig.shortTermSummarizationThreshold=parseInt(Q,10);let Y=J.getSetting("MEMORY_RETAIN_RECENT");if(Y)this.memoryConfig.shortTermRetainRecent=parseInt(Y,10);let W=J.getSetting("MEMORY_LONG_TERM_ENABLED");if(W==="false")this.memoryConfig.longTermExtractionEnabled=!1;else if(W==="true")this.memoryConfig.longTermExtractionEnabled=!0;let K=J.getSetting("MEMORY_CONFIDENCE_THRESHOLD");if(K)this.memoryConfig.longTermConfidenceThreshold=parseFloat(K);L.info({summarizationThreshold:this.memoryConfig.shortTermSummarizationThreshold,retainRecent:this.memoryConfig.shortTermRetainRecent,longTermEnabled:this.memoryConfig.longTermExtractionEnabled,extractionInterval:this.memoryConfig.longTermExtractionInterval,confidenceThreshold:this.memoryConfig.longTermConfidenceThreshold},"MemoryService initialized")}getDb(){let J=this.runtime.db;if(!J)throw Error("Database not available");return J}getConfig(){return{...this.memoryConfig}}updateConfig(J){this.memoryConfig={...this.memoryConfig,...J}}incrementMessageCount(J){let Y=(this.sessionMessageCounts.get(J)||0)+1;return this.sessionMessageCounts.set(J,Y),Y}resetMessageCount(J){this.sessionMessageCounts.set(J,0)}async shouldSummarize(J){return await this.runtime.countMemories(J,!1,"messages")>=this.memoryConfig.shortTermSummarizationThreshold}getExtractionKey(J,Q){return`memory:extraction:${J}:${Q}`}async getLastExtractionCheckpoint(J,Q){let Y=this.getExtractionKey(J,Q),W=this.lastExtractionCheckpoints.get(Y);if(W!==void 0)return W;try{let Z=await this.runtime.getCache(Y)??0;return this.lastExtractionCheckpoints.set(Y,Z),Z}catch(K){return L.warn({error:K},"Failed to get extraction checkpoint from cache"),0}}async setLastExtractionCheckpoint(J,Q,Y){let W=this.getExtractionKey(J,Q);this.lastExtractionCheckpoints.set(W,Y);try{await this.runtime.setCache(W,Y),L.debug(`Set extraction checkpoint for ${J} in room ${Q} at message count ${Y}`)}catch(K){L.error({error:K},"Failed to persist extraction checkpoint to cache")}}async shouldRunExtraction(J,Q,Y){let W=this.memoryConfig.longTermExtractionInterval,K=await this.getLastExtractionCheckpoint(J,Q),Z=Math.floor(Y/W)*W,$=Y>=W&&Z>K;return L.debug({entityId:J,roomId:Q,currentMessageCount:Y,interval:W,lastCheckpoint:K,currentCheckpoint:Z,shouldRun:$},"Extraction check"),$}async storeLongTermMemory(J){let Q=this.getDb(),Y=crypto.randomUUID(),W=new Date,K={id:Y,createdAt:W,updatedAt:W,accessCount:0,...J};try{await Q.insert(G).values({id:K.id,agentId:K.agentId,entityId:K.entityId,category:K.category,content:K.content,metadata:K.metadata||{},embedding:K.embedding,confidence:K.confidence,source:K.source,accessCount:K.accessCount,createdAt:W,updatedAt:W,lastAccessedAt:K.lastAccessedAt})}catch(Z){throw L.error({error:Z},"Failed to store long-term memory"),Z}return L.info(`Stored long-term memory: ${K.category} for entity ${K.entityId}`),K}async getLongTermMemories(J,Q,Y=10){let W=this.getDb(),K=[D(G.agentId,this.runtime.agentId),D(G.entityId,J)];if(Q)K.push(D(G.category,Q));return(await W.select().from(G).where(g(...K)).orderBy(p(G.confidence),p(G.updatedAt)).limit(Y)).map(($)=>({id:$.id,agentId:$.agentId,entityId:$.entityId,category:$.category,content:$.content,metadata:$.metadata,embedding:$.embedding,confidence:$.confidence,source:$.source,createdAt:$.createdAt,updatedAt:$.updatedAt,lastAccessedAt:$.lastAccessedAt,accessCount:$.accessCount}))}async updateLongTermMemory(J,Q){let Y=this.getDb(),W={updatedAt:new Date};if(Q.content!==void 0)W.content=Q.content;if(Q.metadata!==void 0)W.metadata=Q.metadata;if(Q.confidence!==void 0)W.confidence=Q.confidence;if(Q.embedding!==void 0)W.embedding=Q.embedding;if(Q.lastAccessedAt!==void 0)W.lastAccessedAt=Q.lastAccessedAt;if(Q.accessCount!==void 0)W.accessCount=Q.accessCount;await Y.update(G).set(W).where(D(G.id,J)),L.info(`Updated long-term memory: ${J}`)}async deleteLongTermMemory(J){await this.getDb().delete(G).where(D(G.id,J)),L.info(`Deleted long-term memory: ${J}`)}async getCurrentSessionSummary(J){let Y=await this.getDb().select().from(k).where(g(D(k.agentId,this.runtime.agentId),D(k.roomId,J))).orderBy(p(k.updatedAt)).limit(1);if(Y.length===0)return null;let W=Y[0];return{id:W.id,agentId:W.agentId,roomId:W.roomId,entityId:W.entityId,summary:W.summary,messageCount:W.messageCount,lastMessageOffset:W.lastMessageOffset,startTime:W.startTime,endTime:W.endTime,topics:W.topics||[],metadata:W.metadata,embedding:W.embedding,createdAt:W.createdAt,updatedAt:W.updatedAt}}async storeSessionSummary(J){let Q=this.getDb(),Y=crypto.randomUUID(),W=new Date,K={id:Y,createdAt:W,updatedAt:W,...J};return await Q.insert(k).values({id:K.id,agentId:K.agentId,roomId:K.roomId,entityId:K.entityId||null,summary:K.summary,messageCount:K.messageCount,lastMessageOffset:K.lastMessageOffset,startTime:K.startTime,endTime:K.endTime,topics:K.topics||[],metadata:K.metadata||{},embedding:K.embedding,createdAt:W,updatedAt:W}),L.info(`Stored session summary for room ${K.roomId}`),K}async updateSessionSummary(J,Q){let Y=this.getDb(),W={updatedAt:new Date};if(Q.summary!==void 0)W.summary=Q.summary;if(Q.messageCount!==void 0)W.messageCount=Q.messageCount;if(Q.lastMessageOffset!==void 0)W.lastMessageOffset=Q.lastMessageOffset;if(Q.endTime!==void 0)W.endTime=Q.endTime;if(Q.topics!==void 0)W.topics=Q.topics;if(Q.metadata!==void 0)W.metadata=Q.metadata;if(Q.embedding!==void 0)W.embedding=Q.embedding;await Y.update(k).set(W).where(D(k.id,J)),L.info(`Updated session summary: ${J}`)}async getSessionSummaries(J,Q=5){return(await this.getDb().select().from(k).where(g(D(k.agentId,this.runtime.agentId),D(k.roomId,J))).orderBy(p(k.updatedAt)).limit(Q)).map((K)=>({id:K.id,agentId:K.agentId,roomId:K.roomId,entityId:K.entityId,summary:K.summary,messageCount:K.messageCount,lastMessageOffset:K.lastMessageOffset,startTime:K.startTime,endTime:K.endTime,topics:K.topics||[],metadata:K.metadata,embedding:K.embedding,createdAt:K.createdAt,updatedAt:K.updatedAt}))}async searchLongTermMemories(J,Q,Y=5,W=0.7){if(!this.memoryConfig.longTermVectorSearchEnabled)return L.warn("Vector search is not enabled, falling back to recent memories"),this.getLongTermMemories(J,void 0,Y);let K=this.getDb();try{let Z=Q.map((_)=>Number.isFinite(_)?Number(_.toFixed(6)):0),$=GJ`1 - (${yJ(G.embedding,Z)})`,U=[D(G.agentId,this.runtime.agentId),D(G.entityId,J),GJ`${G.embedding} IS NOT NULL`];if(W>0)U.push(lJ($,W));return(await K.select({memory:G,similarity:$}).from(G).where(g(...U)).orderBy(p($)).limit(Y)).map((_)=>({id:_.memory.id,agentId:_.memory.agentId,entityId:_.memory.entityId,category:_.memory.category,content:_.memory.content,metadata:_.memory.metadata,embedding:_.memory.embedding,confidence:_.memory.confidence,source:_.memory.source,createdAt:_.memory.createdAt,updatedAt:_.memory.updatedAt,lastAccessedAt:_.memory.lastAccessedAt,accessCount:_.memory.accessCount,similarity:_.similarity}))}catch(Z){return L.warn({error:Z},"Vector search failed, falling back to recent memories"),this.getLongTermMemories(J,void 0,Y)}}async getFormattedLongTermMemories(J){let Q=await this.getLongTermMemories(J,void 0,20);if(Q.length===0)return"";let Y=new Map;for(let K of Q){if(!Y.has(K.category))Y.set(K.category,[]);Y.get(K.category)?.push(K)}let W=[];for(let[K,Z]of Y.entries()){let $=K.split("_").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(" "),U=Z.map((V)=>`- ${V.content}`).join(`
|
|
2
|
+
`);W.push(`**${$}**:
|
|
3
|
+
${U}`)}return W.join(`
|
|
4
4
|
|
|
5
|
-
`)}}import{logger as
|
|
5
|
+
`)}}import{logger as R,ModelType as cJ,composePromptFromState as XJ}from"@elizaos/core";var dJ=`# Task: Summarize Conversation
|
|
6
6
|
|
|
7
7
|
You are analyzing a conversation to create a concise summary that captures the key points, topics, and important details.
|
|
8
8
|
|
|
@@ -31,7 +31,7 @@ Respond in this XML format:
|
|
|
31
31
|
<point>First key point</point>
|
|
32
32
|
<point>Second key point</point>
|
|
33
33
|
</keyPoints>
|
|
34
|
-
</summary>`,
|
|
34
|
+
</summary>`,uJ=`# Task: Update and Condense Conversation Summary
|
|
35
35
|
|
|
36
36
|
You are updating an existing conversation summary with new messages, while keeping the total summary concise.
|
|
37
37
|
|
|
@@ -62,8 +62,8 @@ Respond in this XML format:
|
|
|
62
62
|
<point>First key point</point>
|
|
63
63
|
<point>Second key point</point>
|
|
64
64
|
</keyPoints>
|
|
65
|
-
</summary>`;function
|
|
66
|
-
`),
|
|
65
|
+
</summary>`;function gJ(J){let Q=J.match(/<text>([\s\S]*?)<\/text>/),Y=J.match(/<topics>([\s\S]*?)<\/topics>/),W=J.matchAll(/<point>([\s\S]*?)<\/point>/g),K=Q?Q[1].trim():"Summary not available",Z=Y?Y[1].split(",").map((U)=>U.trim()).filter(Boolean):[],$=Array.from(W).map((U)=>U[1].trim());return{summary:K,topics:Z,keyPoints:$}}var jJ={name:"MEMORY_SUMMARIZATION",description:"Automatically summarizes conversations to optimize context usage",similes:["CONVERSATION_SUMMARY","CONTEXT_COMPRESSION","MEMORY_OPTIMIZATION"],alwaysRun:!0,validate:async(J,Q)=>{if(!Q.content?.text)return R.debug("Skipping summarization: no message text"),!1;let Y=J.getService("memory");if(!Y)return R.debug("Skipping summarization: memory service not available"),!1;let W=Y.getConfig(),K=await J.countMemories(Q.roomId,!1,"messages"),Z=K>=W.shortTermSummarizationThreshold;return R.debug({roomId:Q.roomId,currentMessageCount:K,threshold:W.shortTermSummarizationThreshold,shouldSummarize:Z},"Summarization validation check"),Z},handler:async(J,Q)=>{let Y=J.getService("memory");if(!Y){R.error("MemoryService not found");return}let W=Y.getConfig(),{roomId:K}=Q;try{R.info(`Starting summarization for room ${K}`);let Z=await Y.getCurrentSessionSummary(K),$=Z?.lastMessageOffset||0,U=await J.countMemories(K,!1,"messages"),V=await J.getMemories({tableName:"messages",roomId:K,count:W.shortTermSummarizationThreshold,unique:!1,start:$});if(V.length===0){R.debug("No new messages to summarize");return}let _=V.sort((b,z)=>(b.createdAt||0)-(z.createdAt||0)),j=_.map((b)=>{return`${b.entityId===J.agentId?J.character.name:"User"}: ${b.content.text||"[non-text message]"}`}).join(`
|
|
66
|
+
`),B=await J.composeState(Q),F,X;if(Z)X=uJ,F=XJ({state:{...B,existingSummary:Z.summary,existingTopics:Z.topics?.join(", ")||"None",newMessages:j},template:X});else X=dJ,F=XJ({state:{...B,recentMessages:j},template:X});let O=await J.useModel(cJ.TEXT_LARGE,{prompt:F,maxTokens:W.summaryMaxTokens||2500}),A=gJ(O);R.info(`${Z?"Updated":"Generated"} summary: ${A.summary.substring(0,100)}...`);let N=U,q=_[0],E=_[_.length-1],T=Z?Z.startTime:q?.createdAt&&q.createdAt>0?new Date(q.createdAt):new Date,I=E?.createdAt&&E.createdAt>0?new Date(E.createdAt):new Date;if(Z)await Y.updateSessionSummary(Z.id,{summary:A.summary,messageCount:Z.messageCount+_.length,lastMessageOffset:N,endTime:I,topics:A.topics,metadata:{keyPoints:A.keyPoints}}),R.info(`Updated summary for room ${K}: ${_.length} new messages processed (offset: ${$} → ${N})`);else await Y.storeSessionSummary({agentId:J.agentId,roomId:K,entityId:Q.entityId!==J.agentId?Q.entityId:void 0,summary:A.summary,messageCount:_.length,lastMessageOffset:N,startTime:T,endTime:I,topics:A.topics,metadata:{keyPoints:A.keyPoints}}),R.info(`Created new summary for room ${K}: ${_.length} messages summarized (offset: 0 → ${N})`)}catch(Z){R.error({error:Z},"Error during summarization:")}},examples:[]};import{logger as P,ModelType as iJ,composePromptFromState as nJ}from"@elizaos/core";var e;((_)=>{_.IDENTITY="identity";_.EXPERTISE="expertise";_.PROJECTS="projects";_.PREFERENCES="preferences";_.DATA_SOURCES="data_sources";_.GOALS="goals";_.CONSTRAINTS="constraints";_.DEFINITIONS="definitions";_.BEHAVIORAL_PATTERNS="behavioral_patterns"})(e||={});var aJ=`# Task: Extract Long-Term Memory
|
|
67
67
|
|
|
68
68
|
You are analyzing a conversation to extract facts that should be remembered long-term about the user.
|
|
69
69
|
|
|
@@ -105,12 +105,18 @@ Respond in this XML format:
|
|
|
105
105
|
<content>Prefers code examples over lengthy explanations</content>
|
|
106
106
|
<confidence>0.85</confidence>
|
|
107
107
|
</memory>
|
|
108
|
-
</memories>`;function
|
|
109
|
-
`)
|
|
110
|
-
`):"None yet",
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
</memories>`;function oJ(J){let Q=J.matchAll(/<memory>[\s\S]*?<category>(.*?)<\/category>[\s\S]*?<content>(.*?)<\/content>[\s\S]*?<confidence>(.*?)<\/confidence>[\s\S]*?<\/memory>/g),Y=[];for(let W of Q){let K=W[1].trim(),Z=W[2].trim(),$=parseFloat(W[3].trim());if(!Object.values(e).includes(K)){P.warn(`Invalid memory category: ${K}`);continue}if(Z&&!isNaN($))Y.push({category:K,content:Z,confidence:$})}return Y}var BJ={name:"LONG_TERM_MEMORY_EXTRACTION",description:"Extracts long-term facts about users from conversations",similes:["MEMORY_EXTRACTION","FACT_LEARNING","USER_PROFILING"],alwaysRun:!0,validate:async(J,Q)=>{if(P.debug(`Validating long-term memory extraction for message: ${Q.content?.text}`),Q.entityId===J.agentId)return P.debug("Skipping long-term memory extraction for agent's own message"),!1;if(!Q.content?.text)return P.debug("Skipping long-term memory extraction for message without text"),!1;let Y=J.getService("memory");if(!Y)return P.debug("MemoryService not found"),!1;if(!Y.getConfig().longTermExtractionEnabled)return P.debug("Long-term memory extraction is disabled"),!1;let K=await J.countMemories(Q.roomId,!1,"messages"),Z=await Y.shouldRunExtraction(Q.entityId,Q.roomId,K);return P.debug(`Should run extraction: ${Z}`),Z},handler:async(J,Q)=>{let Y=J.getService("memory");if(!Y){P.error("MemoryService not found");return}let W=Y.getConfig(),{entityId:K,roomId:Z}=Q;try{P.info(`Extracting long-term memories for entity ${K}`);let U=(await J.getMemories({tableName:"messages",roomId:Z,count:20,unique:!1})).sort((A,N)=>(A.createdAt||0)-(N.createdAt||0)).map((A)=>{return`${A.entityId===J.agentId?J.character.name:"User"}: ${A.content.text||"[non-text message]"}`}).join(`
|
|
109
|
+
`),V=await Y.getLongTermMemories(K,void 0,30),_=V.length>0?V.map((A)=>`[${A.category}] ${A.content} (confidence: ${A.confidence})`).join(`
|
|
110
|
+
`):"None yet",j=await J.composeState(Q),B=nJ({state:{...j,recentMessages:U,existingMemories:_},template:aJ}),F=await J.useModel(iJ.TEXT_LARGE,{prompt:B}),X=oJ(F);P.info(`Extracted ${X.length} long-term memories`);for(let A of X)if(A.confidence>=W.longTermConfidenceThreshold)await Y.storeLongTermMemory({agentId:J.agentId,entityId:K,category:A.category,content:A.content,confidence:A.confidence,source:"conversation",metadata:{roomId:Z,extractedAt:new Date().toISOString()}}),P.info(`Stored long-term memory: [${A.category}] ${A.content.substring(0,50)}...`);else P.debug(`Skipped low-confidence memory: ${A.content} (confidence: ${A.confidence})`);let O=await J.countMemories(Z,!1,"messages");await Y.setLastExtractionCheckpoint(K,Z,O),P.debug(`Updated extraction checkpoint to ${O} for entity ${K} in room ${Z}`)}catch($){P.error({error:$},"Error during long-term memory extraction:")}},examples:[]};import{addHeader as C,ChannelType as i,formatMessages as JJ,formatPosts as OJ,getEntityDetails as FJ,logger as mJ}from"@elizaos/core";var NJ={name:"SHORT_TERM_MEMORY",description:"Adaptive conversation context with smart summarization",position:95,get:async(J,Q,Y)=>{try{let W=J.getService("memory");if(!W)return{data:{summaries:[],recentMessages:[],mode:"disabled"},values:{sessionSummaries:"",recentMessages:""},text:""};let{roomId:K}=Q,Z=W.getConfig();if(await J.countMemories(K,!1,"messages")<Z.shortTermSummarizationThreshold){let U=J.getConversationLength(),[V,_,j]=await Promise.all([FJ({runtime:J,roomId:K}),J.getRoom(K),J.getMemories({tableName:"messages",roomId:K,count:U,unique:!1})]),B=j.filter((H)=>H.content?.type==="action_result"&&H.metadata?.type==="action_result"),F=j.filter((H)=>!(H.content?.type==="action_result"&&H.metadata?.type==="action_result")),X=_?.type?_.type===i.FEED||_.type===i.THREAD:!1,[O,A]=await Promise.all([JJ({messages:F,entities:V}),OJ({messages:F,entities:V,conversationHeader:!1})]),N="";if(B.length>0){let H=new Map;for(let x of B){let h=String(x.content?.runId||"unknown");if(!H.has(h))H.set(h,[]);H.get(h)?.push(x)}let S=Array.from(H.entries()).slice(-3).map(([x,h])=>{let KJ=h.sort((v,M)=>(v.createdAt||0)-(M.createdAt||0)),QJ=KJ[0]?.content?.planThought||"",PJ=KJ.map((v)=>{let M=v.content?.actionName||"Unknown",qJ=v.content?.actionStatus||"unknown",WJ=v.content?.planStep||"",n=v.content?.text||"",YJ=v.content?.error||"",y=` - ${M} (${qJ})`;if(WJ)y+=` [${WJ}]`;if(YJ)y+=`: Error - ${YJ}`;else if(n&&n!==`Executed action: ${M}`)y+=`: ${n}`;return y}).join(`
|
|
111
|
+
`);return`**Action Run ${x.slice(0,8)}**${QJ?` - "${QJ}"`:""}
|
|
112
|
+
${PJ}`}).join(`
|
|
113
113
|
|
|
114
|
-
`)
|
|
114
|
+
`);N=S?C("# Recent Action Executions",S):""}let q=A&&A.length>0?C("# Posts in Thread",A):"",E=O&&O.length>0?C("# Conversation Messages",O):"";if(!q&&!E&&F.length===0&&!Q.content.text)return{data:{summaries:[],recentMessages:[],actionResults:[],mode:"full_conversation"},values:{sessionSummaries:"",recentMessages:"",recentActionResults:""},text:"No recent messages available"};let T="No recent message available.";if(F.length>0){let H=[...F].sort((x,h)=>(h.createdAt||0)-(x.createdAt||0))[0],S=JJ({messages:[H],entities:V});if(S)T=S}let I=Q.metadata,b=V.find((H)=>H.id===Q.entityId)?.names[0]||I?.entityName||"Unknown User",z=Q.content.text,f=!!z?.trim(),HJ=f?C("# Received Message",`${b}: ${z}`):"",kJ=f?C("# Focus your response",`You are replying to the above message from **${b}**. Keep your answer relevant to that message. Do not repeat earlier replies unless the sender asks again.`):"",LJ=[X?q:E,N,E||q||Q.content.text?HJ:"",E||q||Q.content.text?kJ:""].filter(Boolean).join(`
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
`);return{data:{summaries:[],recentMessages:F,actionResults:B,mode:"full_conversation"},values:{sessionSummaries:"",recentMessages:X?q:E,recentActionResults:N,recentMessage:T},text:LJ}}else{let U=await W.getCurrentSessionSummary(K),V=U?.lastMessageOffset||0,_=await J.getMemories({tableName:"messages",roomId:K,count:Z.shortTermRetainRecent,unique:!1,start:V}),j=await FJ({runtime:J,roomId:K}),B=await J.getRoom(K),F=B?.type?B.type===i.FEED||B.type===i.THREAD:!1,X="";if(_.length>0){let z=_.filter((f)=>!(f.content?.type==="action_result"&&f.metadata?.type==="action_result"));if(F)X=OJ({messages:z,entities:j,conversationHeader:!1});else X=JJ({messages:z,entities:j});if(X)X=C("# Recent Messages",X)}let O="";if(U){let z=`${U.messageCount} messages`,f=new Date(U.startTime).toLocaleDateString();if(O=`**Previous Conversation** (${z}, ${f})
|
|
117
|
+
`,O+=U.summary,U.topics&&U.topics.length>0)O+=`
|
|
118
|
+
*Topics: ${U.topics.join(", ")}*`;O=C("# Conversation Summary",O)}let A=Q.metadata,N=j.find((z)=>z.id===Q.entityId)?.names[0]||A?.entityName||"Unknown User",q=Q.content.text,E=!!q?.trim(),T=E?C("# Received Message",`${N}: ${q}`):"",I=E?C("# Focus your response",`You are replying to the above message from **${N}**. Keep your answer relevant to that message.`):"",b=[O,X,E?T:"",E?I:""].filter(Boolean).join(`
|
|
119
|
+
|
|
120
|
+
`);return{data:{summaries:U?[U]:[],recentMessages:_,mode:"summarized"},values:{sessionSummaries:O,recentMessages:X},text:b}}}catch(W){return mJ.error({error:W},"Error in shortTermMemoryProvider:"),{data:{summaries:[],recentMessages:[],mode:"error"},values:{sessionSummaries:"",recentMessages:""},text:"Error retrieving conversation context."}}}};import{logger as sJ,addHeader as tJ}from"@elizaos/core";var EJ={name:"LONG_TERM_MEMORY",description:"Persistent facts and preferences about the user",position:50,get:async(J,Q,Y)=>{try{let W=J.getService("memory");if(!W)return{data:{memories:[]},values:{longTermMemories:""},text:""};let{entityId:K}=Q;if(K===J.agentId)return{data:{memories:[]},values:{longTermMemories:""},text:""};let Z=await W.getLongTermMemories(K,void 0,25);if(Z.length===0)return{data:{memories:[]},values:{longTermMemories:""},text:""};let $=await W.getFormattedLongTermMemories(K),U=tJ("# What I Know About You",$),V=new Map;for(let j of Z){let B=V.get(j.category)||0;V.set(j.category,B+1)}let _=Array.from(V.entries()).map(([j,B])=>`${j}: ${B}`).join(", ");return{data:{memories:Z,categoryCounts:Object.fromEntries(V)},values:{longTermMemories:U,memoryCategories:_},text:U}}catch(W){return sJ.error({error:W},"Error in longTermMemoryProvider:"),{data:{memories:[]},values:{longTermMemories:""},text:""}}}};var rJ={name:"memory",description:"Advanced memory management with conversation summarization and long-term persistent memory",services:[w],evaluators:[jJ,BJ],providers:[EJ,NJ],schema:r},eJ=rJ;export{k as sessionSummaries,rJ as memoryPlugin,VJ as memoryAccessLogs,G as longTermMemories,eJ as default,w as MemoryService,e as LongTermMemoryCategory};
|
|
121
|
+
|
|
122
|
+
//# debugId=25F372E27183540F64756E2164756E21
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"import { sql } from 'drizzle-orm';\nimport {\n pgTable,\n text,\n integer,\n jsonb,\n real,\n index,\n varchar,\n timestamp,\n} from 'drizzle-orm/pg-core';\n\n/**\n * Long-term memory storage table\n * Stores persistent facts about users across all conversations\n */\nexport const longTermMemories = pgTable(\n 'long_term_memories',\n {\n id: varchar('id', { length: 36 }).primaryKey(),\n agentId: varchar('agent_id', { length: 36 }).notNull(),\n entityId: varchar('entity_id', { length: 36 }).notNull(),\n category: text('category').notNull(),\n content: text('content').notNull(),\n metadata: jsonb('metadata'),\n embedding: real('embedding').array(),\n confidence: real('confidence').default(1.0),\n source: text('source'),\n createdAt: timestamp('created_at')\n .default(sql`now()`)\n .notNull(),\n updatedAt: timestamp('updated_at')\n .default(sql`now()`)\n .notNull(),\n lastAccessedAt: timestamp('last_accessed_at'),\n accessCount: integer('access_count').default(0),\n },\n (table) => ({\n agentEntityIdx: index('long_term_memories_agent_entity_idx').on(table.agentId, table.entityId),\n categoryIdx: index('long_term_memories_category_idx').on(table.category),\n confidenceIdx: index('long_term_memories_confidence_idx').on(table.confidence),\n createdAtIdx: index('long_term_memories_created_at_idx').on(table.createdAt),\n })\n);\n",
|
|
7
7
|
"import { sql } from 'drizzle-orm';\nimport {\n pgTable,\n text,\n integer,\n jsonb,\n real,\n index,\n varchar,\n timestamp,\n} from 'drizzle-orm/pg-core';\n\n/**\n * Session summaries table\n * Stores condensed summaries of conversation sessions\n */\nexport const sessionSummaries = pgTable(\n 'session_summaries',\n {\n id: varchar('id', { length: 36 }).primaryKey(),\n agentId: varchar('agent_id', { length: 36 }).notNull(),\n roomId: varchar('room_id', { length: 36 }).notNull(),\n entityId: varchar('entity_id', { length: 36 }),\n summary: text('summary').notNull(),\n messageCount: integer('message_count').notNull(),\n lastMessageOffset: integer('last_message_offset').notNull().default(0),\n startTime: timestamp('start_time').notNull(),\n endTime: timestamp('end_time').notNull(),\n topics: jsonb('topics'),\n metadata: jsonb('metadata'),\n embedding: real('embedding').array(),\n createdAt: timestamp('created_at')\n .default(sql`now()`)\n .notNull(),\n updatedAt: timestamp('updated_at')\n .default(sql`now()`)\n .notNull(),\n },\n (table) => ({\n agentRoomIdx: index('session_summaries_agent_room_idx').on(table.agentId, table.roomId),\n entityIdx: index('session_summaries_entity_idx').on(table.entityId),\n startTimeIdx: index('session_summaries_start_time_idx').on(table.startTime),\n })\n);\n",
|
|
8
8
|
"import { sql } from 'drizzle-orm';\nimport { pgTable, text, integer, real, index, varchar, timestamp } from 'drizzle-orm/pg-core';\n\n/**\n * Memory access logs (optional - for tracking and improving memory retrieval)\n */\nexport const memoryAccessLogs = pgTable(\n 'memory_access_logs',\n {\n id: varchar('id', { length: 36 }).primaryKey(),\n agentId: varchar('agent_id', { length: 36 }).notNull(),\n memoryId: varchar('memory_id', { length: 36 }).notNull(),\n memoryType: text('memory_type').notNull(), // 'long_term' or 'session_summary'\n accessedAt: timestamp('accessed_at')\n .default(sql`now()`)\n .notNull(),\n roomId: varchar('room_id', { length: 36 }),\n relevanceScore: real('relevance_score'),\n wasUseful: integer('was_useful'), // 1 = useful, 0 = not useful, null = unknown\n },\n (table) => ({\n memoryIdx: index('memory_access_logs_memory_idx').on(table.memoryId),\n agentIdx: index('memory_access_logs_agent_idx').on(table.agentId),\n accessedAtIdx: index('memory_access_logs_accessed_at_idx').on(table.accessedAt),\n })\n);\n",
|
|
9
|
-
"import {\n type IAgentRuntime,\n type Memory,\n type Evaluator,\n logger,\n ModelType,\n composePromptFromState,\n} from '@elizaos/core';\nimport { MemoryService } from '../services/memory-service';\nimport type { SummaryResult } from '../types/index';\n\n/**\n * Template for generating initial conversation summary\n */\nconst initialSummarizationTemplate = `# Task: Summarize Conversation\n\nYou are analyzing a conversation to create a concise summary that captures the key points, topics, and important details.\n\n# Recent Messages\n{{recentMessages}}\n\n# Instructions\nGenerate a summary that:\n1. Captures the main topics discussed\n2. Highlights key information shared\n3. Notes any decisions made or questions asked\n4. Maintains context for future reference\n5. Is concise but comprehensive\n\n**IMPORTANT**: Keep the summary under 2500 tokens. Be comprehensive but concise.\n\nAlso extract:\n- **Topics**: List of main topics discussed (comma-separated)\n- **Key Points**: Important facts or decisions (bullet points)\n\nRespond in this XML format:\n<summary>\n <text>Your comprehensive summary here</text>\n <topics>topic1, topic2, topic3</topics>\n <keyPoints>\n <point>First key point</point>\n <point>Second key point</point>\n </keyPoints>\n</summary>`;\n\n/**\n * Template for updating/condensing an existing summary\n */\nconst updateSummarizationTemplate = `# Task: Update and Condense Conversation Summary\n\nYou are updating an existing conversation summary with new messages, while keeping the total summary concise.\n\n# Existing Summary\n{{existingSummary}}\n\n# Existing Topics\n{{existingTopics}}\n\n# New Messages Since Last Summary\n{{newMessages}}\n\n# Instructions\nUpdate the summary by:\n1. Merging the existing summary with insights from the new messages\n2. Removing redundant or less important details to stay under the token limit\n3. Keeping the most important context and decisions\n4. Adding new topics if they emerge\n5. **CRITICAL**: Keep the ENTIRE updated summary under 2500 tokens\n\nThe goal is a rolling summary that captures the essence of the conversation without growing indefinitely.\n\nRespond in this XML format:\n<summary>\n <text>Your updated and condensed summary here</text>\n <topics>topic1, topic2, topic3</topics>\n <keyPoints>\n <point>First key point</point>\n <point>Second key point</point>\n </keyPoints>\n</summary>`;\n\n/**\n * Parse XML summary response\n */\nfunction parseSummaryXML(xml: string): SummaryResult {\n const summaryMatch = xml.match(/<text>([\\s\\S]*?)<\\/text>/);\n const topicsMatch = xml.match(/<topics>([\\s\\S]*?)<\\/topics>/);\n const keyPointsMatches = xml.matchAll(/<point>([\\s\\S]*?)<\\/point>/g);\n\n const summary = summaryMatch ? summaryMatch[1].trim() : 'Summary not available';\n const topics = topicsMatch\n ? topicsMatch[1]\n .split(',')\n .map((t) => t.trim())\n .filter(Boolean)\n : [];\n const keyPoints = Array.from(keyPointsMatches).map((match) => match[1].trim());\n\n return { summary, topics, keyPoints };\n}\n\n/**\n * Short-term Memory Summarization Evaluator\n *\n * Monitors conversation length and generates summaries when threshold is reached.\n * Summaries replace older messages to reduce context size while preserving information.\n */\nexport const summarizationEvaluator: Evaluator = {\n name: 'MEMORY_SUMMARIZATION',\n description: 'Summarizes conversations to optimize short-term memory',\n similes: ['CONVERSATION_SUMMARY', 'CONTEXT_COMPRESSION', 'MEMORY_OPTIMIZATION'],\n alwaysRun: true,\n\n validate: async (runtime: IAgentRuntime, message: Memory): Promise<boolean> => {\n logger.debug(`Validating summarization for message: ${message.content?.text}`);\n // Only run after messages (not on agent's own messages during generation)\n if (!message.content?.text) {\n return false;\n }\n\n const memoryService = runtime.getService('memory') as MemoryService | null;\n if (!memoryService) {\n return false;\n }\n\n const config = memoryService.getConfig();\n const currentMessageCount = await runtime.countMemories(message.roomId, false, 'messages');\n const shouldSummarize = currentMessageCount >= config.shortTermSummarizationThreshold;\n\n logger.debug(\n {\n roomId: message.roomId,\n currentMessageCount,\n threshold: config.shortTermSummarizationThreshold,\n shouldSummarize,\n },\n 'Summarization check'\n );\n\n return shouldSummarize;\n },\n\n handler: async (runtime: IAgentRuntime, message: Memory): Promise<void> => {\n const memoryService = runtime.getService('memory') as MemoryService;\n if (!memoryService) {\n logger.error('MemoryService not found');\n return;\n }\n\n const config = memoryService.getConfig();\n const { roomId } = message;\n\n try {\n logger.info(`Starting summarization for room ${roomId}`);\n\n // Get the current summary (if any)\n const existingSummary = await memoryService.getCurrentSessionSummary(roomId);\n const lastOffset = existingSummary?.lastMessageOffset || 0;\n\n // Get total message count\n const totalMessageCount = await runtime.countMemories(roomId, false, 'messages');\n\n // Get new messages since last offset\n const newMessages = await runtime.getMemories({\n tableName: 'messages',\n roomId,\n count: config.shortTermSummarizationThreshold,\n unique: false,\n start: lastOffset,\n });\n\n if (newMessages.length === 0) {\n logger.debug('No new messages to summarize');\n return;\n }\n\n // Sort by timestamp\n const sortedMessages = newMessages.sort((a, b) => (a.createdAt || 0) - (b.createdAt || 0));\n\n // Format messages for summarization\n const formattedMessages = sortedMessages\n .map((msg) => {\n const sender = msg.entityId === runtime.agentId ? runtime.character.name : 'User';\n return `${sender}: ${msg.content.text || '[non-text message]'}`;\n })\n .join('\\n');\n\n // Generate or update summary using LLM\n const state = await runtime.composeState(message);\n let prompt: string;\n let template: string;\n\n if (existingSummary) {\n // Update existing summary\n template = updateSummarizationTemplate;\n prompt = composePromptFromState({\n state: {\n ...state,\n existingSummary: existingSummary.summary,\n existingTopics: existingSummary.topics?.join(', ') || 'None',\n newMessages: formattedMessages,\n },\n template,\n });\n } else {\n // Create initial summary\n template = initialSummarizationTemplate;\n prompt = composePromptFromState({\n state: {\n ...state,\n recentMessages: formattedMessages,\n },\n template,\n });\n }\n\n const response = await runtime.useModel(ModelType.TEXT_LARGE, {\n prompt,\n maxTokens: config.summaryMaxTokens || 2500,\n });\n\n const summaryResult = parseSummaryXML(response);\n\n logger.info(\n `${existingSummary ? 'Updated' : 'Generated'} summary: ${summaryResult.summary.substring(0, 100)}...`\n );\n\n // Calculate new offset (current total)\n const newOffset = totalMessageCount;\n\n // Get timing info\n const firstMessage = sortedMessages[0];\n const lastMessage = sortedMessages[sortedMessages.length - 1];\n\n const startTime = existingSummary\n ? existingSummary.startTime\n : firstMessage?.createdAt && firstMessage.createdAt > 0\n ? new Date(firstMessage.createdAt)\n : new Date();\n const endTime =\n lastMessage?.createdAt && lastMessage.createdAt > 0\n ? new Date(lastMessage.createdAt)\n : new Date();\n\n if (existingSummary) {\n // Update existing summary\n await memoryService.updateSessionSummary(existingSummary.id, {\n summary: summaryResult.summary,\n messageCount: existingSummary.messageCount + sortedMessages.length,\n lastMessageOffset: newOffset,\n endTime,\n topics: summaryResult.topics,\n metadata: {\n keyPoints: summaryResult.keyPoints,\n },\n });\n\n logger.info(\n `Updated summary for room ${roomId}: ${sortedMessages.length} new messages processed (offset: ${lastOffset} → ${newOffset})`\n );\n } else {\n // Create new summary\n await memoryService.storeSessionSummary({\n agentId: runtime.agentId,\n roomId,\n entityId: message.entityId !== runtime.agentId ? message.entityId : undefined,\n summary: summaryResult.summary,\n messageCount: sortedMessages.length,\n lastMessageOffset: newOffset,\n startTime,\n endTime,\n topics: summaryResult.topics,\n metadata: {\n keyPoints: summaryResult.keyPoints,\n },\n });\n\n logger.info(\n `Created new summary for room ${roomId}: ${sortedMessages.length} messages summarized (offset: 0 → ${newOffset})`\n );\n }\n\n // Note: We do NOT delete messages - they stay in the database\n // The offset tracks what's been summarized\n } catch (error) {\n logger.error({ error }, 'Error during summarization:');\n }\n },\n\n examples: [],\n};\n",
|
|
9
|
+
"import {\n type IAgentRuntime,\n type Memory,\n type Evaluator,\n logger,\n ModelType,\n composePromptFromState,\n} from '@elizaos/core';\nimport { MemoryService } from '../services/memory-service';\nimport type { SummaryResult } from '../types/index';\n\n/**\n * Template for generating initial conversation summary\n */\nconst initialSummarizationTemplate = `# Task: Summarize Conversation\n\nYou are analyzing a conversation to create a concise summary that captures the key points, topics, and important details.\n\n# Recent Messages\n{{recentMessages}}\n\n# Instructions\nGenerate a summary that:\n1. Captures the main topics discussed\n2. Highlights key information shared\n3. Notes any decisions made or questions asked\n4. Maintains context for future reference\n5. Is concise but comprehensive\n\n**IMPORTANT**: Keep the summary under 2500 tokens. Be comprehensive but concise.\n\nAlso extract:\n- **Topics**: List of main topics discussed (comma-separated)\n- **Key Points**: Important facts or decisions (bullet points)\n\nRespond in this XML format:\n<summary>\n <text>Your comprehensive summary here</text>\n <topics>topic1, topic2, topic3</topics>\n <keyPoints>\n <point>First key point</point>\n <point>Second key point</point>\n </keyPoints>\n</summary>`;\n\n/**\n * Template for updating/condensing an existing summary\n */\nconst updateSummarizationTemplate = `# Task: Update and Condense Conversation Summary\n\nYou are updating an existing conversation summary with new messages, while keeping the total summary concise.\n\n# Existing Summary\n{{existingSummary}}\n\n# Existing Topics\n{{existingTopics}}\n\n# New Messages Since Last Summary\n{{newMessages}}\n\n# Instructions\nUpdate the summary by:\n1. Merging the existing summary with insights from the new messages\n2. Removing redundant or less important details to stay under the token limit\n3. Keeping the most important context and decisions\n4. Adding new topics if they emerge\n5. **CRITICAL**: Keep the ENTIRE updated summary under 2500 tokens\n\nThe goal is a rolling summary that captures the essence of the conversation without growing indefinitely.\n\nRespond in this XML format:\n<summary>\n <text>Your updated and condensed summary here</text>\n <topics>topic1, topic2, topic3</topics>\n <keyPoints>\n <point>First key point</point>\n <point>Second key point</point>\n </keyPoints>\n</summary>`;\n\n/**\n * Parse XML summary response\n */\nfunction parseSummaryXML(xml: string): SummaryResult {\n const summaryMatch = xml.match(/<text>([\\s\\S]*?)<\\/text>/);\n const topicsMatch = xml.match(/<topics>([\\s\\S]*?)<\\/topics>/);\n const keyPointsMatches = xml.matchAll(/<point>([\\s\\S]*?)<\\/point>/g);\n\n const summary = summaryMatch ? summaryMatch[1].trim() : 'Summary not available';\n const topics = topicsMatch\n ? topicsMatch[1]\n .split(',')\n .map((t) => t.trim())\n .filter(Boolean)\n : [];\n const keyPoints = Array.from(keyPointsMatches).map((match) => match[1].trim());\n\n return { summary, topics, keyPoints };\n}\n\n/**\n * Short-term Memory Summarization Evaluator\n *\n * Automatically generates and updates conversation summaries when conversations\n * exceed the configured threshold (default: 5 messages).\n *\n * BEHAVIOR:\n * - Monitors message count per room\n * - Triggers when count >= threshold\n * - Creates initial summary for first batch of messages\n * - Updates/condenses existing summary as conversation continues\n * - Tracks offset to know which messages have been summarized\n *\n * INTEGRATION:\n * Works with shortTermMemoryProvider which:\n * - Shows full conversation when < threshold (no summarization needed)\n * - Shows summaries + recent messages when >= threshold (optimized context)\n *\n * This creates an adaptive system that starts with full context and seamlessly\n * transitions to summarization as conversations grow.\n */\nexport const summarizationEvaluator: Evaluator = {\n name: 'MEMORY_SUMMARIZATION',\n description: 'Automatically summarizes conversations to optimize context usage',\n similes: ['CONVERSATION_SUMMARY', 'CONTEXT_COMPRESSION', 'MEMORY_OPTIMIZATION'],\n alwaysRun: true,\n\n validate: async (runtime: IAgentRuntime, message: Memory): Promise<boolean> => {\n // Only run after actual messages (not during generation or on empty messages)\n if (!message.content?.text) {\n logger.debug('Skipping summarization: no message text');\n return false;\n }\n\n const memoryService = runtime.getService('memory') as MemoryService | null;\n if (!memoryService) {\n logger.debug('Skipping summarization: memory service not available');\n return false;\n }\n\n const config = memoryService.getConfig();\n const currentMessageCount = await runtime.countMemories(message.roomId, false, 'messages');\n\n // Only summarize when we've reached the threshold\n // Before this, shortTermMemoryProvider shows full conversation\n const shouldSummarize = currentMessageCount >= config.shortTermSummarizationThreshold;\n\n logger.debug(\n {\n roomId: message.roomId,\n currentMessageCount,\n threshold: config.shortTermSummarizationThreshold,\n shouldSummarize,\n },\n 'Summarization validation check'\n );\n\n return shouldSummarize;\n },\n\n handler: async (runtime: IAgentRuntime, message: Memory): Promise<void> => {\n const memoryService = runtime.getService('memory') as MemoryService;\n if (!memoryService) {\n logger.error('MemoryService not found');\n return;\n }\n\n const config = memoryService.getConfig();\n const { roomId } = message;\n\n try {\n logger.info(`Starting summarization for room ${roomId}`);\n\n // Get the current summary (if any)\n const existingSummary = await memoryService.getCurrentSessionSummary(roomId);\n const lastOffset = existingSummary?.lastMessageOffset || 0;\n\n // Get total message count\n const totalMessageCount = await runtime.countMemories(roomId, false, 'messages');\n\n // Get new messages since last offset\n const newMessages = await runtime.getMemories({\n tableName: 'messages',\n roomId,\n count: config.shortTermSummarizationThreshold,\n unique: false,\n start: lastOffset,\n });\n\n if (newMessages.length === 0) {\n logger.debug('No new messages to summarize');\n return;\n }\n\n // Sort by timestamp\n const sortedMessages = newMessages.sort((a, b) => (a.createdAt || 0) - (b.createdAt || 0));\n\n // Format messages for summarization\n const formattedMessages = sortedMessages\n .map((msg) => {\n const sender = msg.entityId === runtime.agentId ? runtime.character.name : 'User';\n return `${sender}: ${msg.content.text || '[non-text message]'}`;\n })\n .join('\\n');\n\n // Generate or update summary using LLM\n const state = await runtime.composeState(message);\n let prompt: string;\n let template: string;\n\n if (existingSummary) {\n // Update existing summary\n template = updateSummarizationTemplate;\n prompt = composePromptFromState({\n state: {\n ...state,\n existingSummary: existingSummary.summary,\n existingTopics: existingSummary.topics?.join(', ') || 'None',\n newMessages: formattedMessages,\n },\n template,\n });\n } else {\n // Create initial summary\n template = initialSummarizationTemplate;\n prompt = composePromptFromState({\n state: {\n ...state,\n recentMessages: formattedMessages,\n },\n template,\n });\n }\n\n const response = await runtime.useModel(ModelType.TEXT_LARGE, {\n prompt,\n maxTokens: config.summaryMaxTokens || 2500,\n });\n\n const summaryResult = parseSummaryXML(response);\n\n logger.info(\n `${existingSummary ? 'Updated' : 'Generated'} summary: ${summaryResult.summary.substring(0, 100)}...`\n );\n\n // Calculate new offset (current total)\n const newOffset = totalMessageCount;\n\n // Get timing info\n const firstMessage = sortedMessages[0];\n const lastMessage = sortedMessages[sortedMessages.length - 1];\n\n const startTime = existingSummary\n ? existingSummary.startTime\n : firstMessage?.createdAt && firstMessage.createdAt > 0\n ? new Date(firstMessage.createdAt)\n : new Date();\n const endTime =\n lastMessage?.createdAt && lastMessage.createdAt > 0\n ? new Date(lastMessage.createdAt)\n : new Date();\n\n if (existingSummary) {\n // Update existing summary\n await memoryService.updateSessionSummary(existingSummary.id, {\n summary: summaryResult.summary,\n messageCount: existingSummary.messageCount + sortedMessages.length,\n lastMessageOffset: newOffset,\n endTime,\n topics: summaryResult.topics,\n metadata: {\n keyPoints: summaryResult.keyPoints,\n },\n });\n\n logger.info(\n `Updated summary for room ${roomId}: ${sortedMessages.length} new messages processed (offset: ${lastOffset} → ${newOffset})`\n );\n } else {\n // Create new summary\n await memoryService.storeSessionSummary({\n agentId: runtime.agentId,\n roomId,\n entityId: message.entityId !== runtime.agentId ? message.entityId : undefined,\n summary: summaryResult.summary,\n messageCount: sortedMessages.length,\n lastMessageOffset: newOffset,\n startTime,\n endTime,\n topics: summaryResult.topics,\n metadata: {\n keyPoints: summaryResult.keyPoints,\n },\n });\n\n logger.info(\n `Created new summary for room ${roomId}: ${sortedMessages.length} messages summarized (offset: 0 → ${newOffset})`\n );\n }\n\n // Note: We do NOT delete messages - they stay in the database\n // The offset tracks what's been summarized\n } catch (error) {\n logger.error({ error }, 'Error during summarization:');\n }\n },\n\n examples: [],\n};\n",
|
|
10
10
|
"import {\n type IAgentRuntime,\n type Memory,\n type Evaluator,\n logger,\n ModelType,\n composePromptFromState,\n} from '@elizaos/core';\nimport { MemoryService } from '../services/memory-service';\nimport { LongTermMemoryCategory, type MemoryExtraction } from '../types/index';\n\n/**\n * Template for extracting long-term memories\n */\nconst extractionTemplate = `# Task: Extract Long-Term Memory\n\nYou are analyzing a conversation to extract facts that should be remembered long-term about the user.\n\n# Recent Messages\n{{recentMessages}}\n\n# Current Long-Term Memories\n{{existingMemories}}\n\n# Memory Categories\n1. **identity**: User's name, role, identity (e.g., \"I'm a data scientist\")\n2. **expertise**: User's skills, knowledge domains, or unfamiliarity with topics\n3. **projects**: Ongoing projects, past interactions, recurring topics\n4. **preferences**: Communication style, format preferences, verbosity, etc.\n5. **data_sources**: Frequently used files, databases, APIs\n6. **goals**: Broader intentions (e.g., \"preparing for interview\")\n7. **constraints**: User-defined rules or limitations\n8. **definitions**: Custom terms, acronyms, glossaries\n9. **behavioral_patterns**: How the user tends to interact\n\n# Instructions\nExtract any NEW information that should be remembered long-term. For each item:\n- Determine which category it belongs to\n- Write a clear, factual statement\n- Assess confidence (0.0 to 1.0)\n- Only include information explicitly stated or strongly implied\n\nIf there are no new long-term facts to extract, respond with <memories></memories>\n\nRespond in this XML format:\n<memories>\n <memory>\n <category>identity</category>\n <content>User is a software engineer specializing in backend development</content>\n <confidence>0.95</confidence>\n </memory>\n <memory>\n <category>preferences</category>\n <content>Prefers code examples over lengthy explanations</content>\n <confidence>0.85</confidence>\n </memory>\n</memories>`;\n\n/**\n * Parse XML memory extraction response\n */\nfunction parseMemoryExtractionXML(xml: string): MemoryExtraction[] {\n const memoryMatches = xml.matchAll(\n /<memory>[\\s\\S]*?<category>(.*?)<\\/category>[\\s\\S]*?<content>(.*?)<\\/content>[\\s\\S]*?<confidence>(.*?)<\\/confidence>[\\s\\S]*?<\\/memory>/g\n );\n\n const extractions: MemoryExtraction[] = [];\n\n for (const match of memoryMatches) {\n const category = match[1].trim() as LongTermMemoryCategory;\n const content = match[2].trim();\n const confidence = parseFloat(match[3].trim());\n\n // Validate category\n if (!Object.values(LongTermMemoryCategory).includes(category)) {\n logger.warn(`Invalid memory category: ${category}`);\n continue;\n }\n\n if (content && !isNaN(confidence)) {\n extractions.push({ category, content, confidence });\n }\n }\n\n return extractions;\n}\n\n/**\n * Long-term Memory Extraction Evaluator\n *\n * Analyzes conversations to extract persistent facts about users that should be remembered\n * across all future conversations.\n */\nexport const longTermExtractionEvaluator: Evaluator = {\n name: 'LONG_TERM_MEMORY_EXTRACTION',\n description: 'Extracts long-term facts about users from conversations',\n similes: ['MEMORY_EXTRACTION', 'FACT_LEARNING', 'USER_PROFILING'],\n alwaysRun: true,\n\n validate: async (runtime: IAgentRuntime, message: Memory): Promise<boolean> => {\n logger.debug(`Validating long-term memory extraction for message: ${message.content?.text}`);\n // Only run on user messages (not agent's own)\n if (message.entityId === runtime.agentId) {\n logger.debug(\"Skipping long-term memory extraction for agent's own message\");\n return false;\n }\n\n if (!message.content?.text) {\n logger.debug('Skipping long-term memory extraction for message without text');\n return false;\n }\n\n const memoryService = runtime.getService('memory') as MemoryService | null;\n if (!memoryService) {\n logger.debug('MemoryService not found');\n return false;\n }\n\n const config = memoryService.getConfig();\n if (!config.longTermExtractionEnabled) {\n logger.debug('Long-term memory extraction is disabled');\n return false;\n }\n\n // Count total messages from this entity in this room\n const currentMessageCount = await runtime.countMemories(message.roomId, false, 'messages');\n\n const shouldRun = await memoryService.shouldRunExtraction(\n message.entityId,\n message.roomId,\n currentMessageCount\n );\n logger.debug(`Should run extraction: ${shouldRun}`);\n return shouldRun;\n },\n\n handler: async (runtime: IAgentRuntime, message: Memory): Promise<void> => {\n const memoryService = runtime.getService('memory') as MemoryService;\n if (!memoryService) {\n logger.error('MemoryService not found');\n return;\n }\n\n const config = memoryService.getConfig();\n const { entityId, roomId } = message;\n\n try {\n logger.info(`Extracting long-term memories for entity ${entityId}`);\n\n // Get recent conversation context\n const recentMessages = await runtime.getMemories({\n tableName: 'messages',\n roomId,\n count: 20,\n unique: false,\n });\n\n const formattedMessages = recentMessages\n .sort((a, b) => (a.createdAt || 0) - (b.createdAt || 0))\n .map((msg) => {\n const sender = msg.entityId === runtime.agentId ? runtime.character.name : 'User';\n return `${sender}: ${msg.content.text || '[non-text message]'}`;\n })\n .join('\\n');\n\n // Get existing long-term memories\n const existingMemories = await memoryService.getLongTermMemories(entityId, undefined, 30);\n const formattedExisting =\n existingMemories.length > 0\n ? existingMemories\n .map((m) => `[${m.category}] ${m.content} (confidence: ${m.confidence})`)\n .join('\\n')\n : 'None yet';\n\n // Generate extraction using LLM\n const state = await runtime.composeState(message);\n const prompt = composePromptFromState({\n state: {\n ...state,\n recentMessages: formattedMessages,\n existingMemories: formattedExisting,\n },\n template: extractionTemplate,\n });\n\n const response = await runtime.useModel(ModelType.TEXT_LARGE, {\n prompt,\n });\n\n const extractions = parseMemoryExtractionXML(response);\n\n logger.info(`Extracted ${extractions.length} long-term memories`);\n\n // Store each extracted memory\n for (const extraction of extractions) {\n if (extraction.confidence >= config.longTermConfidenceThreshold) {\n await memoryService.storeLongTermMemory({\n agentId: runtime.agentId,\n entityId,\n category: extraction.category,\n content: extraction.content,\n confidence: extraction.confidence,\n source: 'conversation',\n metadata: {\n roomId,\n extractedAt: new Date().toISOString(),\n },\n });\n\n logger.info(\n `Stored long-term memory: [${extraction.category}] ${extraction.content.substring(0, 50)}...`\n );\n } else {\n logger.debug(\n `Skipped low-confidence memory: ${extraction.content} (confidence: ${extraction.confidence})`\n );\n }\n }\n\n // Update the extraction checkpoint after successful extraction\n const currentMessageCount = await runtime.countMemories(roomId, false, 'messages');\n await memoryService.setLastExtractionCheckpoint(entityId, roomId, currentMessageCount);\n logger.debug(\n `Updated extraction checkpoint to ${currentMessageCount} for entity ${entityId} in room ${roomId}`\n );\n } catch (error) {\n logger.error({ error }, 'Error during long-term memory extraction:');\n }\n },\n\n examples: [],\n};\n",
|
|
11
11
|
"import type { UUID } from '@elizaos/core';\n\n/**\n * Categories of long-term memory\n */\nexport enum LongTermMemoryCategory {\n IDENTITY = 'identity', // User identity, name, roles\n EXPERTISE = 'expertise', // Domain knowledge and familiarity\n PROJECTS = 'projects', // Past interactions and recurring topics\n PREFERENCES = 'preferences', // User preferences for interaction style\n DATA_SOURCES = 'data_sources', // Frequently used files, databases, APIs\n GOALS = 'goals', // User's broader intentions and objectives\n CONSTRAINTS = 'constraints', // User-defined rules and limitations\n DEFINITIONS = 'definitions', // Custom terms, acronyms, glossaries\n BEHAVIORAL_PATTERNS = 'behavioral_patterns', // User interaction patterns\n}\n\n/**\n * Long-term memory entry\n */\nexport interface LongTermMemory {\n id: UUID;\n agentId: UUID;\n entityId: UUID; // The user/entity this memory is about\n category: LongTermMemoryCategory;\n content: string; // The actual memory content\n metadata?: Record<string, unknown>; // Additional structured data\n embedding?: number[]; // Vector embedding for semantic search\n confidence?: number; // Confidence score (0-1)\n source?: string; // Where this memory came from (conversation, manual, etc.)\n createdAt: Date;\n updatedAt: Date;\n lastAccessedAt?: Date;\n accessCount?: number;\n similarity?: number; // Optional similarity score from vector search\n}\n\n/**\n * Short-term memory session summary\n */\nexport interface SessionSummary {\n id: UUID;\n agentId: UUID;\n roomId: UUID;\n entityId?: UUID; // Optional: specific user in the session\n summary: string; // The summarized conversation\n messageCount: number; // Number of messages summarized\n lastMessageOffset: number; // Index of last summarized message (for pagination)\n startTime: Date; // Timestamp of first message\n endTime: Date; // Timestamp of last message\n topics?: string[]; // Main topics discussed\n metadata?: Record<string, unknown>;\n embedding?: number[]; // Vector embedding of the summary\n createdAt: Date;\n updatedAt: Date; // Track when summary was last updated\n}\n\n/**\n * Configuration for memory plugin\n */\nexport interface MemoryConfig {\n // Short-term memory settings\n shortTermSummarizationThreshold: number; // Messages count before summarization\n shortTermRetainRecent: number; // Number of recent messages to keep after summarization\n\n // Long-term memory settings\n longTermExtractionEnabled: boolean;\n longTermVectorSearchEnabled: boolean;\n longTermConfidenceThreshold: number; // Minimum confidence to store\n longTermExtractionInterval: number; // Run extraction every N messages (e.g., 5, 10, 15...)\n\n // Summarization settings\n summaryModelType?: string;\n summaryMaxTokens?: number;\n}\n\n/**\n * Memory extraction result from evaluator\n */\nexport interface MemoryExtraction {\n category: LongTermMemoryCategory;\n content: string;\n confidence: number;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Summary generation result\n */\nexport interface SummaryResult {\n summary: string;\n topics: string[];\n keyPoints: string[];\n}\n",
|
|
12
|
-
"import {\n type IAgentRuntime,\n type Memory,\n type Provider,\n type State,\n logger,\n addHeader,\n} from '@elizaos/core';\nimport { MemoryService } from '../services/memory-service';\n\n/**\n * Short-term Memory Provider\n *\n * Provides conversation context by combining:\n * 1. Recent session summaries (for older conversations)\n * 2. Recent unsummarized messages (most recent activity)\n *\n * This provider works alongside recentMessagesProvider to optimize context usage.\n * When conversations get long, older messages are summarized and this provider\n * injects those summaries instead of full message history.\n */\nexport const shortTermMemoryProvider: Provider = {\n name: 'SHORT_TERM_MEMORY',\n description: 'Recent conversation summaries to maintain context efficiently',\n position: 95, // Run before recentMessagesProvider (100) to provide summary context first\n\n get: async (runtime: IAgentRuntime, message: Memory, _state: State) => {\n try {\n const memoryService = runtime.getService('memory') as MemoryService | null;\n if (!memoryService) {\n return {\n data: { summaries: [] },\n values: { sessionSummaries: '' },\n text: '',\n };\n }\n\n const { roomId } = message;\n\n // Get recent session summaries for this room\n const summaries = await memoryService.getSessionSummaries(roomId, 3);\n\n if (summaries.length === 0) {\n return {\n data: { summaries: [] },\n values: { sessionSummaries: '' },\n text: '',\n };\n }\n\n // Format summaries for context\n const formattedSummaries = summaries\n .reverse() // Show oldest to newest\n .map((summary, index) => {\n const messageRange = `${summary.messageCount} messages`;\n const timeRange = new Date(summary.startTime).toLocaleDateString();\n\n let text = `**Session ${index + 1}** (${messageRange}, ${timeRange})\\n`;\n text += summary.summary;\n\n if (summary.topics && summary.topics.length > 0) {\n text += `\\n*Topics: ${summary.topics.join(', ')}*`;\n }\n\n return text;\n })\n .join('\\n\\n');\n\n const text = addHeader('# Previous Conversation Context', formattedSummaries);\n\n return {\n data: { summaries },\n values: { sessionSummaries: text },\n text,\n };\n } catch (error) {\n logger.error({ error }, 'Error in shortTermMemoryProvider:');\n return {\n data: { summaries: [] },\n values: { sessionSummaries: '' },\n text: '',\n };\n }\n },\n};\n",
|
|
12
|
+
"import {\n addHeader,\n ChannelType,\n CustomMetadata,\n formatMessages,\n formatPosts,\n getEntityDetails,\n type Entity,\n type IAgentRuntime,\n type Memory,\n type Provider,\n type State,\n logger,\n} from '@elizaos/core';\nimport { MemoryService } from '../services/memory-service';\n\n/**\n * Short-term Memory Provider\n *\n * Adaptive conversation context provider that optimizes based on conversation length:\n *\n * SHORT CONVERSATIONS (< threshold, default 5 messages):\n * - Shows full message history with complete context\n * - No summarization overhead for brief chats\n *\n * LONG CONVERSATIONS (>= threshold):\n * - Shows summaries of older conversation segments\n * - Shows recent unsummarized messages in full\n * - Optimizes context window while preserving information\n *\n * This provider can REPLACE recentMessagesProvider when plugin-memory is active,\n * providing superior context management for both short and long conversations.\n */\nexport const shortTermMemoryProvider: Provider = {\n name: 'SHORT_TERM_MEMORY',\n description: 'Adaptive conversation context with smart summarization',\n position: 95, // Run before recentMessagesProvider (100) to potentially replace it\n\n get: async (runtime: IAgentRuntime, message: Memory, _state: State) => {\n try {\n const memoryService = runtime.getService('memory') as MemoryService | null;\n if (!memoryService) {\n // No memory service - return empty\n return {\n data: { summaries: [], recentMessages: [], mode: 'disabled' },\n values: { sessionSummaries: '', recentMessages: '' },\n text: '',\n };\n }\n\n const { roomId } = message;\n const config = memoryService.getConfig();\n\n // Get total message count to determine mode\n const totalMessageCount = await runtime.countMemories(roomId, false, 'messages');\n\n // ADAPTIVE LOGIC: Use full messages for short conversations, summaries for long ones\n if (totalMessageCount < config.shortTermSummarizationThreshold) {\n // ========== SHORT CONVERSATION MODE ==========\n // Just show all messages - no summarization needed\n\n const conversationLength = runtime.getConversationLength();\n\n // Fetch all necessary data in parallel\n const [entitiesData, room, recentMessagesData] = await Promise.all([\n getEntityDetails({ runtime, roomId }),\n runtime.getRoom(roomId),\n runtime.getMemories({\n tableName: 'messages',\n roomId,\n count: conversationLength,\n unique: false,\n }),\n ]);\n\n // Separate action results from dialogue messages\n const actionResultMessages = recentMessagesData.filter(\n (msg) => msg.content?.type === 'action_result' && msg.metadata?.type === 'action_result'\n );\n\n const dialogueMessages = recentMessagesData.filter(\n (msg) =>\n !(msg.content?.type === 'action_result' && msg.metadata?.type === 'action_result')\n );\n\n // Determine format based on room type\n const isPostFormat = room?.type\n ? room.type === ChannelType.FEED || room.type === ChannelType.THREAD\n : false;\n\n // Format messages in parallel\n const [formattedRecentMessages, formattedRecentPosts] = await Promise.all([\n formatMessages({\n messages: dialogueMessages,\n entities: entitiesData,\n }),\n formatPosts({\n messages: dialogueMessages,\n entities: entitiesData,\n conversationHeader: false,\n }),\n ]);\n\n // Format action results if any\n let actionResultsText = '';\n if (actionResultMessages.length > 0) {\n const groupedByRun = new Map<string, Memory[]>();\n\n for (const mem of actionResultMessages) {\n const runId: string = String(mem.content?.runId || 'unknown');\n if (!groupedByRun.has(runId)) {\n groupedByRun.set(runId, []);\n }\n groupedByRun.get(runId)?.push(mem);\n }\n\n const formattedActionResults = Array.from(groupedByRun.entries())\n .slice(-3) // Show last 3 runs\n .map(([runId, memories]) => {\n const sortedMemories = memories.sort(\n (a: Memory, b: Memory) => (a.createdAt || 0) - (b.createdAt || 0)\n );\n\n const thought = sortedMemories[0]?.content?.planThought || '';\n const runText = sortedMemories\n .map((mem: Memory) => {\n const actionName = mem.content?.actionName || 'Unknown';\n const status = mem.content?.actionStatus || 'unknown';\n const planStep = mem.content?.planStep || '';\n const text = mem.content?.text || '';\n const error = mem.content?.error || '';\n\n let memText = ` - ${actionName} (${status})`;\n if (planStep) memText += ` [${planStep}]`;\n if (error) {\n memText += `: Error - ${error}`;\n } else if (text && text !== `Executed action: ${actionName}`) {\n memText += `: ${text}`;\n }\n\n return memText;\n })\n .join('\\n');\n\n return `**Action Run ${runId.slice(0, 8)}**${\n thought ? ` - \"${thought}\"` : ''\n }\\n${runText}`;\n })\n .join('\\n\\n');\n\n actionResultsText = formattedActionResults\n ? addHeader('# Recent Action Executions', formattedActionResults)\n : '';\n }\n\n // Create formatted text with headers\n const recentPosts =\n formattedRecentPosts && formattedRecentPosts.length > 0\n ? addHeader('# Posts in Thread', formattedRecentPosts)\n : '';\n\n const recentMessages =\n formattedRecentMessages && formattedRecentMessages.length > 0\n ? addHeader('# Conversation Messages', formattedRecentMessages)\n : '';\n\n // Handle empty conversation case\n if (\n !recentPosts &&\n !recentMessages &&\n dialogueMessages.length === 0 &&\n !message.content.text\n ) {\n return {\n data: {\n summaries: [],\n recentMessages: [],\n actionResults: [],\n mode: 'full_conversation',\n },\n values: {\n sessionSummaries: '',\n recentMessages: '',\n recentActionResults: '',\n },\n text: 'No recent messages available',\n };\n }\n\n // Get most recent message for context\n let recentMessage = 'No recent message available.';\n if (dialogueMessages.length > 0) {\n const mostRecentMessage = [...dialogueMessages].sort(\n (a, b) => (b.createdAt || 0) - (a.createdAt || 0)\n )[0];\n\n const formattedSingleMessage = formatMessages({\n messages: [mostRecentMessage],\n entities: entitiesData,\n });\n\n if (formattedSingleMessage) {\n recentMessage = formattedSingleMessage;\n }\n }\n\n // Build received message header\n const metaData = message.metadata as CustomMetadata;\n const senderName =\n entitiesData.find((entity: Entity) => entity.id === message.entityId)?.names[0] ||\n metaData?.entityName ||\n 'Unknown User';\n const receivedMessageContent = message.content.text;\n const hasReceivedMessage = !!receivedMessageContent?.trim();\n\n const receivedMessageHeader = hasReceivedMessage\n ? addHeader('# Received Message', `${senderName}: ${receivedMessageContent}`)\n : '';\n\n const focusHeader = hasReceivedMessage\n ? addHeader(\n '# Focus your response',\n `You are replying to the above message from **${senderName}**. Keep your answer relevant to that message. Do not repeat earlier replies unless the sender asks again.`\n )\n : '';\n\n // Combine all sections\n const text = [\n isPostFormat ? recentPosts : recentMessages,\n actionResultsText,\n recentMessages || recentPosts || message.content.text ? receivedMessageHeader : '',\n recentMessages || recentPosts || message.content.text ? focusHeader : '',\n ]\n .filter(Boolean)\n .join('\\n\\n');\n\n return {\n data: {\n summaries: [],\n recentMessages: dialogueMessages,\n actionResults: actionResultMessages,\n mode: 'full_conversation',\n },\n values: {\n sessionSummaries: '',\n recentMessages: isPostFormat ? recentPosts : recentMessages,\n recentActionResults: actionResultsText,\n recentMessage,\n },\n text,\n };\n } else {\n // ========== LONG CONVERSATION MODE ==========\n // Use summaries + recent unsummarized messages\n\n const currentSummary = await memoryService.getCurrentSessionSummary(roomId);\n const lastOffset = currentSummary?.lastMessageOffset || 0;\n\n // Get recent unsummarized messages (after the last summary offset)\n const unsummarizedMessages = await runtime.getMemories({\n tableName: 'messages',\n roomId,\n count: config.shortTermRetainRecent,\n unique: false,\n start: lastOffset,\n });\n\n // Get entity details for formatting\n const entitiesData = await getEntityDetails({ runtime, roomId });\n const room = await runtime.getRoom(roomId);\n\n // Determine format\n const isPostFormat = room?.type\n ? room.type === ChannelType.FEED || room.type === ChannelType.THREAD\n : false;\n\n // Format unsummarized messages\n let recentMessagesText = '';\n if (unsummarizedMessages.length > 0) {\n const dialogueMessages = unsummarizedMessages.filter(\n (msg) =>\n !(msg.content?.type === 'action_result' && msg.metadata?.type === 'action_result')\n );\n\n if (isPostFormat) {\n recentMessagesText = formatPosts({\n messages: dialogueMessages,\n entities: entitiesData,\n conversationHeader: false,\n });\n } else {\n recentMessagesText = formatMessages({\n messages: dialogueMessages,\n entities: entitiesData,\n });\n }\n\n if (recentMessagesText) {\n recentMessagesText = addHeader('# Recent Messages', recentMessagesText);\n }\n }\n\n // Format summary\n let summaryText = '';\n if (currentSummary) {\n const messageRange = `${currentSummary.messageCount} messages`;\n const timeRange = new Date(currentSummary.startTime).toLocaleDateString();\n\n summaryText = `**Previous Conversation** (${messageRange}, ${timeRange})\\n`;\n summaryText += currentSummary.summary;\n\n if (currentSummary.topics && currentSummary.topics.length > 0) {\n summaryText += `\\n*Topics: ${currentSummary.topics.join(', ')}*`;\n }\n\n summaryText = addHeader('# Conversation Summary', summaryText);\n }\n\n // Build received message header\n const metaData = message.metadata as CustomMetadata;\n const senderName =\n entitiesData.find((entity: Entity) => entity.id === message.entityId)?.names[0] ||\n metaData?.entityName ||\n 'Unknown User';\n const receivedMessageContent = message.content.text;\n const hasReceivedMessage = !!receivedMessageContent?.trim();\n\n const receivedMessageHeader = hasReceivedMessage\n ? addHeader('# Received Message', `${senderName}: ${receivedMessageContent}`)\n : '';\n\n const focusHeader = hasReceivedMessage\n ? addHeader(\n '# Focus your response',\n `You are replying to the above message from **${senderName}**. Keep your answer relevant to that message.`\n )\n : '';\n\n // Combine sections\n const text = [\n summaryText,\n recentMessagesText,\n hasReceivedMessage ? receivedMessageHeader : '',\n hasReceivedMessage ? focusHeader : '',\n ]\n .filter(Boolean)\n .join('\\n\\n');\n\n return {\n data: {\n summaries: currentSummary ? [currentSummary] : [],\n recentMessages: unsummarizedMessages,\n mode: 'summarized',\n },\n values: {\n sessionSummaries: summaryText,\n recentMessages: recentMessagesText,\n },\n text,\n };\n }\n } catch (error) {\n logger.error({ error }, 'Error in shortTermMemoryProvider:');\n return {\n data: { summaries: [], recentMessages: [], mode: 'error' },\n values: { sessionSummaries: '', recentMessages: '' },\n text: 'Error retrieving conversation context.',\n };\n }\n },\n};\n",
|
|
13
13
|
"import {\n type IAgentRuntime,\n type Memory,\n type Provider,\n type State,\n logger,\n addHeader,\n} from '@elizaos/core';\nimport { MemoryService } from '../services/memory-service';\n\n/**\n * Long-term Memory Provider\n *\n * Provides persistent facts about the user that have been learned across\n * all conversations. This includes:\n * - User identity and roles\n * - Domain expertise\n * - Preferences\n * - Goals and projects\n * - Custom definitions\n * - Behavioral patterns\n *\n * This provider enriches the context with relevant long-term information\n * to make the agent's responses more personalized and contextually aware.\n */\nexport const longTermMemoryProvider: Provider = {\n name: 'LONG_TERM_MEMORY',\n description: 'Persistent facts and preferences about the user',\n position: 50, // Run early to establish user context\n\n get: async (runtime: IAgentRuntime, message: Memory, _state: State) => {\n try {\n const memoryService = runtime.getService('memory') as MemoryService | null;\n if (!memoryService) {\n return {\n data: { memories: [] },\n values: { longTermMemories: '' },\n text: '',\n };\n }\n\n const { entityId } = message;\n\n // Skip for agent's own messages\n if (entityId === runtime.agentId) {\n return {\n data: { memories: [] },\n values: { longTermMemories: '' },\n text: '',\n };\n }\n\n // Get long-term memories for this entity\n const memories = await memoryService.getLongTermMemories(entityId, undefined, 25);\n\n if (memories.length === 0) {\n return {\n data: { memories: [] },\n values: { longTermMemories: '' },\n text: '',\n };\n }\n\n // Format memories using the service's built-in formatter\n const formattedMemories = await memoryService.getFormattedLongTermMemories(entityId);\n\n const text = addHeader('# What I Know About You', formattedMemories);\n\n // Create a summary of memory categories for quick reference\n const categoryCounts = new Map<string, number>();\n for (const memory of memories) {\n const count = categoryCounts.get(memory.category) || 0;\n categoryCounts.set(memory.category, count + 1);\n }\n\n const categoryList = Array.from(categoryCounts.entries())\n .map(([cat, count]) => `${cat}: ${count}`)\n .join(', ');\n\n return {\n data: {\n memories,\n categoryCounts: Object.fromEntries(categoryCounts),\n },\n values: {\n longTermMemories: text,\n memoryCategories: categoryList,\n },\n text,\n };\n } catch (error) {\n logger.error({ error }, 'Error in longTermMemoryProvider:');\n return {\n data: { memories: [] },\n values: { longTermMemories: '' },\n text: '',\n };\n }\n },\n};\n",
|
|
14
14
|
"import type { Plugin } from '@elizaos/core';\nimport { MemoryService } from './services/memory-service';\nimport { summarizationEvaluator } from './evaluators/summarization';\nimport { longTermExtractionEvaluator } from './evaluators/long-term-extraction';\nimport { shortTermMemoryProvider } from './providers/short-term-memory';\nimport { longTermMemoryProvider } from './providers/long-term-memory';\n// import { rememberAction } from './actions/remember';\nimport * as schema from './schemas/index';\n\nexport * from './types/index';\nexport * from './schemas/index';\nexport { MemoryService } from './services/memory-service';\n\n/**\n * Memory Plugin\n *\n * Advanced memory management plugin that provides:\n *\n * **Short-term Memory (Conversation Summarization)**:\n * - Automatically summarizes long conversations to reduce context size\n * - Retains recent messages while archiving older ones as summaries\n * - Configurable thresholds for when to summarize\n *\n * **Long-term Memory (Persistent Facts)**:\n * - Extracts and stores persistent facts about users\n * - Categorizes information (identity, expertise, preferences, etc.)\n * - Provides context-aware user profiles across all conversations\n *\n * **Components**:\n * - `MemoryService`: Manages all memory operations\n * - Evaluators: Process conversations to create summaries and extract facts\n * - Providers: Inject memory context into conversations\n * - Actions: Allow manual memory storage via user commands\n *\n * **Configuration** (via environment variables):\n * - `MEMORY_SUMMARIZATION_THRESHOLD`: Messages before summarization (default: 50)\n * - `MEMORY_RETAIN_RECENT`: Recent messages to keep (default: 10)\n * - `MEMORY_LONG_TERM_ENABLED`: Enable long-term extraction (default: true)\n * - `MEMORY_CONFIDENCE_THRESHOLD`: Minimum confidence to store (default: 0.7)\n *\n * **Database Tables**:\n * - `long_term_memories`: Persistent user facts\n * - `session_summaries`: Conversation summaries\n * - `memory_access_logs`: Optional usage tracking\n */\nexport const memoryPlugin: Plugin = {\n name: 'memory',\n description:\n 'Advanced memory management with conversation summarization and long-term persistent memory',\n\n services: [MemoryService],\n\n evaluators: [summarizationEvaluator, longTermExtractionEvaluator],\n\n providers: [longTermMemoryProvider, shortTermMemoryProvider],\n\n // actions: [rememberAction],\n\n // Export schema for dynamic migrations\n schema,\n};\n\nexport default memoryPlugin;\n"
|
|
15
15
|
],
|
|
16
|
-
"mappings": "iIAAA,kBAEE,aAEA,sBAGF,aAAS,SAAI,UAAK,SAAM,oBAAK,U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