MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / dump_qdrant_conversations

Function dump_qdrant_conversations

AskAgent/python/test_dump_qdrant.py:19–172  ·  view source on GitHub ↗

Dump all conversations from Qdrant storage.

()

Source from the content-addressed store, hash-verified

17
18
19async def dump_qdrant_conversations():
20 """Dump all conversations from Qdrant storage."""
21
22 print("=" * 80)
23 print("QDRANT CONVERSATION DATABASE DUMP")
24 print("=" * 80)
25
26 # Get storage configuration
27 storage_config = CONFIG.conversation_storage
28 print(f"\nStorage Type: {storage_config.type}")
29 print(f"Collection Name: {storage_config.collection_name or 'nlweb_conversations'}")
30
31 if storage_config.type != 'qdrant':
32 print(f"\nWARNING: Storage type is '{storage_config.type}', not 'qdrant'")
33 print("This script is specifically for Qdrant storage.")
34 return
35
36 # Initialize Qdrant storage provider
37 print("\nInitializing Qdrant storage provider...")
38 storage = QdrantStorageProvider(storage_config)
39 await storage.initialize()
40
41 # Get collection info
42 try:
43 collection_info = await storage.client.get_collection(storage.collection_name)
44 print("\nCollection Info:")
45 print(f" Points count: {collection_info.points_count}")
46 print(f" Vectors size: {collection_info.config.params.vectors.size}")
47 except Exception as e:
48 print(f"Error getting collection info: {e}")
49 return
50
51 # Scroll through all points in the collection
52 print("\n" + "=" * 80)
53 print("ALL CONVERSATIONS:")
54 print("=" * 80)
55
56 try:
57 # Get all points without any filter
58 results = await storage.client.scroll(
59 collection_name=storage.collection_name,
60 limit=1000, # Get up to 1000 conversations
61 with_payload=True,
62 with_vectors=False # Don't include embeddings in output
63 )
64
65 points = results[0]
66
67 if not points:
68 print("\nNo conversations found in the database.")
69 return
70
71 print(f"\nFound {len(points)} conversation(s)\n")
72
73 # Group by thread_id for better organization
74 threads = {}
75 for point in points:
76 payload = point.payload

Callers 1

Calls 4

initializeMethod · 0.95
getMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected