LimbicDB Integration Guide
Complete guide for integrating LimbicDB with AI assistants and platforms.
🎯 Quick Integration (5 Minutes)
For AI Assistants:
Copy the System Prompt Template
bash# English cp templates/system-prompt.en.md /path/to/your/ai/system-prompt.md # Chinese cp templates/system-prompt.zh-CN.md /path/to/your/ai/system-prompt.mdAdd to Your AI's Configuration
- Paste the template content into your system prompt
- Or reference it in your config file
Restart Your AI
- The AI will now have access to LimbicDB commands
Test It
bashlimbicdb remember "Integration test successful" limbicdb recall "test"
🤖 Platform-Specific Guides
OpenClaw
Method 1: System Prompt (Recommended)
Add to OpenClaw Config
Edit your OpenClaw configuration:
json{ "systemPrompt": { "append": "path/to/limbicdb/templates/system-prompt.zh-CN.md" } }Restart OpenClaw
bashopenclaw gateway restartVerify
- Start a new session
- Say something important
- The AI should automatically store it
Method 2: MCP Server
Configure MCP in OpenClaw
Add to your OpenClaw config:
json{ "mcp": { "servers": [ { "name": "limbicdb", "command": "npx", "args": ["limbicdb-mcp"], "cwd": "/path/to/workspace" } ] } }Restart OpenClaw
bashopenclaw gateway restartUse in Conversations
- LimbicDB tools will appear automatically
- AI can call them without manual commands
Claude Code
MCP Server Integration
Create Claude Code Config
Create or edit
~/.claude/settings.json:json{ "mcpServers": { "limbicdb": { "command": "npx", "args": ["limbicdb-mcp"], "cwd": "/path/to/workspace" } } }Restart Claude Code
bashclaudeVerify Tools
- Type
/toolsin Claude Code - You should see LimbicDB tools listed
- Type
System Prompt Integration
Copy Template
bashcp templates/system-prompt.en.md ~/.claude/system-prompt.mdAdd to Claude Code Config
json{ "systemPrompt": "~/.claude/system-prompt.md" }
Codex (OpenAI)
System Prompt Only
Codex doesn't support MCP yet, so use system prompt:
Copy Template Content
bashcat templates/system-prompt.en.mdAdd to Your Codex Config
- Paste into your system prompt configuration
- Or add to your API call's
systemparameter
Enable CLI Access
- Ensure Codex can execute shell commands
- Or use the Node.js API (see below)
Custom AI Platforms
CLI Mode
If your AI can execute shell commands:
# Store memory
limbicdb remember "User preference: TypeScript"
# Retrieve memory
limbicdb recall "programming languages"
# Check conflicts
limbicdb conflictsExample Integration Code:
async function storeMemory(content) {
const { exec } = require('child_process');
return new Promise((resolve, reject) => {
exec(`limbicdb remember "${content}"`, (error, stdout, stderr) => {
if (error) reject(error);
else resolve(stdout);
});
});
}
async function retrieveMemory(query) {
const { exec } = require('child_process');
return new Promise((resolve, reject) => {
exec(`limbicdb recall "${query}"`, (error, stdout, stderr) => {
if (error) reject(error);
else resolve(stdout);
});
});
}Node.js API
For direct integration:
import { open } from 'limbicdb';
// Open database
const db = open('./agent.limbic');
// Store memory
await db.remember('User prefers dark mode', {
sessionId: 'current',
scope: 'core'
});
// Retrieve memories
const memories = await db.recall('preferences', {
limit: 10,
scopes: ['core', 'session']
});
// Check conflicts
const conflicts = await db.conflicts();
// Close database
await db.close();Installation:
npm install limbicdbPython API
from limbicdb import open as ldb_open
# Open database
with ldb_open('./agent.limbic') as db:
# Store memory
db.remember('User prefers dark mode')
# Retrieve memories
result = db.recall('preferences', limit=10)
# Check conflicts
conflicts = db.conflicts()Installation:
pip install limbicdb🔧 Advanced Configuration
Database Location
By default, LimbicDB stores data in the current directory:
# Default
./agent.limbic
# Custom location
limbicdb remember "test" --db /path/to/custom.limbicEnvironment Variable:
export LIMBICDB_PATH=/path/to/custom.limbic
limbicdb remember "test"Memory Scopes
LimbicDB supports three scopes:
| Scope | Description | Use Case |
|---|---|---|
core | Long-term, persistent | User preferences, identity |
session | Session-specific | Current conversation context |
project | Project-specific | Project-related memories |
Example:
# Core memory (always available)
limbicdb remember "User's name is Alex" --scope core
# Session memory (current conversation only)
limbicdb remember "Discussing README" --scope session
# Project memory (project-specific)
limbicdb remember "Using SQLite" --scope projectSession Management
# List all sessions
limbicdb sessions
# Switch to specific session
limbicdb sessions switch <session-id>
# Archive old session
limbicdb sessions archive <session-id>
# Delete session
limbicdb sessions delete <session-id>🎯 Best Practices
For AI Developers
DO ✅
- Store immediately: When user shares important info, store it right away
- Confirm storage: Tell the user "I've noted that..."
- Check before answering: Query LimbicDB before answering questions about the past
- Surface conflicts: Proactively point out contradictions
- Use appropriate scopes: Core for identity, session for context, project for work
DON'T ❌
- Don't store everything: Be selective about what's important
- Don't retrieve without reason: Only query when relevant
- Don't ignore conflicts: Address them when they appear
- Don't assume you remember: Actually check LimbicDB
- Don't expose technical commands: Keep CLI commands internal unless asked
Memory Storage Guidelines
Store These:
- ✅ Personal preferences (likes, dislikes, favorites)
- ✅ Projects and goals
- ✅ Important dates and deadlines
- ✅ Relationships (family, friends, colleagues)
- ✅ Skills and expertise
- ✅ Location/timezone
- ✅ Health information (if shared)
Don't Store:
- ❌ Casual conversation
- ❌ Temporary context (use session scope instead)
- ❌ Sensitive data (passwords, financial info)
- ❌ Everything the user says
Conflict Resolution
When conflicts are detected:
Inform the User
"I notice there might be some conflicting information here. Earlier you mentioned X, but now you're saying Y. Which one is current?"Offer to Update
"Would you like me to update the memory for you?"Use
forgetif Neededbashlimbicdb forget <old-memory-id> limbicdb remember "new correct information"
📊 Integration Examples
Example 1: Personal Assistant AI
class PersonalAssistant {
constructor() {
this.db = await open('./assistant.limbic');
}
async handleMessage(message) {
// Check for important info to store
const importantInfo = this.extractImportantInfo(message);
if (importantInfo) {
await this.db.remember(importantInfo, { scope: 'core' });
console.log(`I've noted that ${importantInfo}`);
}
// Check for questions about the past
if (this.isPastQuestion(message)) {
const query = this.extractQuery(message);
const memories = await this.db.recall(query);
return this.formatResponse(memories);
}
// Check for conflicts
const conflicts = await this.db.conflicts();
if (conflicts.length > 0) {
return this.handleConflicts(conflicts);
}
// Normal response
return this.generateResponse(message);
}
extractImportantInfo(message) {
// Implement your logic here
// Look for patterns like "I like", "I prefer", "My name is", etc.
}
isPastQuestion(message) {
return /do you remember|did i|what did i|tell you about/i.test(message);
}
extractQuery(message) {
// Extract the topic from the question
}
formatResponse(memories) {
// Format memories as a natural response
}
handleConflicts(conflicts) {
// Present conflicts to the user
}
}Example 2: Project Management AI
class ProjectAssistant {
constructor(projectName) {
this.db = await open(`./${projectName}.limbic`);
this.projectName = projectName;
}
async startMeeting() {
await this.db.remember(`Meeting started at ${new Date()}`, {
sessionId: 'current',
scope: 'session'
});
}
async captureDecision(decision) {
await this.db.remember(`Decision: ${decision}`, {
sessionId: 'current',
scope: 'project'
});
}
async endMeeting() {
const summary = await this.db.recall('', {
sessionId: 'current',
limit: 100
});
await this.db.archiveSession('current');
return this.generateSummary(summary);
}
async getProjectHistory() {
return await this.db.timeline(this.projectName);
}
}Example 3: Research Assistant AI
class ResearchAssistant {
constructor() {
this.db = await open('./research.limbic');
}
async readPaper(title, findings) {
await this.db.remember(`Paper: ${title}`, { scope: 'project' });
await this.db.remember(`Findings: ${findings}`, { scope: 'project' });
}
async findRelatedPapers(topic) {
const memories = await this.db.search(topic);
return memories.filter(m => m.content.includes('Paper:'));
}
async trackResearchProgress() {
const timeline = await this.db.timeline('research');
return this.generateProgressReport(timeline);
}
}🚨 Troubleshooting
AI Not Storing Memories
Problem: AI isn't calling limbicdb remember
Solutions:
- Check that the system prompt template is loaded
- Verify the AI has CLI execution permissions
- Add explicit instructions: "When the user shares important info, call limbicdb remember"
AI Not Retrieving Memories
Problem: AI isn't checking LimbicDB before answering
Solutions:
- Add to system prompt: "Before answering questions about the past, always call limbicdb recall"
- Test with explicit questions: "What did I tell you about X?"
- Check that the database file exists and has data
Conflicts Not Detected
Problem: Contradictory memories aren't flagged
Solutions:
- Ensure
limbicdb conflictsis called regularly - Check that memories are being stored with consistent keywords
- Verify the conflict detection logic is working
Database Not Found
Problem: "Database not found" error
Solutions:
# Check current directory
pwd
# Specify database path
limbicdb remember "test" --db /full/path/to/agent.limbic
# Or set environment variable
export LIMBICDB_PATH=/full/path/to/agent.limbicPermission Denied
Problem: "Permission denied" when running commands
Solutions:
# Fix permissions
chmod +x /usr/local/bin/limbicdb
chmod +x /usr/local/bin/limbicdb-mcp
# Or reinstall
npm install -g limbicdb --unsafe-perm📚 Additional Resources
- README.md - Project overview
- ARCHITECTURE.md - System design
- CLI Reference - Command documentation
- API Reference - Node.js/Python API
- Troubleshooting - Common issues
🆘 Need Help?
- 📖 Read the documentation
- 🐛 Report issues
- 💬 Join discussions
- 📧 Contact: Kousoyu
Integration Guide Version: 1.0 | LimbicDB v2.1.1+