@easynet/agent-memory
v1.0.61
Published
Unified memory layer for LangChain / LangGraph / DeepAgents
Maintainers
Readme
@botbotgo/memory
Introduction
@botbotgo/memory provides the memory layer for agents. It manages thread, cross_thread, and knowledge memory and registers the memory client into the default AgentContext.
Exposed Interfaces
| Export | Type | Purpose |
| --- | --- | --- |
| createAgentMemory | function | Create the memory service and register it into the default AgentContext. |
| CreateAgentMemoryOptions | type | Options for memory initialization. |
Configuration
The default config file is config/memory.yaml.
apiVersion: easynet.world/v1
kind: MemoryConfig
metadata:
name: agent-memory-default
spec:
memory:
thread:
store:
type: in_memory
cross_thread:
store:
type: in_memory
knowledge:
store:
type: in_memoryKey fields:
spec.memory.thread: current-thread memoryspec.memory.cross_thread: shared long-term memoryspec.memory.knowledge: document and knowledge memorystore.type: backend type
Usage
npm i @botbotgo/memoryimport { createAgentMemory } from "@botbotgo/memory";
const memory = await createAgentMemory("./config/memory.yaml");
await memory.memorize("user:demo", "cross_thread", "User prefers concise answers.");
const result = await memory.recall({
namespace: "user:demo",
query: "user preference",
types: ["cross_thread"],
topK: 5,
});
console.log(result.injectedText);