Ragex.Agent.Core
(Ragex v0.8.0)
View Source
Main entry point for Ragex Agent operations.
Orchestrates the full project analysis pipeline:
- Analyze project (build knowledge graph, embeddings)
- Discover issues (dead code, duplicates, security, smells, complexity)
- Generate AI-polished report
- Enable conversation session for follow-up
Usage
# Full project analysis with report
{:ok, result} = Agent.Core.analyze_project("/path/to/project")
# Continue conversation
{:ok, response} = Agent.Core.chat(result.session_id, "Tell me more about the security issues")
# Get just the report
{:ok, report} = Agent.Core.get_report(result.session_id)
Summary
Functions
Analyze a project and generate an AI-polished report.
Continue a conversation with the agent in an existing session.
Clear/end a session.
Get the generated report from a session.
Get session details.
List all active agent sessions.
Quick analysis - runs all detectors without AI polishing.
Types
Functions
@spec analyze_project( String.t(), keyword() ) :: {:ok, analysis_result()} | {:error, term()}
Analyze a project and generate an AI-polished report.
Parameters
path- Project root pathopts- Options::provider- AI provider (:deepseek_r1, :openai, :anthropic):include_suggestions- Include refactoring suggestions (default: true):max_files- Maximum files to analyze (default: 500):skip_embeddings- Skip embedding generation (default: false):include_dead_code- Enable dead code analysis (default: false):exclude_patterns- Patterns to exclude (default: standard ignores)
Returns
{:ok, result}- Analysis completed with session ID and report{:error, reason}- Analysis failed
Continue a conversation with the agent in an existing session.
Parameters
session_id- Active session IDmessage- User messageopts- Options (same as analyze_project)
Returns
{:ok, response}- Agent response{:error, reason}- Chat failed
@spec clear_session(String.t()) :: :ok
Clear/end a session.
Get the generated report from a session.
If not yet generated, generates it on-demand.
Get session details.
List all active agent sessions.
Quick analysis - runs all detectors without AI polishing.
Useful for programmatic access to raw issue data.