clawdb_client/lib.rs
1//! # ClawDB Rust Client
2//!
3//! Official Rust SDK for [ClawDB](https://clawdb.io) — the cognitive database for AI agents.
4//!
5//! ## Quick Start
6//!
7//! ```rust,no_run
8//! use clawdb_client::ClawDBClient;
9//!
10//! #[tokio::main]
11//! async fn main() -> clawdb_client::Result<()> {
12//! let db = ClawDBClient::auto_provision().await?;
13//!
14//! // Store a memory
15//! let id = db.remember("The user prefers concise answers").await?;
16//! println!("Stored: {id}");
17//!
18//! // Search semantically
19//! let results = db.search("user preferences", Default::default()).await?;
20//! for r in results {
21//! println!(" [{:.2}] {}", r.score, r.content);
22//! }
23//!
24//! db.close();
25//! Ok(())
26//! }
27//! ```
28
29pub mod builder;
30pub mod client;
31pub mod error;
32pub mod models;
33
34pub use builder::ClawDBBuilder;
35pub use client::{ClawDB, ClawDBClient};
36pub use error::{SdkError, SdkResult};
37pub use models::{
38 BranchInfo, DiffResult, HealthResponse, MemoryRecord, MemoryType, MergeResult, ReflectJob,
39 RememberOptions, SearchHit, SearchOptions, SessionInfo, SyncActionResult, SyncResult,
40 SyncStatusResult, TxInfo,
41};
42
43pub type Result<T> = SdkResult<T>;
44
45pub const VERSION: &str = env!("CARGO_PKG_VERSION");
46
47/// Prelude — import this for the most commonly used types.
48pub mod prelude {
49 pub use crate::{ClawDBClient, Result, SdkError, SdkResult, SearchOptions};
50}