Ragex. CLI. Chat
(Ragex v0.14.1)
View Source
Interactive terminal chat UI for codebase Q&A using the Ragex agent.
Each user question is handled by the agent executor (ReAct loop) which
actively calls Ragex MCP read-only query tools — hybrid_search,
semantic_search, read_file, query_graph, find_callers, etc. —
to retrieve relevant code context before composing the answer. The
restricted tool set (ToolSchema.rag_query_tools/1) prevents the AI from
accidentally re-triggering heavy analysis pipelines while still giving it
full read access to the knowledge graph and embeddings.
Blocking Core.chat/3 is used for every query (rather than streaming) so
that tool-call responses are reliably captured. Some providers (e.g.
DeepSeek R1) emit content and tool_calls in the same response chunk; the
streaming parser would silently drop the tool calls, truncating answers.
The initial codebase analysis and first-run audit report are generated
separately (via Core.analyze_project/2 and Core.stream_generate_report/3)
and use no tools (report generation) or the full agent tool set (re-analysis).
Usage
Ragex.CLI.Chat.start(path: "/path/to/project")Commands
/help- Show available commands/history- Show conversation history/clear- Clear conversation and start fresh/sources- Show sources from last response (empty — agent tracks toolcall results internally, not as named sources)/analyze- Re-analyze the codebase/status- Show session and graph stats/quit- Exit the chat
Summary
Functions
Start an interactive chat session.
Types
Functions
@spec start(keyword()) :: :ok
Start an interactive chat session.
Runs the initial codebase analysis (unless :skip_analysis is true),
streams the opening audit report, then enters an interactive loop where
every question is answered by the agent executor using Ragex MCP query tools.
Options
:path- Project path to analyze (default: cwd):provider- AI provider atom (default: configured default):model- Model name override:strategy- Accepted for compatibility but not used; queries always gothrough the agent ReAct loop rather than the retrieval pipeline:skip_analysis- Skip initial analysis (default: false):include_dead_code- Enable dead code analysis (default: false):debug- Print tool-call details and session messages to stderr (default: false)