Skip to main content

Memory API

The memory module of the @codebolt/plugin-sdk.

import plugin from '@codebolt/plugin-sdk';

Quick Reference

MethodDescription
addKnowledgeAdds a key-value pair to the in-memory database.
getKnowledgeRetrieves a value from the in-memory database by key.

Methods


addKnowledge

plugin.memory.addKnowledge(key: string, value: MemoryValue): Promise<MemorySetResponse>

Adds a key-value pair to the in-memory database.

ParameterTypeRequiredDescription
keystringYesThe key under which to store the value.
valueMemoryValueYesThe value to be stored.

Returns: Promise<MemorySetResponse> — A promise that resolves with the response from the memory set event.

Full reference →


getKnowledge

plugin.memory.getKnowledge(key: string): Promise<MemoryGetResponse>

Retrieves a value from the in-memory database by key.

ParameterTypeRequiredDescription
keystringYesThe key of the value to retrieve.

Returns: Promise<MemoryGetResponse> — A promise that resolves with the response from the memory get event.

Full reference →