scratch_db_test_case.py 659 B

123456789101112131415161718192021
  1. import asyncio
  2. import os
  3. from dotenv import load_dotenv
  4. load_dotenv("/root/Agent/.env")
  5. import sys
  6. sys.path.append("/root/Agent")
  7. from knowhub.knowhub_db.pg_store import PostgreSQLStore
  8. store = PostgreSQLStore()
  9. try:
  10. print("--- Searching for CAP-001 (Uppercase) ---")
  11. results = store.query("id != ''", limit=10, relation_filters={"capability_id": "CAP-001"})
  12. print("CAP-001 count:", len(results))
  13. print("\n--- Searching for cap-001 (Lowercase) ---")
  14. results2 = store.query("id != ''", limit=10, relation_filters={"capability_id": "cap-001"})
  15. print("cap-001 count:", len(results2))
  16. except Exception as e:
  17. print("Error:", e)