Tune parameters

This commit is contained in:
Yiorgis Gozadinos 2025-07-20 14:32:41 +03:00
parent 4908ea9fcc
commit dfe23482da
No known key found for this signature in database
4 changed files with 4 additions and 5 deletions

View file

@ -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]

View file

@ -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):

View file

@ -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.
"""

View file

@ -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)