Protokoll #28588

ID28588
Zeitstempel2025-12-28 13:48:57.499161
Clientroot
IP145.224.72.140
Modellclaude-sonnet-4-20250514
Statuscompleted
Tokens744 (Input: 44, Output: 700)
Dauer118 ms
Request-Zeit2025-12-28 13:48:57.499161
Response-Zeit2025-12-28 13:48:57.616714

Request

{
    "event": "PreToolUse",
    "tool_name": "Read",
    "tool_input": {
        "file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Docs\/HybridSearchService.php",
        "limit": 80
    }
}

Response

{
    "tool_response": {
        "type": "text",
        "file": {
            "filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Docs\/HybridSearchService.php",
            "content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\Docs;\n\n\/\/ @responsibility: Hybrid-Suche kombiniert Qdrant-Vektoren mit SQL-Filtern\n\nuse Domain\\Service\\SearchServiceInterface;\nuse Infrastructure\\AI\\OllamaService;\nuse Infrastructure\\Config\\CredentialService;\nuse Infrastructure\\Traits\\JsonDecodeTrait;\nuse PDO;\nuse RuntimeException;\n\nfinal class HybridSearchService implements SearchServiceInterface\n{\n    use JsonDecodeTrait;\n\n    private const string COLLECTION = 'dokumentation_chunks';\n    private const int TIMEOUT = 30;\n\n    private string $qdrantHost;\n\n    public function __construct(\n        private PDO $pdo,\n        private OllamaService $ollama\n    ) {\n        $this->qdrantHost = CredentialService::getQdrantHost();\n    }\n\n    \/** Hybrid search combining semantic vectors with SQL filters. *\/\n    public function search(string $query, array $filters = [], int $limit = 10): array\n    {\n        \/\/ Stage 1: Semantic search in Qdrant\n        $vectorResults = $this->semanticSearch($query, $filters, $limit * 3);\n\n        if (empty($vectorResults)) {\n            return [];\n        }\n\n        \/\/ Stage 2: Enrich with SQL data and apply filters\n        $enrichedResults = $this->enrichAndFilter($vectorResults, $filters);\n\n        \/\/ Stage 3: Re-rank based on combined score\n        $rankedResults = $this->rerank($enrichedResults, $query);\n\n        return array_slice($rankedResults, 0, $limit);\n    }\n\n    \/** Searches within a specific taxonomy category. *\/\n    public function searchByCategory(string $query, string $category, int $limit = 10): array\n    {\n        return $this->search($query, ['taxonomy_category' => $category], $limit);\n    }\n\n    \/** Searches for chunks containing a specific entity. *\/\n    public function searchByEntity(string $query, string $entityName, int $limit = 10): array\n    {\n        return $this->search($query, ['entity_name' => $entityName], $limit);\n    }\n\n    \/** Gets all available taxonomy categories with counts. *\/\n    public function getTaxonomyCategories(): array\n    {\n        $stmt = $this->pdo->query('\n            SELECT taxonomy_category as category, COUNT(*) as count\n            FROM dokumentation_chunks\n            WHERE taxonomy_category IS NOT NULL\n            GROUP BY taxonomy_category\n            ORDER BY count DESC\n        ');\n\n        return $stmt->fetchAll(PDO::FETCH_ASSOC);\n    }\n\n    \/** Gets all entities grouped by type. *\/\n    public function getEntitiesByType(): array\n    {\n        $stmt = $this->pdo->query(\"",
            "numLines": 80,
            "startLine": 1,
            "totalLines": 343
        }
    }
}
← Vorheriger Zur Liste Nächster →