feat: VLM summary vector storage in Qdrant for semantic search
- Add upsert_vlm_embedding to QdrantDb with trace_id in payload
- chunk_id format: {file_uuid}_t{trace_id_hex} for search enrichment
- Update enrich_vlm_from_pg to extract trace_id from chunk_id
- VLM summary now searchable via semantic search with source_type=vlm
This commit is contained in:
@@ -237,11 +237,13 @@ async fn process_single_trace(
|
||||
}
|
||||
};
|
||||
|
||||
// Generate Qdrant point_id (unique u64 hash)
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
// Generate Qdrant point_id in format: {file_uuid}_t{trace_id_hex}
|
||||
// This matches the format expected by enrich_vlm_from_pg in search.rs
|
||||
let point_id_str = format!("{}_t{:x}", file_uuid, trace_id);
|
||||
let point_id: u64 = std::collections::hash_map::DefaultHasher::new().finish();
|
||||
use std::hash::{Hash, Hasher};
|
||||
let mut hasher = DefaultHasher::new();
|
||||
format!("{}_{}", file_uuid, trace_id).hash(&mut hasher);
|
||||
let mut hasher = std::collections::hash_map::DefaultHasher::new();
|
||||
point_id_str.hash(&mut hasher);
|
||||
let point_id = hasher.finish();
|
||||
|
||||
// Store embedding in DB
|
||||
@@ -261,17 +263,15 @@ async fn process_single_trace(
|
||||
);
|
||||
}
|
||||
|
||||
// Store in Qdrant (using u64 ID)
|
||||
// Store in Qdrant (using u64 ID) with trace_id in payload
|
||||
let qdrant = QdrantDb::new();
|
||||
if let Err(e) = qdrant
|
||||
.upsert_chunk_embedding_u64(
|
||||
.upsert_vlm_embedding(
|
||||
point_id,
|
||||
&vector,
|
||||
"vlm_summary",
|
||||
file_uuid,
|
||||
trace_id,
|
||||
&summary,
|
||||
0.0,
|
||||
0.0,
|
||||
)
|
||||
.await
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user