Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 10 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ cargo run --release
cargo run --release -- --verbose

# Run CLI commands
cargo run --release -- init # Initialize project
cargo run --release -- stats # Show database statistics
cargo run --release -- list # List stored items
cargo run --release -- init # Initialize project
cargo run --release -- stats # Show database statistics
cargo run --release -- list # List stored items
cargo run --release -- list --scope global # List global items
cargo run --release -- store "some content" # Store content
cargo run --release -- store - # Store from stdin
cargo run --release -- recall "search query" # Semantic search
cargo run --release -- forget <id> # Delete an item
cargo run --release -- --json list # JSON output (any command)

# Run tests (requires model download on first run)
cargo test
Expand All @@ -38,7 +44,7 @@ Sediment is a semantic memory system for AI agents, running as an MCP (Model Con

### Core Components

- **`src/main.rs`** - CLI entry point with subcommands (init, stats, list) and MCP server startup
- **`src/main.rs`** - CLI entry point with subcommands (init, stats, list, store, recall, forget) and MCP server startup
- **`src/lib.rs`** - Library root exposing public API, project detection, scope types, and project ID migration
- **`src/db.rs`** - LanceDB wrapper handling vector storage, hybrid search (vector + FTS/BM25), and CRUD operations
- **`src/embedder.rs`** - Local embeddings using `all-MiniLM-L6-v2` via Candle (384-dim vectors)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sediment-mcp"
version = "0.4.4"
version = "0.5.0"
edition = "2024"
repository = "https://github.com/rendro/sediment"
homepage = "https://github.com/rendro/sediment"
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,19 @@ Go to **Settings > Tools > AI Assistant > MCP Servers**, click **+**, and add:
## CLI

```bash
sediment # Start MCP server
sediment init # Set up Claude Code integration
sediment stats # Show database statistics
sediment list # List stored items
sediment # Start MCP server
sediment init # Set up Claude Code integration
sediment stats # Show database statistics
sediment list # List stored items
sediment list --scope global # List global items
sediment store "some content" # Store content
sediment store - # Store content from stdin
sediment recall "search query" # Search by semantic similarity
sediment forget <id> # Delete an item by ID
```

All commands support `--json` for machine-readable output.

## How It Works

### Two-Database Hybrid
Expand Down
2 changes: 1 addition & 1 deletion src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn sanitize_sql_string(s: &str) -> String {
/// Validate that a string looks like a valid item/project ID (UUID hex + hyphens).
/// Returns true if the string only contains safe characters for SQL interpolation.
/// Use this as an additional guard before `sanitize_sql_string` for ID fields.
pub(crate) fn is_valid_id(s: &str) -> bool {
pub fn is_valid_id(s: &str) -> bool {
!s.is_empty() && s.len() <= 64 && s.chars().all(|c| c.is_ascii_hexdigit() || c == '-')
}

Expand Down
Loading