Local-first memory for AI agents stored in a single SQLite file.
Project details
Mnemosyne offers a powerful, auditable memory solution for AI agents, enabling them to store and recall learned information with ease. Housed in a single SQLite file, it ensures that memory persists while maintaining transparency with evidence sources, making it a pivotal tool for developing smarter AI experiences.
Mnemosyne provides a robust, local-first memory system designed specifically for AI agents, consolidating learned information in a single SQLite file. This innovative solution serves agents efficiently while adhering to the principles of auditable memory, ensuring that each piece of information is accompanied by its source and associated trust level. With Mnemosyne, agents start with the most reliable, current evidence, enhancing decision-making capabilities.
Mnemosyne boasts impressive benchmark results, achieving a score of 409 out of 500 in the LongMemEval-S, illustrating its capacity for effective memory management. The innovative functionalities in the latest releases include inferred dependency tracking, which aids in maintaining continuity across updates.
To incorporate Mnemosyne in a project, install it via npm, either the stable version or the pre-release for cutting-edge features. For instance:
npm install mnemosy-ai # Stable version
npm install mnemosy-ai@next # Pre-release
To run a demonstration, use the npx command, which showcases the integral features of the memory system:
npx -y -p mnemosy-ai demo
Here is a simple code snippet illustrating how to set up a memory instance with Mnemosyne, correct a piece of memory, and retrieve its state:
import { createLocalMemory } from 'mnemosy-ai/local';
const memory = createLocalMemory({
path: './agent-memory.sqlite',
workspaceId: 'catalogue',
agentId: 'designer',
});
const brief = memory.store({
text: 'Product images must be 1200 by 900 pixels.',
kind: 'fact',
key: 'catalogue.image-size',
source: { uri: 'brief://catalogue/v1' },
trust: 'observed',
visibility: 'workspace',
});
memory.correct(brief.id, {
text: 'Product images must be 1600 by 1200 pixels.',
source: { uri: 'brief://catalogue/v2' },
reason: 'The delivery specification changed.',
});
console.log(memory.get(brief.id)?.status); // Outputs: invalidated
For more detailed insights into capabilities, corrections, or other advanced features, refer to the comprehensive documentation and begin constructing powerful AI agents with Mnemosyne.
Comments
0Start the conversation
Share the first comment.