Skip to content
Merged

Dev #60

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4d5121b
skills update
sopaco Mar 17, 2026
8107b45
Implement data directory resolution with config and env var support
sopaco Mar 18, 2026
33ff6c7
Add tiered memory access and filesystem browsing tools
sopaco Mar 18, 2026
d440a77
Add optional log file argument and conditional logging initialization
sopaco Mar 18, 2026
4bf5910
Update SKILL.md
sopaco Mar 18, 2026
24e6232
skills update
sopaco Mar 18, 2026
6473273
skills update
sopaco Mar 18, 2026
d8b628e
Update MemClaw plugin with tiered memory access and filesystem browsing
sopaco Mar 18, 2026
a313139
update pre-compile binaries for memclaw
sopaco Mar 18, 2026
422ea41
skills update
sopaco Mar 18, 2026
3f243b3
Change file paths from data_dir/cortex to direct data_dir
sopaco Mar 18, 2026
dc95610
Update cortex-mem-service
sopaco Mar 18, 2026
e81da28
Bump @memclaw/bin-darwin-arm64 to v0.1.2
sopaco Mar 18, 2026
25a24a1
Fix repository URL format in package.json files
sopaco Mar 18, 2026
2e98b02
Bump version to 0.9.19
sopaco Mar 18, 2026
5e3d98f
Bump version to 0.9.20 and update API endpoints
sopaco Mar 18, 2026
06202e2
skills update
sopaco Mar 19, 2026
54364af
README update
sopaco Mar 19, 2026
2036c3e
Update documentation to disable memorySearch
sopaco Mar 19, 2026
bd5b02b
Refactor MemClaw documentation for clarity and conciseness
sopaco Mar 19, 2026
4672de2
Update memclaw skill description and add migration features
sopaco Mar 19, 2026
0c2554f
Update MemClaw skill documentation
sopaco Mar 19, 2026
66cd6c2
Update MemClaw documentation with improved descriptions and
sopaco Mar 19, 2026
d47b219
Bump version to 0.9.25 and update plugin configuration
sopaco Mar 19, 2026
f5ebf7d
Add log file option to cortex-mem-service and update plugin binary
sopaco Mar 19, 2026
f363572
Bump version to 0.9.26
sopaco Mar 19, 2026
dc95ce1
Improve abstract text handling for file vs directory results
sopaco Mar 19, 2026
e3b2001
Set missing cortex data_dir to TARS app data dir
sopaco Mar 19, 2026
79d0155
Add Linux x64 support to MemClaw plugin and examples
sopaco Mar 19, 2026
e41d7c2
Update example binary README with new checksum and size
sopaco Mar 19, 2026
f045623
Update reqwest dependency and add binary files for memclaw example
sopaco Mar 19, 2026
374713d
Update package versions and add Linux x64 binary dependency
sopaco Mar 19, 2026
363c2c9
Convert single quotes to double quotes in plugin dist file
sopaco Mar 19, 2026
f2ea23a
Add Linux x64 support and update documentation
sopaco Mar 20, 2026
0235232
Rename cortex_close_session to cortex_commit_session and add Linux x64
sopaco Mar 20, 2026
ec83478
Merge branch 'dev' of https://github.com/sopaco/cortex-mem into dev
sopaco Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ chrono = { version = "0.4", features = ["serde"] }
rig-core = "0.31"

# HTTP client
reqwest = { version = "0.12", features = ["json"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }

# Logging
tracing = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ The benchmark uses a professional memory system evaluation framework located in
- **Professional Metrics**: Recall@K, Precision@K, MRR, NDCG, and answer quality metrics
- **Enhanced Dataset**: 50 conversations with 150 questions covering various scenarios
- **Statistical Analysis**: 95% confidence intervals, standard deviation, and category-based statistics
- **Multi-System Support**: Supports comparison between Cortex Memory, LangMem, and Simple RAG baselines
- **Cortex-Only Evaluation**: Dedicated evaluation workflow for Cortex Memory using the LoCoMo methodology

For more details on running the evaluation, see the [lomoco-evaluation README](examples/lomoco-evaluation/README.md).

Expand Down
2 changes: 1 addition & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ Cortex Memory已使用**LOCOMO数据集**(50个对话,150个问题)通过
- **专业指标**:Recall@K、Precision@K、MRR、NDCG和答案质量指标
- **增强数据集**:50个对话,150个问题,涵盖各种场景
- **统计分析**:95%置信区间、标准差和基于类别的统计
- **多系统支持**:支持Cortex Memory、LangMem和简单RAG基线之间的比较
- **Cortex 专用评测**:基于 LoCoMo 方法的 Cortex Memory 专用评测流程

有关运行评估的更多详细信息,请参阅[lomoco-evaluation README](examples/lomoco-evaluation/README.md)。

Expand Down
21 changes: 20 additions & 1 deletion cortex-mem-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,26 @@ async fn main() -> Result<()> {
})?;

// Determine data directory
let data_dir = config.cortex.data_dir();
// Priority:
// 1. data_dir specified in config file (supports relative path to config file location)
// 2. CORTEX_DATA_DIR environment variable
// 3. Directory containing config.toml (the workspace root)
let config_dir = cli.config.parent().map(|p| p.to_path_buf()).unwrap_or_default();

let data_dir = if let Some(ref dir) = config.cortex.data_dir {
// If data_dir is a relative path, resolve it relative to config file location
let dir_path = std::path::Path::new(dir);
if dir_path.is_relative() {
config_dir.join(dir_path).to_string_lossy().to_string()
} else {
dir.clone()
}
} else if let Ok(env_dir) = std::env::var("CORTEX_DATA_DIR") {
env_dir
} else {
// Use the directory containing config.toml as the workspace root
config_dir.to_string_lossy().to_string()
};

// Handle tenant list command early (doesn't need MemoryOperations)
if let Commands::Tenant { action } = cli.command {
Expand Down
19 changes: 6 additions & 13 deletions cortex-mem-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,22 @@ fn default_enable_intent_analysis() -> bool {

impl CortexConfig {
/// Get the effective data directory
/// Returns the configured data_dir, or falls back to default behavior.
/// Note: Callers should handle the None case appropriately based on their context.
pub fn data_dir(&self) -> String {
self.data_dir.clone().unwrap_or_else(|| {
Self::default_data_dir()
})
}

/// Get the default data directory
/// Priority:
/// 1. Environment variable CORTEX_DATA_DIR
/// 2. Current directory "."
fn default_data_dir() -> String {
// 优先级:
// 1. 环境变量 CORTEX_DATA_DIR
// 2. 应用数据目录/cortex (TARS 应用)
// 3. 当前目录 ./.cortex
std::env::var("CORTEX_DATA_DIR")
.ok()
.or_else(|| {
// 尝试使用应用数据目录(TARS 默认路径)
directories::ProjectDirs::from("com", "cortex-mem", "tars")
.map(|dirs| {
let cortex_dir = dirs.data_dir().join("cortex");
cortex_dir.to_string_lossy().to_string()
})
})
.unwrap_or_else(|| "./.cortex".to_string())
.unwrap_or_else(|| ".".to_string())
}
}

Expand Down
5 changes: 4 additions & 1 deletion cortex-mem-insights/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ class ApiClient {

// Filesystem endpoints
async listDirectory(path: string): Promise<FileEntryResponse[]> {
return this.request<FileEntryResponse[]>(`/filesystem/list?uri=${encodeURIComponent(path)}`);
const response = await this.request<{ uri: string; total: number; entries: FileEntryResponse[] }>(
`/filesystem/list?uri=${encodeURIComponent(path)}`
);
return response.entries;
}

async readFile(path: string): Promise<string> {
Expand Down
6 changes: 6 additions & 0 deletions cortex-mem-insights/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export interface FileEntryResponse {
modified: string;
}

export interface LsResponse {
uri: string;
total: number;
entries: FileEntryResponse[];
}

export interface SessionInfo {
thread_id: string;
status: string;
Expand Down
27 changes: 23 additions & 4 deletions cortex-mem-mcp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,35 @@ struct Cli {
/// Disable auto-trigger feature
#[arg(long, default_value = "false")]
no_auto_trigger: bool,

/// Path to log file. If specified, logs will be written to this file.
/// If not specified, logging is disabled (MCP protocol uses stdio).
#[arg(long)]
log_file: Option<PathBuf>,
}

#[tokio::main]
async fn main() -> Result<()> {
let cli = Cli::parse();

// Initialize logging
tracing_subscriber::fmt()
.with_max_level(tracing::Level::INFO)
.init();
// Initialize logging only if --log-file is specified
// MCP protocol uses stdio for JSON-RPC, so we avoid console output by default
if let Some(ref log_file) = cli.log_file {
// Create parent directory if needed
if let Some(parent) = log_file.parent() {
std::fs::create_dir_all(parent)?;
}

let file = std::fs::OpenOptions::new()
.create(true)
.append(true)
.open(log_file)?;

tracing_subscriber::fmt()
.with_writer(std::sync::Arc::new(file))
.with_max_level(tracing::Level::INFO)
.init();
}

info!("Starting Cortex Memory MCP Server");
info!("Using configuration file: {:?}", cli.config);
Expand Down
Loading
Loading