From d5b6ad544de7100bb32b89089244013706b48bdc Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Tue, 11 Nov 2025 13:09:27 +0200 Subject: [PATCH] Bring back verbose --- haiku_rag_slim/haiku/rag/app.py | 18 ++++++++++++++---- haiku_rag_slim/haiku/rag/cli.py | 7 ++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/haiku_rag_slim/haiku/rag/app.py b/haiku_rag_slim/haiku/rag/app.py index bac4c6f9..40a20fe6 100644 --- a/haiku_rag_slim/haiku/rag/app.py +++ b/haiku_rag_slim/haiku/rag/app.py @@ -243,11 +243,12 @@ class HaikuRAGApp: except Exception as e: self.console.print(f"[red]Error: {e}[/red]") - async def research(self, question: str): + async def research(self, question: str, verbose: bool = False): """Run research via the pydantic-graph pipeline. Args: question: The research question + verbose: Show AG-UI event stream during execution """ async with HaikuRAG(db_path=self.db_path, config=self.config) as client: try: @@ -260,9 +261,18 @@ class HaikuRAGApp: state = ResearchState.from_config(context=context, config=self.config) deps = ResearchDeps(client=client) - # Use AG-UI renderer to process events - renderer = AGUIConsoleRenderer(self.console) - report_dict = await renderer.render(stream_graph(graph, state, deps)) + if verbose: + # Use AG-UI renderer to process and display events + renderer = AGUIConsoleRenderer(self.console) + report_dict = await renderer.render( + stream_graph(graph, state, deps) + ) + else: + # Run without rendering events, just get the result + report = await graph.run(state=state, deps=deps) + report_dict = ( + report.model_dump() if hasattr(report, "model_dump") else report + ) if report_dict is None: self.console.print("[red]Research did not produce a report.[/red]") diff --git a/haiku_rag_slim/haiku/rag/cli.py b/haiku_rag_slim/haiku/rag/cli.py index ab6a1914..dc99ec2a 100644 --- a/haiku_rag_slim/haiku/rag/cli.py +++ b/haiku_rag_slim/haiku/rag/cli.py @@ -299,9 +299,14 @@ def research( "--db", help="Path to the LanceDB database file", ), + verbose: bool = typer.Option( + False, + "--verbose", + help="Show planning, searching previews, evaluation summary, and stop reason", + ), ): app = create_app(db) - asyncio.run(app.research(question=question)) + asyncio.run(app.research(question=question, verbose=verbose)) @cli.command("settings", help="Display current configuration settings")