@prismshadow/penguin-library-agent · library/agent/src/contract.ts:77

Memory

interface

Memory: the mechanism MemoryService implements.

API

@Interface()
export abstract class Memory {
  abstract overview(projectId: string, agentId: string): Promise<MemoryOverviewResponse>;
  abstract insertTemplatePlaceholder(
      projectId: string,
      agentId: string,
    ): Promise<MemoryOverviewResponse>;
  abstract listScopes(projectId: string, agentId: string): Promise<MemoryScopeInfo[]>;
  abstract listFiles(
      projectId: string,
      agentId: string,
      scopeKey: string,
    ): Promise<MemoryFilesResponse>;
  abstract readFile(
      projectId: string,
      agentId: string,
      scopeKey: string,
      filePath: string,
    ): Promise<MemoryFileResponse>;
  abstract exportScope(projectId: string, agentId: string, scopeKey: string): Promise<Uint8Array>;
  abstract importScope(
      projectId: string,
      agentId: string,
      scopeKey: string,
      request: { mode: MemoryImportMode; confirm: boolean; payload?: unknown; dataBase64?: string },
    ): Promise<MemoryImportResponse>;
  abstract deleteFile(
      projectId: string,
      agentId: string,
      scopeKey: string,
      filePath: string,
    ): Promise<void>;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use
@Moduleexported by
@Useconsumed by (1)

Members (8)

overview

overview(projectId: string, agentId: string): Promise<MemoryOverviewResponse>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<MemoryOverviewResponse>

insertTemplatePlaceholder

insertTemplatePlaceholder(projectId: string, agentId: string): Promise<MemoryOverviewResponse>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<MemoryOverviewResponse>

listScopes

listScopes(projectId: string, agentId: string): Promise<MemoryScopeInfo[]>
@paramprojectIdstring
@paramagentIdstring
@returnsPromise<MemoryScopeInfo[]>

listFiles

listFiles(projectId: string, agentId: string, scopeKey: string): Promise<MemoryFilesResponse>
@paramprojectIdstring
@paramagentIdstring
@paramscopeKeystring
@returnsPromise<MemoryFilesResponse>

readFile

readFile(projectId: string, agentId: string, scopeKey: string, filePath: string): Promise<MemoryFileResponse>

filePath is the file's place in the scope: a topic's name, or <folder>/<path> for a file it keeps.

@paramprojectIdstring
@paramagentIdstring
@paramscopeKeystring
@paramfilePathstring
@returnsPromise<MemoryFileResponse>

exportScope

exportScope(projectId: string, agentId: string, scopeKey: string): Promise<Uint8Array>

The scope folder as a zip.

@paramprojectIdstring
@paramagentIdstring
@paramscopeKeystring
@returnsPromise<Uint8Array>

importScope

importScope(projectId: string, agentId: string, scopeKey: string, request: { mode: MemoryImportMode; confirm: boolean; payload?: unknown; dataBase64?: string }): Promise<MemoryImportResponse>
@paramprojectIdstring
@paramagentIdstring
@paramscopeKeystring
@paramrequest{ mode: MemoryImportMode; confirm: boolean; payload?: unknown; dataBase64?: string }
@returnsPromise<MemoryImportResponse>

deleteFile

deleteFile(projectId: string, agentId: string, scopeKey: string, filePath: string): Promise<void>

filePath as in readFile; a topic goes together with the folder of files it keeps.

@paramprojectIdstring
@paramagentIdstring
@paramscopeKeystring
@paramfilePathstring
@returnsPromise<void>