{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "php -r '\nrequire_once \"src\/Infrastructure\/AI\/OllamaService.php\";\nrequire_once \"src\/Infrastructure\/AI\/QdrantService.php\";\nrequire_once \"src\/Infrastructure\/AI\/ScoringService.php\";\n\n$host = \"http:\/\/localhost:6333\";\n\n\/\/ Step 1: Get real embedding\n$ollamaHost = \"http:\/\/localhost:11434\";\n$question = \"Was ist systemisches Coaching?\";\n\n$ch = curl_init(\"$ollamaHost\/api\/embeddings\");\ncurl_setopt_array($ch, [\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => [\"Content-Type: application\/json\"],\n CURLOPT_POSTFIELDS => json_encode([\"model\" => \"mxbai-embed-large\", \"prompt\" => $question]),\n]);\n$resp = json_decode(curl_exec($ch), true);\ncurl_close($ch);\n$embedding = $resp[\"embedding\"];\necho \"Embedding: \" . count($embedding) . \" dims\\n\\n\";\n\n\/\/ Step 2: Search Qdrant\n$url = \"$host\/collections\/documents\/points\/search\";\n$ch = curl_init($url);\ncurl_setopt_array($ch, [\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_HTTPHEADER => [\"Content-Type: application\/json\"],\n CURLOPT_POSTFIELDS => json_encode([\n \"vector\" => $embedding,\n \"limit\" => 5,\n \"with_payload\" => true,\n ]),\n]);\n$searchResp = json_decode(curl_exec($ch), true);\ncurl_close($ch);\n\necho \"=== Qdrant Results ===\\n\";\n$results = $searchResp[\"result\"] ?? [];\necho \"Count: \" . count($results) . \"\\n\\n\";\n\nforeach ($results as $i => $r) {\n $title = $r[\"payload\"][\"document_title\"] ?? \"MISSING\";\n $content = substr($r[\"payload\"][\"content\"] ?? \"EMPTY\", 0, 50);\n echo ($i+1) . \". {$title}\\n Score: {$r[\\\"score\\\"]}\\n Content: {$content}...\\n\\n\";\n}\n' 2>&1",
"timeout": 60000,
"description": "Full PHP RAG trace"
}
}