@memorymerge/core
v0.1.0
Published
Pluggable decentralized memory layer for AI agent swarms. Powered by 0G Storage, 0G Compute, and 0G Chain.
Downloads
74
Maintainers
Readme
@memorymerge/core
Pluggable decentralized memory layer for AI agent swarms. Powered by 0G Storage, 0G Compute, and 0G Chain.
Part of the MemoryMerge framework.
Install
git clone https://github.com/Techkeyy/memorymerge.git
cd memorymerge && npm installQuick Start
import { createMemoryManager } from '@memorymerge/core';
const memory = createMemoryManager('my-agent');
await memory.writeFact('key', 'value', 0.9);
const context = await memory.getSwarmContext();Pluggable Adapters
import {
StorageAdapter,
ZeroGStorageAdapter,
TurnCountTrigger
} from '@memorymerge/core';
// Implement your own storage:
class MyStorage implements StorageAdapter {
async write(key: string, value: object): Promise<string> {
// your implementation
return 'hash';
}
async read(key: string): Promise<object | null> {
return null;
}
list(prefix: string): string[] { return []; }
async archive(snapshot: object, label: string): Promise<string> {
return 'hash';
}
async downloadByHash(hash: string): Promise<object | null> {
return null;
}
}Merkle Verification
import { VerifiableSnapshot, verifyFact } from '@memorymerge/core';
const snapshot = VerifiableSnapshot.build(facts, epoch, swarmId);
const proof = VerifiableSnapshot.generateProof(fact, snapshot);
const result = verifyFact(fact, snapshot.rootHash, proof.proof);
console.log(result.verified); // truePackages
| Package | Description |
|---------|-------------|
| @memorymerge/core | Core SDK — storage, memory, reflection, Merkle |
| @memorymerge/openclaw | OpenClaw skill integration |
