Expand description
Semantic operations for intelligent file management.
This module provides AI-powered file operations based on vector embeddings:
- File organization by topic/similarity
- Duplicate detection
- Cleanup analysis
- Similar file discovery
All operations follow a Propose-Review-Apply pattern for safety.
Re-exportsยง
use chrono::DateTime;๐use chrono::Utc;๐use ragfs_core::Chunk;๐use ragfs_core::DistanceMetric;๐use ragfs_core::Embedder;๐use ragfs_core::EmbeddingConfig;๐use ragfs_core::FileRecord;๐use ragfs_core::SearchQuery;๐use ragfs_core::VectorStore;๐use serde::Deserialize;๐use serde::Deserialize;๐use serde::Serialize;๐use serde::Serialize;๐use std::collections::HashMap;๐use std::collections::HashSet;๐use std::fs;๐use std::path::Path;๐use std::path::PathBuf;๐use std::sync::Arc;๐use tokio::sync::RwLock;๐use tracing::debug;๐use tracing::info;๐use tracing::warn;๐use uuid::Uuid;๐
Structsยง
- Action
Result - Result of executing a plan action.
- Cleanup
Analysis - Analysis of cleanup candidates.
- Cleanup
Candidate - A file that could be cleaned up.
- Duplicate
Entry - A duplicate file entry.
- Duplicate
Group - A group of similar files.
- Duplicate
Groups - Groups of duplicate/similar files.
- Organize
Request - Request to organize files in a directory.
- Plan
Action - A single action in a plan.
- Plan
Impact - Impact summary of a plan.
- Semantic
Config - Configuration for semantic operations.
- Semantic
Manager - Semantic manager for intelligent file operations.
- Semantic
Plan - A proposed semantic operation plan.
- Similar
File - A similar file.
- Similar
Files Result - Result of finding similar files.
Enumsยง
- Action
Type - Type of file action.
- Cleanup
Reason - Reason a file is suggested for cleanup.
- Organize
Strategy - Strategy for organizing files.
- Plan
Operation - Type of semantic operation.
- Plan
Status - Status of a plan.
Functionsยง
- cosine_
similarity ๐ - Calculate cosine similarity between two embeddings.
- default_
max_ ๐groups - default_
similarity_ ๐threshold - truncate_
content ๐ - Truncate content for preview.