From 1d485ca5c9dd8dadfff6fe0d778323b292a4cb0f Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Tue, 24 Mar 2026 06:07:06 +0000 Subject: [PATCH] Fix dedup threshold postgres type --- src/db.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/db.rs b/src/db.rs index 1c9f478..a20a86a 100644 --- a/src/db.rs +++ b/src/db.rs @@ -77,7 +77,7 @@ async fn find_dedup_match( client: &C, agent_id: &str, embedding: &Vector, - threshold: f32, + threshold: f64, ) -> Result> where C: GenericClient + Sync, @@ -144,6 +144,7 @@ impl Database { ) -> Result { let client = self.pool.get().await?; let vector = Vector::from(embedding.to_vec()); + let dedup_threshold = dedup_threshold as f64; if let Some(existing) = find_dedup_match(&client, agent_id, &vector, dedup_threshold).await? { let merged_metadata = merge_metadata(&existing.metadata, &metadata); @@ -372,6 +373,7 @@ impl Database { let mut client = self.pool.get().await?; let transaction = client.transaction().await?; let mut results = Vec::with_capacity(entries.len()); + let dedup_threshold = dedup_threshold as f64; for (content, metadata, embedding, keywords, expires_at) in entries { let vector = Vector::from(embedding);