| import chromadb | |
| from chromadb.config import Settings | |
| import sys | |
| import os | |
| KB_PATH = "data/knowledge_base" | |
| if not os.path.exists(KB_PATH): | |
| print(f"β Path not found: {KB_PATH}") | |
| sys.exit(1) | |
| try: | |
| print(f"π Checking {KB_PATH}...") | |
| client = chromadb.PersistentClient(path=KB_PATH) | |
| col = client.get_collection("medical_knowledge") | |
| count = col.count() | |
| print(f"β Collection found: {col.name}") | |
| print(f"π Documents: {count}") | |
| if count == 0: | |
| print("β Collection is EMPTY!") | |
| sys.exit(1) | |
| # Check if vectors exist | |
| res = col.peek() | |
| if not res['embeddings']: | |
| print("β No embeddings found!") | |
| else: | |
| print("β Embeddings present.") | |
| except Exception as e: | |
| print(f"β Error: {e}") | |
| sys.exit(1) | |