diff --git a/src/haiku/rag/client.py b/src/haiku/rag/client.py index 11a60089..2b04f78f 100644 --- a/src/haiku/rag/client.py +++ b/src/haiku/rag/client.py @@ -278,7 +278,7 @@ class HaikuRAG: return await self.document_repository.list_all(limit=limit, offset=offset) async def search( - self, query: str, limit: int = 3, k: int = 60, rerank=Config.RERANK + self, query: str, limit: int = 5, k: int = 60, rerank=Config.RERANK ) -> list[tuple[Chunk, float]]: """Search for relevant chunks using hybrid search (vector similarity + full-text search) with reranking. @@ -298,7 +298,6 @@ class HaikuRAG: search_results = await self.chunk_repository.search_chunks_hybrid( query, limit * 3, k ) - # Apply reranking reranker = get_reranker() chunks = [chunk for chunk, _ in search_results] diff --git a/src/haiku/rag/qa/ollama.py b/src/haiku/rag/qa/ollama.py index 9c4ee01a..7521d8bf 100644 --- a/src/haiku/rag/qa/ollama.py +++ b/src/haiku/rag/qa/ollama.py @@ -4,7 +4,7 @@ from haiku.rag.client import HaikuRAG from haiku.rag.config import Config from haiku.rag.qa.base import QuestionAnswerAgentBase -OLLAMA_OPTIONS = {"temperature": 0.0, "seed": 42, "num_ctx": 64000} +OLLAMA_OPTIONS = {"temperature": 0.0, "seed": 42, "num_ctx": 16384} class QuestionAnswerOllamaAgent(QuestionAnswerAgentBase): diff --git a/src/haiku/rag/qa/prompts.py b/src/haiku/rag/qa/prompts.py index 68d42cc2..af490fd7 100644 --- a/src/haiku/rag/qa/prompts.py +++ b/src/haiku/rag/qa/prompts.py @@ -15,7 +15,7 @@ Guidelines: - Indicate when information is incomplete or when you need to search for additional context - If the retrieved documents don't contain sufficient information, clearly state: "I cannot find enough information in the knowledge base to answer this question." - For complex questions, consider breaking them down and performing multiple searches -- Stick to the answer, do not ellaborate or provde context unless asked for it. +- Stick to the answer, do not ellaborate or provide context unless explicitly asked for it. Be concise, and always maintain accuracy over completeness. Prefer short, direct answers that are well-supported by the documents. """ diff --git a/tests/llm_judge.py b/tests/llm_judge.py index f7e3f6e2..648c8b72 100644 --- a/tests/llm_judge.py +++ b/tests/llm_judge.py @@ -13,7 +13,7 @@ class LLMJudgeResponseSchema(BaseModel): class LLMJudge: """LLM-as-judge for evaluating answer equivalence using Ollama.""" - def __init__(self, model: str = "qwen3"): + def __init__(self, model: str = Config.QA_MODEL): self.model = model self.client = AsyncClient(host=Config.OLLAMA_BASE_URL)