UNPKG

n8n-nodes-recallio

Version:

RecallioAI Memory node for n8n

43 lines (42 loc) 2.13 kB
import { RecallioClient } from './RecallioClient'; import type { ClientOptions as RecallioClientOptions, MemoryWithScoreDto, MemoryRecallOptions, SummarizedMemoriesDto } from './RecallioClient'; import { InputValues, OutputValues, MemoryVariables } from "@langchain/core/memory"; import { BaseMessage, HumanMessage } from "@langchain/core/messages"; import { BaseChatMemory, BaseChatMemoryInput } from "@langchain/community/memory/chat_memory"; import { IExecuteFunctions } from 'n8n-workflow'; export declare const recallioMemoryContextToSystemPrompt: (memories: MemoryWithScoreDto[] | null | undefined, summary?: SummarizedMemoriesDto | null) => string; export declare const condenseRecallioMemoryIntoHumanMessage: (memories: MemoryWithScoreDto[] | null | undefined, summary?: SummarizedMemoriesDto | null) => HumanMessage; export declare const recallioMemoryToMessages: (memories: MemoryWithScoreDto[] | null | undefined, summary?: SummarizedMemoriesDto | null) => BaseMessage[]; export interface RecallioMemoryInput extends BaseChatMemoryInput { humanPrefix?: string; aiPrefix?: string; memoryKey?: string; sessionId: string; apiKey: string; projectId: string; scope?: string; tags?: string[]; recallOptions?: MemoryRecallOptions; consentFlag?: boolean; separateMessages?: boolean; clientOptions?: Omit<RecallioClientOptions, "apiKey">; } export declare class RecallioMemory extends BaseChatMemory implements RecallioMemoryInput { humanPrefix: string; aiPrefix: string; memoryKey: string; apiKey: string; projectId: string; sessionId: string; scope: string; tags: string[] | undefined; recallOptions: MemoryRecallOptions | undefined; consentFlag: boolean; separateMessages: boolean; client: RecallioClient; constructor(fields: RecallioMemoryInput, httpRequest: IExecuteFunctions['helpers']['httpRequest']); get memoryKeys(): string[]; loadMemoryVariables(values: InputValues): Promise<MemoryVariables>; saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>; clear(): Promise<void>; }