API Reference Ragex v#0.15.0
View SourceModules
Ragex - Hybrid Retrieval-Augmented Generation for multi-language codebases.
Defines the behaviour for AI provider implementations.
AI response cache for reducing costs and improving performance.
Manages AI provider configuration.
Feature-aware wrapper around Ragex.AI.Cache.
Configuration management for AI-enhanced features.
Context building helpers for AI-enhanced features.
Anthropic API provider implementation.
DeepSeek R1 API provider implementation.
Ollama provider for running local LLMs.
OpenAI API provider implementation.
Registry for AI providers.
Convenience wrapper for AI provider registry operations.
Tracks AI provider usage including requests, tokens, and estimated costs.
Plug for optional API key authentication.
Generates an OpenAPI 3.0 specification from the MCP tool definitions.
HTTP router for the Ragex REST API bridge.
Lightweight HTTP server for the Ragex REST API bridge.
Main entry point for Ragex Agent operations.
ReAct (Reasoning + Acting) execution loop for agent operations.
ETS-based conversation memory for agent sessions.
Represents an agent conversation session.
Report generation utilities for agent analysis.
Consumes a provider stream and accumulates a response compatible with generate/3.
Converts MCP tool definitions to AI provider tool formats.
Business logic analysis using Metastatic analyzers.
Persistence layer for code analysis results (issues).
Dead code detection for identifying unused functions and code.
AI-powered refinement of dead code confidence scores.
Dependency analysis for module and function relationships.
AI-powered context-aware insights for dependency analysis.
Code duplication detection using two complementary approaches.
AI-powered semantic analysis for code duplication detection.
Change impact analysis using graph traversal and metrics.
Enriches analysis results with accurate location information from the knowledge graph.
Preserves location metadata through Metastatic analysis.
Bridge to Metastatic analysis capabilities.
High-level API for code quality analysis.
Stores and queries code quality metrics in the knowledge graph.
Shared analysis runner logic used by both Mix tasks and MCP tools.
Security vulnerability analysis using Metastatic.
Semantic code analysis using Metastatic's OpKind metadata system.
Code smell detection using Metastatic.Analysis.Smells.
Automated refactoring suggestion engine.
Generates actionable refactoring plans for suggestions.
Pattern detection for common refactoring opportunities.
RAG-powered advice generation for refactoring suggestions.
Priority ranking system for refactoring suggestions.
Defines the behaviour for language-specific code analyzers.
Post-processing pass that extracts string literals and comments from source code and associates them with the nearest function in the analysis result.
Analyzes entire directories recursively, detecting and analyzing files based on their extensions.
Analyzes Elixir code to extract modules, functions, calls, and dependencies.
Analyzes Erlang code to extract modules, functions, calls, and dependencies.
Analyzes JavaScript code to extract modules, functions, calls, and dependencies.
Language-agnostic entity extraction from Metastatic MetaAST.
Language-agnostic analyzer using Metastatic MetaAST.
Analyzes Python code to extract modules, functions, calls, and dependencies.
Analyzes Ruby code to extract modules, functions, calls, and dependencies.
Translates parsed SCIP analysis results into Ragex knowledge graph operations.
Orchestrates external SCIP indexer binaries.
Parses SCIP index JSON (from scip print --json) into Ragex's internal
analysis format.
Maps project marker files to languages and their SCIP indexer tools.
Interactive terminal chat UI for codebase Q&A using the Ragex agent.
ANSI color helpers for CLI output.
Editor configuration generator for AI code editors.
Rich output formatting utilities for tables, lists, and structured data.
Progress bar and spinner utilities for CLI operations.
Interactive prompt utilities for CLI input.
Backup management for file editing operations.
Conflict detection for refactoring operations.
Core editing functionality with atomic operations and validation.
Diff generation and formatting for refactoring operations.
Automatic code formatting integration.
Preview mode for refactoring operations.
Semantic refactoring operations that leverage the knowledge graph.
AI-enhanced refactoring preview commentary.
Elixir-specific AST manipulation for semantic refactoring.
Language-agnostic refactoring operations via Metastatic MetaAST.
Report generation for refactoring operations.
Multi-file atomic edit transactions.
Common types and structs for the editor module.
Multi-level undo/redo stack for refactoring operations.
AI-enhanced validation error explanation and fix suggestions.
Validation pipeline orchestration for code editing.
Elixir code validator.
Erlang code validator.
JavaScript/TypeScript code validator.
Python code validator.
Ruby code validator.
Visualization utilities for refactoring operations.
Behavior for embedding generators.
Embedding adapter using Bumblebee with configurable models.
Tracks file metadata to enable incremental embedding updates.
Helper functions to generate and store embeddings for analyzed code entities.
Persistence layer for embedding vectors.
Registry of available embedding models with metadata.
Generates embeddable text descriptions from code entities.
Behaviour defining the contract for git backend implementations.
Git backend that shells out to the git CLI binary.
Git backend using the egit NIF library (libgit2 bindings).
High-level git blame API.
A single line (or contiguous range) from git blame output.
Co-change analysis: discover files (and functions) that frequently change together.
A parsed git commit with metadata.
Background enrichment of knowledge graph nodes with git metadata.
High-level git log API.
Pull Request attribution and indexing.
Struct representing an indexed pull request.
Repository detection and metadata.
GenServer that owns the egit NIF repository reference.
Graph algorithms for analyzing code structure and relationships.
Persistence layer for the knowledge graph (nodes and edges).
Knowledge graph storage using ETS tables.
Shared language detection, adapter resolution, and parsing utilities.
Client for communicating with a running Ragex MCP server via Unix socket.
Helper functions for debugging MCP protocol issues.
Helper for Mix tasks to delegate work to a running Ragex MCP server.
Protocol for compacting MCP tool responses.
Centralized response formatting for MCP tool results.
MCP tool definitions and handlers for git archaeology features.
Handles MCP prompt-related requests.
Handles MCP resource-related requests.
MCP tool definitions and handlers for SCIP bridge features.
Handles MCP tool-related requests (tools/list and tools/call).
Implements the Model Context Protocol (MCP) JSON-RPC 2.0 protocol.
MCP Server implementation that communicates via stdio.
Handles a single MCP request from stdin and exits.
Unix socket server for MCP protocol.
Tracks MCP tool invocation patterns and latencies.
Formats retrieved code for AI consumption.
Orchestrates the RAG pipeline: Retrieval → Augmentation → Generation.
Manages prompt engineering templates.
Cross-language semantic search using MetaAST equivalence.
Hybrid retrieval combining symbolic graph queries with semantic similarity search.
Enhances retrieval ranking using MetaAST metadata from Metastatic.
Query expansion using MetaAST semantic features.
Extracts weighted keywords from code entities for boosted semantic search.
Vector similarity search for code embeddings.
Watches directories for file changes and automatically re-analyzes modified files.
Mix Tasks
Clear AI response cache.
Display AI response cache statistics.
Display AI provider usage statistics and costs.
Performs comprehensive analysis on a directory.
Generates an AI-powered code audit report.
Clears cached embeddings.
Refreshes the embeddings cache for the current project.
Displays statistics about cached embeddings.
Interactive chat session for codebase Q&A using RAG.
Install shell completion scripts for Ragex.
Interactive configuration wizard for Ragex setup.
Live monitoring dashboard for Ragex metrics.
Migrates embeddings when changing embedding models.
Install Ragex man pages.
Downloads and caches Bumblebee embedding models for offline use.
Interactive refactoring wizard with operation selection and preview.
Starts the Ragex REST API server on the specified port.
Interactive setup for Ragex MCP integration with AI editors.
Displays comprehensive status of the Ragex system.