Problem Statement
Three RAG variants are stubbed and just return basic RAG without implementing their advertised functionality:
- Conversational RAG - History parameter completely ignored
- Multi-Query RAG - Query expander parameter ignored
- Hybrid RAG - Keyword retriever ignored, only semantic used
Current Behavior
File: internal/orchestration/rag.go
Conversational RAG (line 150)
func NewConversationalRAG(..., historyAgent string) *RAG {
// TODO: Implement conversation history tracking
return NewRAG(name, runtime, retriever, generator) // historyAgent ignored!
}
Multi-Query RAG (line 156)
func NewMultiQueryRAG(..., queryExpander, retriever, generator string) *RAG {
// TODO: Implement multi-query expansion
return NewRAG(name, runtime, retriever, generator) // queryExpander ignored!
}
Hybrid RAG (line 162)
func NewHybridRAG(..., semanticRetriever, keywordRetriever, generator string) *RAG {
// TODO: Implement hybrid retrieval
return NewRAG(name, runtime, semanticRetriever, generator) // keywordRetriever ignored!
}
Expected Behavior
Conversational RAG
- Track conversation history with configurable window
- Include conversation context in retrieval query
- Support history compression for long conversations
- Optional history persistence
Multi-Query RAG
- Generate 3-5 query variations using query expander
- Retrieve documents for all variations
- Deduplicate and merge results
- Configurable number of expansions
Hybrid RAG
- Run semantic and keyword retrievers in parallel
- Merge with rank fusion (RRF or weighted)
- Configurable fusion weights
- Support different retrievers per mode
Acceptance Criteria
Conversational RAG
Multi-Query RAG
Hybrid RAG
Implementation Hints
Conversational History
type ConversationHistory struct {
Messages []agent.Message
MaxDepth int
}
// Retrieve with query + context from last N messages
Multi-Query Expansion
prompt := fmt.Sprintf("Generate 5 diverse queries capturing different aspects of: %s", originalQuery)
Reciprocal Rank Fusion
// score = sum(1/(k + rank_i))
func reciprocalRankFusion(results [][]Document, k int) []Document {
scores := make(map[string]float64)
for _, resultSet := range results {
for rank, doc := range resultSet {
scores[doc.ID] += 1.0 / float64(k + rank)
}
}
// Sort by score and return
}
Dependencies
Impact
High - These variants enable enterprise-grade RAG applications with better relevance and recall
Problem Statement
Three RAG variants are stubbed and just return basic RAG without implementing their advertised functionality:
Current Behavior
File:
internal/orchestration/rag.goConversational RAG (line 150)
Multi-Query RAG (line 156)
Hybrid RAG (line 162)
Expected Behavior
Conversational RAG
Multi-Query RAG
Hybrid RAG
Acceptance Criteria
Conversational RAG
Multi-Query RAG
Hybrid RAG
Implementation Hints
Conversational History
Multi-Query Expansion
Reciprocal Rank Fusion
Dependencies
Impact
High - These variants enable enterprise-grade RAG applications with better relevance and recall