agenticmemoryai
v1.2.0
Published
Official Node.js SDK for Agentic Memory — persistent memory for AI agents
Maintainers
Readme
agenticmemoryai
Official Node.js SDK for Agentic Memory. Give your AI agents persistent memory in one line.
Install
npm install agenticmemoryaiQuick Start
const { AgenticMemory } = require('agenticmemoryai');
const memory = new AgenticMemory({ apiKey: 'amk_your_key' });
// Store a message
await memory.store('your-space-id', { role: 'user', content: 'Hello!' });
// Recall recent messages
const messages = await memory.recall('your-space-id', { limit: 20 });
// Search by meaning (Pro plan)
const results = await memory.search('your-space-id', 'pricing discussion');Features
- Short-term memory — instant recall, sub-millisecond reads
- Medium-term memory — search past conversations by meaning
- Long-term memory — auto-summarised knowledge across months
- End-to-end encryption — zero-knowledge spaces where only you hold the key
End-to-end encryption (zero-knowledge)
Create a space the server can never read. Encryption and decryption happen inside the SDK — the API only ever sees ciphertext.
const { AgenticMemory, generateKey } = require('agenticmemoryai');
// Generate a key once and store it somewhere safe (it is NOT recoverable).
const encryptionKey = generateKey();
const memory = new AgenticMemory({ apiKey: 'amk_your_key', encryptionKey });
await memory.createSpace('Private', 'private', { encryption: 'e2e' });
// Everything below is encrypted before it leaves your process:
await memory.store(spaceId, { role: 'user', content: 'my secret' });
const { messages } = await memory.recall(spaceId); // transparently decrypted
// Check you're holding the right key for a space:
await memory.verifyKey(spaceId); // true / false
// Or derive the key from a passphrase instead of storing one:
const mem2 = new AgenticMemory({ apiKey: 'amk_your_key', passphrase: 'long secret phrase' });Notes:
- Semantic search is impossible on zero-knowledge spaces by design —
search()throwsSearchUnavailableError. - Prefer encrypted at rest instead? Create the space with
{ encryption: 'managed' }— the server encrypts your data at rest and every feature (search, summaries) keeps working. No SDK key needed. - Losing the key or passphrase means the data is unrecoverable. That's the point.
API
store(spaceId, message)— append a messagerecall(spaceId, { limit })— get recent messagessearch(spaceId, query, { scope, tags })— semantic searchsetContext(spaceId, key, value)— set key-value contextgetContext(spaceId, key)— get context valueaddEntry(spaceId, { type, title, content, tags })— append entrybootstrap(spaceId, opts)— load full context in one callsetShared(spaceId, key, value)— shared world memorycreateSpace(name, slug)— create a memory space
Get an API key
Sign up free at agenticmemory.ai. 1,000 messages/month on the free tier.
Links
Acknowledgements
The structured memory architecture was influenced by work from the h-network community by Halil Baysal.
License
Proprietary — Tyga.Cloud Ltd. See LICENSE file.
