diff --git a/src/haiku/rag/app.py b/src/haiku/rag/app.py index 01311b86..9347d255 100644 --- a/src/haiku/rag/app.py +++ b/src/haiku/rag/app.py @@ -122,12 +122,7 @@ class HaikuRAGApp: self.console.print(f"• {finding}") self.console.print() - # Themes - if report.themes: - self.console.print("[bold cyan]Key Themes:[/bold cyan]") - for theme, explanation in report.themes.items(): - self.console.print(f"• [bold]{theme}[/bold]: {explanation}") - self.console.print() + # (Themes section removed) # Conclusions if report.conclusions: @@ -261,7 +256,7 @@ class HaikuRAGApp: elif transport == "sse": await server.run_sse_async() else: - await server.run_http_async("streamable-http") + await server.run_http_async(transport="streamable-http") except KeyboardInterrupt: pass finally: diff --git a/src/haiku/rag/qa/agent.py b/src/haiku/rag/qa/agent.py index b7edb6fa..3493b0ce 100644 --- a/src/haiku/rag/qa/agent.py +++ b/src/haiku/rag/qa/agent.py @@ -49,6 +49,9 @@ class QuestionAnswerAgent: limit: int = 3, ) -> list[SearchResult]: """Search the knowledge base for relevant documents.""" + + # Remove quotes from queries as this requires positional indexing in lancedb + query = query.replace('"', "") search_results = await ctx.deps.client.search(query, limit=limit) expanded_results = await ctx.deps.client.expand_context(search_results) diff --git a/src/haiku/rag/research/evaluation_agent.py b/src/haiku/rag/research/evaluation_agent.py index 5b924c81..8d3f5541 100644 --- a/src/haiku/rag/research/evaluation_agent.py +++ b/src/haiku/rag/research/evaluation_agent.py @@ -11,7 +11,9 @@ class EvaluationResult(BaseModel): description="Main insights extracted from the research so far" ) new_questions: list[str] = Field( - description="New sub-questions to add to the research (max 3)", max_length=3 + description="New sub-questions to add to the research (max 3)", + max_length=3, + default=[], ) confidence_score: float = Field( description="Confidence level in the completeness of research (0-1)", diff --git a/src/haiku/rag/research/search_agent.py b/src/haiku/rag/research/search_agent.py index 200f619a..b2cdc17f 100644 --- a/src/haiku/rag/research/search_agent.py +++ b/src/haiku/rag/research/search_agent.py @@ -42,6 +42,7 @@ class SearchSpecialistAgent(BaseResearchAgent[SearchAnswer]): ) -> str: """Search the KB and return a concise context pack.""" # Remove quotes from queries as this requires positional indexing in lancedb + # XXX: Investigate how to do that with lancedb query = query.replace('"', "") search_results = await ctx.deps.client.search(query, limit=limit) expanded = await ctx.deps.client.expand_context(search_results) diff --git a/src/haiku/rag/research/synthesis_agent.py b/src/haiku/rag/research/synthesis_agent.py index 45349789..e0dbd0a3 100644 --- a/src/haiku/rag/research/synthesis_agent.py +++ b/src/haiku/rag/research/synthesis_agent.py @@ -12,11 +12,12 @@ class ResearchReport(BaseModel): main_findings: list[str] = Field( description="Primary research findings with supporting evidence" ) - themes: dict[str, str] = Field(description="Major themes and their explanations") conclusions: list[str] = Field(description="Evidence-based conclusions") - limitations: list[str] = Field(description="Limitations of the current research") + limitations: list[str] = Field( + description="Limitations of the current research", default=[] + ) recommendations: list[str] = Field( - description="Actionable recommendations based on findings" + description="Actionable recommendations based on findings", default=[] ) sources_summary: str = Field( description="Summary of sources used and their reliability" diff --git a/tests/research/test_orchestrator.py b/tests/research/test_orchestrator.py index 09d44c6e..3c298c82 100644 --- a/tests/research/test_orchestrator.py +++ b/tests/research/test_orchestrator.py @@ -172,7 +172,6 @@ class TestResearchOrchestrator: assert report.title assert report.executive_summary assert isinstance(report.main_findings, list) - assert isinstance(report.themes, dict) assert isinstance(report.conclusions, list) assert isinstance(report.limitations, list) assert isinstance(report.recommendations, list)