{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "# Check Qdrant available endpoints\ncurl -s http:\/\/localhost:6333\/collections\/documents | python3 -c \"\nimport sys, json\ndata = json.load(sys.stdin)['result']\ncfg = data.get('config', {}).get('hnsw_config', {})\nprint('HNSW Config:')\nfor k, v in cfg.items():\n print(f' {k}: {v}')\n\"\n\necho \"\"\necho \"=== Search performance comparison ===\"\ncd \/var\/www\/scripts\/pipeline\n.\/venv\/bin\/python << 'EOF'\nimport requests\nimport time\n\n# Get embedding\nresp = requests.post('http:\/\/localhost:11434\/api\/embeddings', json={\n 'model': 'mxbai-embed-large',\n 'prompt': 'Was ist systemisches Coaching?'\n})\nvector = resp.json()['embedding']\n\n# Measure search time over multiple runs\ntimes = []\nfor i in range(5):\n start = time.time()\n search_resp = requests.post('http:\/\/localhost:6333\/collections\/documents\/points\/search', json={\n 'vector': vector,\n 'limit': 5,\n 'with_payload': False\n })\n elapsed = (time.time() - start) * 1000\n times.append(elapsed)\n\navg_time = sum(times) \/ len(times)\nprint(f'Average search time: {avg_time:.1f}ms')\nprint(f'Min: {min(times):.1f}ms, Max: {max(times):.1f}ms')\n\n# For comparison: 1997 vectors with brute force at ~3-4ms is very fast\n# HNSW would typically be < 1ms\nprint(f'\\nNote: For 1997 vectors, brute force ({avg_time:.1f}ms) is acceptable.')\nprint('HNSW would be < 1ms but difference is negligible at this scale.')\nEOF",
"timeout": 60000,
"description": "Check performance"
}
}
{
"tool_response": {
"stdout": "HNSW Config:\n m: 16\n ef_construct: 128\n full_scan_threshold: 100\n max_indexing_threads: 0\n on_disk: False\n\n=== Search performance comparison ===\nAverage search time: 2.3ms\nMin: 1.6ms, Max: 3.1ms\n\nNote: For 1997 vectors, brute force (2.3ms) is acceptable.\nHNSW would be < 1ms but difference is negligible at this scale.",
"stderr": "",
"interrupted": false,
"isImage": false
}
}