Refactor vector search to utilize Qdrant VectorDB
This commit is contained in:
1 parent
61c0e88ad8
commit
3add6c3d31
4 files changed
+99
-31
No files matched your search
@@ -13,6 +13,7 @@ mod router;
|
||||
mod search;
|
||||
pub mod embedding;
|
||||
pub mod indexer;
|
||||
pub mod vector_db;
|
||||
mod state;
|
||||
mod store;
|
||||
mod tools;
|
||||
@@ -545,6 +546,18 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
rt.block_on(async {
|
||||
let state = Arc::new(MemoryState::new(&base.to_string_lossy()));
|
||||
|
||||
// Initialize Qdrant VectorDB (default local URL)
|
||||
match crate::vector_db::VectorDB::new("http://localhost:6334", "mcp_memory").await {
|
||||
Ok(vdb) => {
|
||||
tracing::info!("Successfully connected to Qdrant vector database");
|
||||
*state.vector_db.write().await = Some(vdb);
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::warn!("Failed to initialize Qdrant vector database: {}. Vector search will fallback to manual embedding loop. (Is Qdrant running on localhost:6334?)", e);
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(e) = run_server(state).await {
|
||||
tracing::error!("Server error: {}", e);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user