mirror of
https://github.com/NVIDIA/dgx-spark-playbooks.git
synced 2026-04-27 20:23:52 +00:00
- Migrate from Pinecone to Qdrant vector database for native ARM64 support - Add Qdrant service with automatic collection initialization in docker-compose - Implement QdrantService with UUID-based point IDs to meet Qdrant requirements - Update all API routes and frontend components to use Qdrant - Enhance Storage Connections UI with detailed stats (vectors, status, dimensions) - Add icons and tooltips to Vector DB section matching Graph DB UX
27 lines
909 B
TypeScript
27 lines
909 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
import { QdrantService } from '@/lib/qdrant';
|
|
|
|
/**
|
|
* Clear all data from the Pinecone vector database
|
|
* POST /api/pinecone-diag/clear
|
|
*/
|
|
export async function POST() {
|
|
// Get the Pinecone service instance
|
|
const pineconeService = QdrantService.getInstance();
|
|
|
|
// Clear all vectors from the database
|
|
const deleteSuccess = await pineconeService.deleteAllEntities();
|
|
|
|
// Get updated stats after clearing
|
|
const stats = await pineconeService.getStats();
|
|
|
|
// Return response based on operation success
|
|
return NextResponse.json({
|
|
success: deleteSuccess,
|
|
message: deleteSuccess
|
|
? 'Successfully cleared all data from Pinecone vector database'
|
|
: 'Failed to clear Pinecone database - service may not be available',
|
|
totalVectorCount: stats.totalVectorCount || 0,
|
|
httpHealthy: stats.httpHealthy || false
|
|
});
|
|
}
|