Search documentation of Ragex

# API Reference Ragex v#0.4.0

View Source

## Modules

Ragex

Ragex - Hybrid Retrieval-Augmented Generation for multi-language codebases.

Ragex.AI.Behaviour

Defines the behaviour for AI provider implementations.

Ragex.AI.Cache

AI response cache for reducing costs and improving performance.

Ragex.AI.Config

Manages AI provider configuration.

Ragex.AI.Features.Cache

Feature-aware wrapper around Ragex.AI.Cache.

Ragex.AI.Features.Config

Configuration management for AI-enhanced features.

Ragex.AI.Features.Context

Context building helpers for AI-enhanced features.

Ragex.AI.Provider.Anthropic

Anthropic API provider implementation.

Ragex.AI.Provider.DeepSeekR1

DeepSeek R1 API provider implementation.

Ragex.AI.Provider.Ollama

Ollama provider for running local LLMs.

Ragex.AI.Provider.OpenAI

OpenAI API provider implementation.

Ragex.AI.Provider.Registry

Registry for AI providers.

Ragex.AI.Registry

Convenience wrapper for AI provider registry operations.

Ragex.AI.Usage

Tracks AI provider usage including requests, tokens, and estimated costs.

Ragex.Analysis.ASTLocationExtractor

Extracts location information from language-specific ASTs before MetaAST transformation.

Ragex.Analysis.BusinessLogic

Business logic analysis using Metastatic analyzers.

Ragex.Analysis.DeadCode

Dead code detection for identifying unused functions and code.

Ragex.Analysis.DeadCode.AIRefiner

AI-powered refinement of dead code confidence scores.

Ragex.Analysis.DependencyGraph

Dependency analysis for module and function relationships.

Ragex.Analysis.DependencyGraph.AIInsights

AI-powered context-aware insights for dependency analysis.

Ragex.Analysis.Duplication

Code duplication detection using two complementary approaches.

Ragex.Analysis.Duplication.AIAnalyzer

AI-powered semantic analysis for code duplication detection.

Ragex.Analysis.Impact

Change impact analysis using graph traversal and metrics.

Ragex.Analysis.LocationEnricher

Enriches analysis results with accurate location information from the knowledge graph.

Ragex.Analysis.LocationPreservation

Preserves location metadata from native AST through Metastatic analysis.

Ragex.Analysis.MetastaticBridge

Bridge to Metastatic analysis capabilities.

Ragex.Analysis.Quality

High-level API for code quality analysis.

Ragex.Analysis.QualityStore

Stores and queries code quality metrics in the knowledge graph.

Ragex.Analysis.Security

Security vulnerability analysis using Metastatic.

Ragex.Analysis.Semantic

Semantic code analysis using Metastatic's OpKind metadata system.

Ragex.Analysis.Smells

Code smell detection using Metastatic.Analysis.Smells.

Ragex.Analysis.Suggestions

Automated refactoring suggestion engine.

Ragex.Analysis.Suggestions.Actions

Generates actionable refactoring plans for suggestions.

Ragex.Analysis.Suggestions.Patterns

Pattern detection for common refactoring opportunities.

Ragex.Analysis.Suggestions.RAGAdvisor

RAG-powered advice generation for refactoring suggestions.

Ragex.Analysis.Suggestions.Ranker

Priority ranking system for refactoring suggestions.

Ragex.Analyzers.Behaviour

Defines the behaviour for language-specific code analyzers.

Ragex.Analyzers.Directory

Analyzes entire directories recursively, detecting and analyzing files based on their extensions.

Ragex.Analyzers.Elixir

Analyzes Elixir code to extract modules, functions, calls, and dependencies.

Ragex.Analyzers.Erlang

Analyzes Erlang code to extract modules, functions, calls, and dependencies.

Ragex.Analyzers.JavaScript

Analyzes JavaScript code to extract modules, functions, calls, and dependencies.

Ragex.Analyzers.Metastatic

Analyzer implementation using Metastatic MetaAST library.

Ragex.Analyzers.Python

Analyzes Python code to extract modules, functions, calls, and dependencies.

Ragex.Analyzers.Ruby

Analyzes Ruby code to extract modules, functions, calls, and dependencies.

Ragex.CLI.Colors

ANSI color helpers for CLI output.

Ragex.CLI.Output

Rich output formatting utilities for tables, lists, and structured data.

Ragex.CLI.Progress

Progress bar and spinner utilities for CLI operations.

Ragex.CLI.Prompt

Interactive prompt utilities for CLI input.

Ragex.Editor.Backup

Backup management for file editing operations.

Ragex.Editor.Conflict

Conflict detection for refactoring operations.

Ragex.Editor.Core

Core editing functionality with atomic operations and validation.

Ragex.Editor.Diff

Diff generation and formatting for refactoring operations.

Ragex.Editor.Formatter

Automatic code formatting integration.

Ragex.Editor.Preview

Preview mode for refactoring operations.

Ragex.Editor.Refactor

Semantic refactoring operations that leverage the knowledge graph.

Ragex.Editor.Refactor.AIPreview

AI-enhanced refactoring preview commentary.

Ragex.Editor.Refactor.Elixir

Elixir-specific AST manipulation for semantic refactoring.

Ragex.Editor.Report

Report generation for refactoring operations.

Ragex.Editor.Transaction

Multi-file atomic edit transactions.

Ragex.Editor.Types

Common types and structs for the editor module.

Ragex.Editor.Undo

Multi-level undo/redo stack for refactoring operations.

Ragex.Editor.ValidationAI

AI-enhanced validation error explanation and fix suggestions.

Ragex.Editor.Validator

Validation pipeline orchestration for code editing.

Ragex.Editor.Validators.Elixir

Elixir code validator.

Ragex.Editor.Validators.Erlang

Erlang code validator.

Ragex.Editor.Validators.Javascript

JavaScript/TypeScript code validator.

Ragex.Editor.Validators.Python

Python code validator.

Ragex.Editor.Visualize

Visualization utilities for refactoring operations.

Ragex.Embeddings.Behaviour

Behavior for embedding generators.

Ragex.Embeddings.Bumblebee

Embedding adapter using Bumblebee with configurable models.

Ragex.Embeddings.FileTracker

Tracks file metadata to enable incremental embedding updates.

Ragex.Embeddings.Helper

Helper functions to generate and store embeddings for analyzed code entities.

Ragex.Embeddings.Persistence

Persistence layer for embedding vectors.

Ragex.Embeddings.Registry

Registry of available embedding models with metadata.

Ragex.Embeddings.TextGenerator

Generates embeddable text descriptions from code entities.

Ragex.Graph.Algorithms

Graph algorithms for analyzing code structure and relationships.

Ragex.Graph.Store

Knowledge graph storage using ETS tables.

Ragex.MCP.Debug

Helper functions for debugging MCP protocol issues.

Ragex.MCP.Handlers.Prompts

Handles MCP prompt-related requests.

Ragex.MCP.Handlers.Resources

Handles MCP resource-related requests.

Ragex.MCP.Handlers.Tools

Handles MCP tool-related requests.

Ragex.MCP.Protocol

Implements the Model Context Protocol (MCP) JSON-RPC 2.0 protocol.

Ragex.MCP.Server

MCP Server implementation that communicates via stdio.

Ragex.MCP.SingleRequest

Handles a single MCP request from stdin and exits.

Ragex.MCP.SocketServer

Unix socket server for MCP protocol.

Ragex.RAG.ContextBuilder

Formats retrieved code for AI consumption.

Ragex.RAG.Pipeline

Orchestrates the RAG pipeline: Retrieval → Augmentation → Generation.

Ragex.RAG.PromptTemplate

Manages prompt engineering templates.

Ragex.Retrieval.CrossLanguage

Cross-language semantic search using MetaAST equivalence.

Ragex.Retrieval.Hybrid

Hybrid retrieval combining symbolic graph queries with semantic similarity search.

Ragex.Retrieval.MetaASTRanker

Enhances retrieval ranking using MetaAST metadata from Metastatic.

Ragex.Retrieval.QueryExpansion

Query expansion using MetaAST semantic features.

Ragex.VectorStore

Vector similarity search for code embeddings.

Ragex.Watcher

Watches directories for file changes and automatically re-analyzes modified files.

## Mix Tasks

mix ragex.ai.cache.clear

Clear AI response cache.

mix ragex.ai.cache.stats

Display AI response cache statistics.

mix ragex.ai.usage.stats

Display AI provider usage statistics and costs.

mix ragex.analyze

Performs comprehensive analysis on a directory.

mix ragex.cache.clear

Clears cached embeddings.

mix ragex.cache.refresh

Refreshes the embeddings cache for the current project.

mix ragex.cache.stats

Displays statistics about cached embeddings.

mix ragex.completions

Install shell completion scripts for Ragex.

mix ragex.configure

Interactive configuration wizard for Ragex setup.

mix ragex.dashboard

Live monitoring dashboard for Ragex metrics.

mix ragex.embeddings.migrate

Migrates embeddings when changing embedding models.

mix ragex.install_man

Install Ragex man pages.

mix ragex.models.download

Downloads and caches Bumblebee embedding models for offline use.

mix ragex.refactor

Interactive refactoring wizard with operation selection and preview.