feat: add infinite agent memory with MCP integration
Implement comprehensive conversation management system enabling AI agents like Claude Code to maintain infinite context and history. Provides semantic search, smart context retrieval, and automatic artifact linking using Brainy's existing Triple Intelligence infrastructure. Core Features: - ConversationManager API for message storage and retrieval - MCP protocol integration with 6 tools for Claude Code - Context ranking using semantic, temporal, and graph scoring - Neural clustering for theme discovery and deduplication - Virtual filesystem integration for code artifact linking - CLI commands for setup and management Zero new infrastructure required - uses existing Brainy features: - Storage via brain.add() with NounType.Message - Relationships via brain.relate() with VerbType.Precedes - Search via brain.find() with Triple Intelligence - Clustering via brain.neural() - Artifacts via brain.vfs() One-command setup: brainy conversation setup Version: 3.19.0
This commit is contained in:
parent
e3a21c6075
commit
ced639cab1
15 changed files with 3304 additions and 7 deletions
|
|
@ -13,6 +13,7 @@ import { Brainy } from '../brainy.js'
|
|||
import { neuralCommands } from './commands/neural.js'
|
||||
import { coreCommands } from './commands/core.js'
|
||||
import { utilityCommands } from './commands/utility.js'
|
||||
import conversationCommand from './commands/conversation.js'
|
||||
import { version } from '../package.json'
|
||||
|
||||
// CLI Configuration
|
||||
|
|
@ -137,6 +138,55 @@ program
|
|||
.option('-o, --output <file>', 'Output file')
|
||||
.action(neuralCommands.visualize)
|
||||
|
||||
// ===== Conversation Commands (Infinite Memory) =====
|
||||
|
||||
program
|
||||
.command('conversation')
|
||||
.alias('conv')
|
||||
.description('💬 Infinite agent memory and context management')
|
||||
.addCommand(
|
||||
new Command('setup')
|
||||
.description('Set up MCP server for Claude Code integration')
|
||||
.action(async () => {
|
||||
await conversationCommand.handler({ action: 'setup', _: [] })
|
||||
})
|
||||
)
|
||||
.addCommand(
|
||||
new Command('search')
|
||||
.description('Search messages across conversations')
|
||||
.requiredOption('-q, --query <query>', 'Search query')
|
||||
.option('-c, --conversation-id <id>', 'Filter by conversation')
|
||||
.option('-r, --role <role>', 'Filter by role')
|
||||
.option('-l, --limit <number>', 'Maximum results', '10')
|
||||
.action(async (options) => {
|
||||
await conversationCommand.handler({ action: 'search', ...options as any, _: [] })
|
||||
})
|
||||
)
|
||||
.addCommand(
|
||||
new Command('context')
|
||||
.description('Get relevant context for a query')
|
||||
.requiredOption('-q, --query <query>', 'Context query')
|
||||
.option('-l, --limit <number>', 'Maximum messages', '10')
|
||||
.action(async (options) => {
|
||||
await conversationCommand.handler({ action: 'context', ...options as any, _: [] })
|
||||
})
|
||||
)
|
||||
.addCommand(
|
||||
new Command('thread')
|
||||
.description('Get full conversation thread')
|
||||
.requiredOption('-c, --conversation-id <id>', 'Conversation ID')
|
||||
.action(async (options) => {
|
||||
await conversationCommand.handler({ action: 'thread', ...options as any, _: [] })
|
||||
})
|
||||
)
|
||||
.addCommand(
|
||||
new Command('stats')
|
||||
.description('Show conversation statistics')
|
||||
.action(async () => {
|
||||
await conversationCommand.handler({ action: 'stats', _: [] })
|
||||
})
|
||||
)
|
||||
|
||||
// ===== Utility Commands =====
|
||||
|
||||
program
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue