Documentation
Everything you need to integrate MemoryGuard with your AI agents.
Quick Start
Installation
npm install @memoryguard/sdkInitialize
import { MemoryGuard } from '@memoryguard/sdk';
const mg = new MemoryGuard({
apiKey: 'mg_live_...',
agentId: 'support-agent-1'
});Connect Memory
// LangChain example
mg.connect({
source: 'langchain',
memoryStore: vectorStore,
conversationMemory: bufferMemory
});Run First Scan
const report = await mg.scan();
console.log(report.piiFound); // 127
console.log(report.hygieneScore); // 94Integrations
LangChain
mg.connect({
source: 'langchain',
memoryStore: vectorStore
});AutoGen
mg.connect({
source: 'autogen',
groupChat: groupChat
});Custom Agent
mg.connect({
source: 'custom',
fetchMemory: async () => [...],
writeMemory: async (cleaned) => {...}
});Configuration
Custom PII Rules
mg.addRule({
name: 'internal-id',
pattern: /EMP-\d{6}/g,
type: 'employee_id',
action: 'redact'
});Schedule Hygiene
mg.schedule({
frequency: 'daily',
time: '02:00',
timezone: 'UTC',
notify: ['ops@company.com']
});Whitelist Patterns
mg.whitelist([
'support@company.com',
/company\.com$/,
{ type: 'name', value: 'MemoryGuard' }
]);Need help?
Check out our API reference at docs.memoryguard.io/api, join our community Slack, or email support@memoryguard.io.