1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! # Memory MCP (Model Context Protocol) Integration
//!
//! This crate provides MCP server integration for the self-learning memory system,
//! enabling memory queries and pattern analysis through standardized tool interfaces.
//!
//! ## Features
//!
//! - **MCP Server**: Standard MCP server implementation with tool definitions
//! - **Memory Integration**: Query episodic memory and analyze patterns
//! - **Progressive Disclosure**: Tools are prioritized based on usage patterns
//! - **Execution Monitoring**: Detailed statistics and logging
//!
//! ## Example
//!
//! ```no_run
//! use do_memory_core::SelfLearningMemory;
//! use do_memory_mcp::server::MemoryMCPServer;
//! use do_memory_mcp::types::SandboxConfig;
//! use std::sync::Arc;
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! // Create memory and server
//! let memory = Arc::new(SelfLearningMemory::new());
//! let server = MemoryMCPServer::new(SandboxConfig::default(), memory).await?;
//!
//! // List available tools
//! let tools = server.list_tools().await;
//! for tool in tools {
//! println!("Tool: {} - {}", tool.name, tool.description);
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────┐
//! │ MCP Server │
//! │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
//! │ │ Query Memory │ │ Analyze │ │ Execute │ │
//! │ │ │ │ Patterns │ │ Operations │ │
//! │ └──────────────┘ └──────────────┘ └──────────────┘ │
//! └───────────────────────┬─────────────────────────────────┘
//! │
//! ┌──────────────┴──────────────┐
//! ▼ ▼
//! ┌─────────────────┐ ┌──────────────────┐
//! │ Memory System │ │ Monitoring │
//! │ - Episodes │ │ - Metrics │
//! │ - Patterns │ │ - Health │
//! │ - Heuristics │ │ │
//! └─────────────────┘ └──────────────────┘
//! ```
// Re-export commonly used types
pub use ;
pub use ;
pub use ;
pub use CodeSandbox;
pub use ;
pub use MemoryMCPServer;
pub use ;
pub use ;