agentroot_core/db/
mod.rs

1//! Database layer for agentroot
2//!
3//! Provides SQLite-based storage with:
4//! - FTS5 full-text search
5//! - sqlite-vec vector storage
6//! - Content-addressable storage
7
8mod collections;
9mod content;
10mod context;
11mod documents;
12pub mod metadata;
13mod schema;
14mod stats;
15mod user_metadata;
16pub mod vectors;
17
18pub use collections::CollectionInfo;
19pub use content::{docid_from_hash, hash_content};
20pub use context::ContextInfo;
21pub use documents::DocumentInsert;
22pub use metadata::{MetadataBuilder, MetadataFilter, MetadataValue, UserMetadata};
23pub use schema::Database;
24use std::path::PathBuf;
25pub use vectors::CacheLookupResult;
26
27impl Database {
28    /// Get the default database path
29    pub fn default_path() -> PathBuf {
30        dirs::cache_dir()
31            .unwrap_or_else(|| PathBuf::from("."))
32            .join(crate::CACHE_DIR_NAME)
33            .join("index.sqlite")
34    }
35}