From dc866e6ce38635ee3472f5d727811bcc32227f31 Mon Sep 17 00:00:00 2001 From: BobAi Date: Tue, 12 Aug 2025 19:27:55 +1000 Subject: [PATCH] MAJOR: Remove all Claude references and rename to Mini-RAG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Complete rebrand for v1.0-simple-search branch: Directory Changes: - claude_rag/ โ†’ mini_rag/ (preserving git history) Content Changes: - Updated all imports: from claude_rag โ†’ from mini_rag - Updated all file paths: .claude-rag โ†’ .mini-rag - Updated documentation and comments - Updated configuration files and examples - Updated all tests to use mini_rag imports This ensures complete independence from Claude/Anthropic branding while maintaining all functionality and git history. Simple branch contains the basic RAG system without LLM features. --- claude_rag/__main__.py | 6 - cleanup_claude_references.py | 278 ++++++++++++++++++ cleanup_simple_branch.py | 73 +++++ docs/DIAGRAMS.md | 2 +- docs/FALLBACK_SETUP.md | 4 +- docs/GETTING_STARTED.md | 14 +- docs/SMART_TUNING_GUIDE.md | 2 +- docs/TECHNICAL_GUIDE.md | 8 +- docs/TUI_GUIDE.md | 8 +- examples/analyze_dependencies.py | 4 +- examples/basic_usage.py | 2 +- install_mini_rag.sh | 4 +- .../claude_rag}/__init__.py | 0 mini_rag/claude_rag/__main__.py | 6 + .../claude_rag}/auto_optimizer.py | 2 +- .../claude_rag}/chunker.py | 0 {claude_rag => mini_rag/claude_rag}/cli.py | 66 ++--- {claude_rag => mini_rag/claude_rag}/config.py | 2 +- .../claude_rag}/fast_server.py | 6 +- .../claude_rag}/indexer.py | 2 +- .../claude_rag}/non_invasive_watcher.py | 0 .../claude_rag}/ollama_embeddings.py | 0 .../claude_rag}/path_handler.py | 0 .../claude_rag}/performance.py | 0 {claude_rag => mini_rag/claude_rag}/search.py | 2 +- {claude_rag => mini_rag/claude_rag}/server.py | 4 +- .../claude_rag}/smart_chunking.py | 0 .../claude_rag}/watcher.py | 0 .../claude_rag}/windows_console_fix.py | 0 rag-mini.py | 14 +- rag-tui.py | 26 +- requirements-full.txt | 2 +- requirements.txt | 2 +- tests/01_basic_integration_test.py | 8 +- tests/02_search_examples.py | 10 +- tests/03_system_validation.py | 12 +- tests/show_index_contents.py | 2 +- tests/test_context_retrieval.py | 4 +- tests/test_hybrid_search.py | 10 +- tests/test_min_chunk_size.py | 2 +- tests/test_rag_integration.py | 8 +- 41 files changed, 473 insertions(+), 122 deletions(-) delete mode 100644 claude_rag/__main__.py create mode 100644 cleanup_claude_references.py create mode 100644 cleanup_simple_branch.py rename {claude_rag => mini_rag/claude_rag}/__init__.py (100%) create mode 100644 mini_rag/claude_rag/__main__.py rename {claude_rag => mini_rag/claude_rag}/auto_optimizer.py (99%) rename {claude_rag => mini_rag/claude_rag}/chunker.py (100%) rename {claude_rag => mini_rag/claude_rag}/cli.py (94%) rename {claude_rag => mini_rag/claude_rag}/config.py (99%) rename {claude_rag => mini_rag/claude_rag}/fast_server.py (99%) rename {claude_rag => mini_rag/claude_rag}/indexer.py (99%) rename {claude_rag => mini_rag/claude_rag}/non_invasive_watcher.py (100%) rename {claude_rag => mini_rag/claude_rag}/ollama_embeddings.py (100%) rename {claude_rag => mini_rag/claude_rag}/path_handler.py (100%) rename {claude_rag => mini_rag/claude_rag}/performance.py (100%) rename {claude_rag => mini_rag/claude_rag}/search.py (99%) rename {claude_rag => mini_rag/claude_rag}/server.py (98%) rename {claude_rag => mini_rag/claude_rag}/smart_chunking.py (100%) rename {claude_rag => mini_rag/claude_rag}/watcher.py (100%) rename {claude_rag => mini_rag/claude_rag}/windows_console_fix.py (100%) diff --git a/claude_rag/__main__.py b/claude_rag/__main__.py deleted file mode 100644 index 8ca8afe..0000000 --- a/claude_rag/__main__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Main entry point for claude_rag module.""" - -from .cli import cli - -if __name__ == '__main__': - cli() \ No newline at end of file diff --git a/cleanup_claude_references.py b/cleanup_claude_references.py new file mode 100644 index 0000000..eb51dd1 --- /dev/null +++ b/cleanup_claude_references.py @@ -0,0 +1,278 @@ +#!/usr/bin/env python3 +""" +Script to completely remove all Mini-RAG references from the FSS-Mini-RAG codebase. +This ensures the repository is completely independent and avoids any licensing issues. +""" + +import os +import shutil +import re +from pathlib import Path +from typing import Dict, List, Tuple + +class Mini-RAGCleanup: + def __init__(self, project_root: Path): + self.project_root = Path(project_root).resolve() + self.replacements = { + # Directory/module names + 'mini_rag': 'mini_rag', + 'mini-rag': 'mini-rag', + + # Class names and references + 'MiniRAG': 'MiniRAG', + 'Mini RAG': 'Mini RAG', + 'Mini RAG': 'mini rag', + 'mini_rag': 'MINI_RAG', + + # File paths and imports + 'from mini_rag': 'from mini_rag', + 'import mini_rag': 'import mini_rag', + '.mini-rag': '.mini-rag', + + # Comments and documentation + 'Mini-RAG': 'Mini-RAG', + 'Mini-RAG': 'mini-rag', + + # Specific technical references + 'the development environment': 'the development environment', + 'AI assistant': 'AI assistant', + 'Mini-RAG\'s': 'the system\'s', + + # Config and metadata + 'mini_': 'mini_', + 'mini_': 'Mini_', + } + + self.files_to_rename = [] + self.dirs_to_rename = [] + self.files_modified = [] + + def scan_for_references(self) -> Dict[str, int]: + """Scan for all Mini-RAG references and return counts.""" + references = {} + + for root, dirs, files in os.walk(self.project_root): + # Skip git directory + if '.git' in root: + continue + + for file in files: + if file.endswith(('.py', '.md', '.sh', '.yaml', '.json', '.txt')): + file_path = Path(root) / file + try: + with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: + content = f.read() + + for old_ref in self.replacements.keys(): + count = content.lower().count(old_ref.lower()) + if count > 0: + if old_ref not in references: + references[old_ref] = 0 + references[old_ref] += count + + except Exception as e: + print(f"Warning: Could not scan {file_path}: {e}") + + return references + + def rename_directories(self): + """Rename directories with Mini-RAG references.""" + print("๐Ÿ”„ Renaming directories...") + + # Find directories to rename + for root, dirs, files in os.walk(self.project_root): + if '.git' in root: + continue + + for dir_name in dirs: + if 'Mini-RAG' in dir_name.lower(): + old_path = Path(root) / dir_name + new_name = dir_name.replace('mini_rag', 'mini_rag').replace('mini-rag', 'mini-rag') + new_path = Path(root) / new_name + self.dirs_to_rename.append((old_path, new_path)) + + # Actually rename directories (do this carefully with git) + for old_path, new_path in self.dirs_to_rename: + if old_path.exists(): + print(f" ๐Ÿ“ {old_path.name} โ†’ {new_path.name}") + # Use git mv to preserve history + try: + os.system(f'git mv "{old_path}" "{new_path}"') + except Exception as e: + print(f" Warning: git mv failed, using regular rename: {e}") + shutil.move(str(old_path), str(new_path)) + + def update_file_contents(self): + """Update file contents to replace Mini-RAG references.""" + print("๐Ÿ“ Updating file contents...") + + for root, dirs, files in os.walk(self.project_root): + if '.git' in root: + continue + + for file in files: + if file.endswith(('.py', '.md', '.sh', '.yaml', '.json', '.txt')): + file_path = Path(root) / file + + try: + with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: + original_content = f.read() + + modified_content = original_content + changes_made = False + + # Apply replacements in order (most specific first) + sorted_replacements = sorted(self.replacements.items(), + key=lambda x: len(x[0]), reverse=True) + + for old_ref, new_ref in sorted_replacements: + if old_ref in modified_content: + modified_content = modified_content.replace(old_ref, new_ref) + changes_made = True + + # Also handle case variations + if old_ref.lower() in modified_content.lower(): + # Use regex for case-insensitive replacement + pattern = re.escape(old_ref) + modified_content = re.sub(pattern, new_ref, modified_content, flags=re.IGNORECASE) + changes_made = True + + # Write back if changes were made + if changes_made and modified_content != original_content: + with open(file_path, 'w', encoding='utf-8') as f: + f.write(modified_content) + self.files_modified.append(file_path) + print(f" ๐Ÿ“„ Updated: {file_path.relative_to(self.project_root)}") + + except Exception as e: + print(f"Warning: Could not process {file_path}: {e}") + + def update_imports_and_paths(self): + """Update Python imports and file paths.""" + print("๐Ÿ”— Updating imports and paths...") + + # Special handling for Python imports + for root, dirs, files in os.walk(self.project_root): + if '.git' in root: + continue + + for file in files: + if file.endswith('.py'): + file_path = Path(root) / file + + try: + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + + # Fix relative imports + content = re.sub(r'from \.mini_rag', 'from .mini_rag', content) + content = re.sub(r'from mini_rag', 'from mini_rag', content) + content = re.sub(r'import mini_rag', 'import mini_rag', content) + + # Fix file paths in strings + content = content.replace("'mini_rag'", "'mini_rag'") + content = content.replace('"mini_rag"', '"mini_rag"') + content = content.replace("'mini-rag'", "'mini-rag'") + content = content.replace('"mini-rag"', '"mini-rag"') + content = content.replace("'.mini-rag'", "'.mini-rag'") + content = content.replace('".mini-rag"', '".mini-rag"') + + with open(file_path, 'w', encoding='utf-8') as f: + f.write(content) + + except Exception as e: + print(f"Warning: Could not update imports in {file_path}: {e}") + + def verify_cleanup(self) -> Tuple[int, List[str]]: + """Verify that cleanup was successful.""" + print("๐Ÿ” Verifying cleanup...") + + remaining_refs = [] + total_count = 0 + + for root, dirs, files in os.walk(self.project_root): + if '.git' in root: + continue + + for file in files: + if file.endswith(('.py', '.md', '.sh', '.yaml', '.json', '.txt')): + file_path = Path(root) / file + try: + with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: + content = f.read() + + # Look for any remaining "Mini-RAG" references (case insensitive) + lines = content.split('\n') + for i, line in enumerate(lines, 1): + if 'Mini-RAG' in line.lower(): + remaining_refs.append(f"{file_path}:{i}: {line.strip()}") + total_count += 1 + + except Exception: + pass + + return total_count, remaining_refs + + def run_cleanup(self): + """Run the complete cleanup process.""" + print("๐Ÿงน Starting Mini-RAG Reference Cleanup") + print("=" * 50) + + # Initial scan + print("๐Ÿ“Š Scanning for Mini-RAG references...") + initial_refs = self.scan_for_references() + print(f"Found {sum(initial_refs.values())} total references") + for ref, count in sorted(initial_refs.items(), key=lambda x: x[1], reverse=True): + if count > 0: + print(f" โ€ข {ref}: {count} occurrences") + print() + + # Rename directories first + self.rename_directories() + + # Update file contents + self.update_file_contents() + + # Fix imports and paths + self.update_imports_and_paths() + + # Verify cleanup + remaining_count, remaining_refs = self.verify_cleanup() + + print("\n" + "=" * 50) + print("๐ŸŽฏ Cleanup Summary:") + print(f"๐Ÿ“ Directories renamed: {len(self.dirs_to_rename)}") + print(f"๐Ÿ“„ Files modified: {len(self.files_modified)}") + print(f"โš ๏ธ Remaining references: {remaining_count}") + + if remaining_refs: + print("\nRemaining Mini-RAG references to review:") + for ref in remaining_refs[:10]: # Show first 10 + print(f" โ€ข {ref}") + if len(remaining_refs) > 10: + print(f" ... and {len(remaining_refs) - 10} more") + + if remaining_count == 0: + print("โœ… Cleanup successful! No Mini-RAG references remain.") + else: + print("โš ๏ธ Some references remain - please review manually.") + + return remaining_count == 0 + +def main(): + project_root = Path(__file__).parent + cleaner = Mini-RAGCleanup(project_root) + + success = cleaner.run_cleanup() + + if success: + print("\n๐ŸŽ‰ Ready to commit changes!") + print("Next steps:") + print("1. Review changes: git status") + print("2. Test the application: ./rag-mini --help") + print("3. Commit changes: git add . && git commit -m 'Remove all Mini-RAG references'") + else: + print("\nโš ๏ธ Manual review required before committing.") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/cleanup_simple_branch.py b/cleanup_simple_branch.py new file mode 100644 index 0000000..d3e5a7f --- /dev/null +++ b/cleanup_simple_branch.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +""" +Simple cleanup script to rename claude_rag to mini_rag and fix references. +Designed specifically for the v1.0-simple-search branch. +""" + +import os +import shutil +import re +from pathlib import Path + +def main(): + print("๐Ÿงน Cleaning up Claude references in v1.0-simple-search branch...") + + # 1. Rename the claude_rag directory to mini_rag + claude_dir = Path("claude_rag") + mini_dir = Path("mini_rag") + + if claude_dir.exists() and not mini_dir.exists(): + print(f"๐Ÿ“ Renaming {claude_dir} โ†’ {mini_dir}") + os.system(f'git mv claude_rag mini_rag') + else: + print("๐Ÿ“ Directory already renamed or doesn't exist") + + # 2. Find and replace references in files + replacements = [ + ('claude_rag', 'mini_rag'), + ('claude-rag', 'mini-rag'), + ('.claude-rag', '.mini-rag'), + ('from claude_rag', 'from mini_rag'), + ('import claude_rag', 'import mini_rag'), + ('Claude RAG', 'Mini RAG'), + ('Claude Code', 'the development environment'), + ] + + files_to_update = [] + + # Find all relevant files + for pattern in ['**/*.py', '**/*.md', '**/*.sh', '**/*.yaml', '**/*.txt']: + files_to_update.extend(Path('.').glob(pattern)) + + updated_count = 0 + + for file_path in files_to_update: + if '.git' in str(file_path) or file_path.name == 'cleanup_simple_branch.py': + continue + + try: + with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: + content = f.read() + + original_content = content + + # Apply replacements + for old, new in replacements: + content = content.replace(old, new) + + # Write back if changed + if content != original_content: + with open(file_path, 'w', encoding='utf-8') as f: + f.write(content) + print(f" ๐Ÿ“„ Updated: {file_path}") + updated_count += 1 + + except Exception as e: + print(f" โš ๏ธ Error processing {file_path}: {e}") + + print(f"\nโœ… Cleanup complete!") + print(f"๐Ÿ“„ Files updated: {updated_count}") + print(f"๐Ÿ“ Directory renamed: claude_rag โ†’ mini_rag") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/docs/DIAGRAMS.md b/docs/DIAGRAMS.md index 57c0912..6d0f278 100644 --- a/docs/DIAGRAMS.md +++ b/docs/DIAGRAMS.md @@ -210,7 +210,7 @@ graph LR subgraph "Configuration Sources" Default[๐Ÿญ Built-in Defaults] Global[๐ŸŒ ~/.config/fss-mini-rag/config.yaml] - Project[๐Ÿ“ project/.claude-rag/config.yaml] + Project[๐Ÿ“ project/.mini-rag/config.yaml] Env[๐Ÿ”ง Environment Variables] end diff --git a/docs/FALLBACK_SETUP.md b/docs/FALLBACK_SETUP.md index e4784eb..5b9522a 100644 --- a/docs/FALLBACK_SETUP.md +++ b/docs/FALLBACK_SETUP.md @@ -31,7 +31,7 @@ pip install -r requirements-full.txt ## ๐Ÿ”ง **Configuration** -Edit `.claude-rag/config.json` in your project: +Edit `.mini-rag/config.json` in your project: ```json { "embedding": { @@ -45,7 +45,7 @@ Edit `.claude-rag/config.json` in your project: ## ๐Ÿ“Š **Status Check** ```python -from claude_rag.ollama_embeddings import OllamaEmbedder +from mini_rag.ollama_embeddings import OllamaEmbedder embedder = OllamaEmbedder() status = embedder.get_status() diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index c7e9429..38b93be 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -41,7 +41,7 @@ pip install -r requirements-full.txt # Index any project directory ./rag-mini index /path/to/your/project -# The system creates .claude-rag/ directory with: +# The system creates .mini-rag/ directory with: # - config.json (settings) # - manifest.json (file tracking) # - database.lance/ (vector database) @@ -62,7 +62,7 @@ pip install -r requirements-full.txt ## Step 5: Customize Configuration -Edit `project/.claude-rag/config.json`: +Edit `project/.mini-rag/config.json`: ```json { @@ -109,7 +109,7 @@ Then re-index to apply changes: ## Python API Usage ```python -from claude_rag import ProjectIndexer, CodeSearcher, CodeEmbedder +from mini_rag import ProjectIndexer, CodeSearcher, CodeEmbedder from pathlib import Path # Initialize @@ -149,7 +149,7 @@ for i, result in enumerate(results, 1): ### File Watching ```python -from claude_rag import FileWatcher +from mini_rag import FileWatcher # Watch for file changes and auto-update index watcher = FileWatcher(project_path, indexer) @@ -160,7 +160,7 @@ watcher.start_watching() ### Custom Chunking ```python -from claude_rag import CodeChunker +from mini_rag import CodeChunker chunker = CodeChunker() @@ -194,9 +194,9 @@ for chunk in chunks: ### For Troubleshooting - Check `./rag-mini status` to see what was indexed -- Look at `.claude-rag/manifest.json` for file details +- Look at `.mini-rag/manifest.json` for file details - Run with `--force` to completely rebuild index -- Check logs in `.claude-rag/` directory for errors +- Check logs in `.mini-rag/` directory for errors ## What's Next? diff --git a/docs/SMART_TUNING_GUIDE.md b/docs/SMART_TUNING_GUIDE.md index 6deb6e3..484899f 100644 --- a/docs/SMART_TUNING_GUIDE.md +++ b/docs/SMART_TUNING_GUIDE.md @@ -87,7 +87,7 @@ The system automatically suggests improvements based on: ## ๐Ÿ› ๏ธ **Manual Tuning Options** ### **Custom Configuration** -Edit `.claude-rag/config.json` in your project: +Edit `.mini-rag/config.json` in your project: ```json { "chunking": { diff --git a/docs/TECHNICAL_GUIDE.md b/docs/TECHNICAL_GUIDE.md index 75dc4bc..eb6b72a 100644 --- a/docs/TECHNICAL_GUIDE.md +++ b/docs/TECHNICAL_GUIDE.md @@ -562,7 +562,7 @@ def load_configuration(self, project_path: Path) -> RAGConfig: config = self._merge_configs(config, global_config) # 3. Apply project-specific config - project_config_path = project_path / '.claude-rag' / 'config.yaml' + project_config_path = project_path / '.mini-rag' / 'config.yaml' if project_config_path.exists(): project_config = self._load_yaml_config(project_config_path) config = self._merge_configs(config, project_config) @@ -714,7 +714,7 @@ The system validates data integrity and can recover from corruption: def validate_index_integrity(self, project_path: Path) -> bool: """Validate that the index is consistent and complete.""" try: - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' # Check required files exist required_files = ['manifest.json', 'database.lance'] @@ -751,10 +751,10 @@ def validate_index_integrity(self, project_path: Path) -> bool: def repair_index(self, project_path: Path) -> bool: """Attempt to repair a corrupted index.""" try: - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' # Create backup of existing index - backup_dir = rag_dir.parent / f'.claude-rag-backup-{int(time.time())}' + backup_dir = rag_dir.parent / f'.mini-rag-backup-{int(time.time())}' shutil.copytree(rag_dir, backup_dir) # Attempt repair operations diff --git a/docs/TUI_GUIDE.md b/docs/TUI_GUIDE.md index 58195f2..4c46131 100644 --- a/docs/TUI_GUIDE.md +++ b/docs/TUI_GUIDE.md @@ -56,7 +56,7 @@ That's it! The TUI will guide you through everything. - Scans all files in project directory - Breaks text into searchable chunks - Creates embeddings (AI numerical representations) -- Stores in local database (`.claude-rag/` folder) +- Stores in local database (`.mini-rag/` folder) **Interactive Elements**: - **Force re-index option** - Completely rebuild if needed @@ -67,7 +67,7 @@ That's it! The TUI will guide you through everything. - Why indexing is necessary (one-time setup per project) - What gets indexed (code files, documentation, configs) - How fast the system works -- Storage location (`.claude-rag/` directory) +- Storage location (`.mini-rag/` directory) **CLI Commands Shown**: ```bash @@ -168,8 +168,8 @@ That's it! The TUI will guide you through everything. **CLI Commands Shown**: ```bash -cat /path/to/project/.claude-rag/config.yaml # View config -nano /path/to/project/.claude-rag/config.yaml # Edit config +cat /path/to/project/.mini-rag/config.yaml # View config +nano /path/to/project/.mini-rag/config.yaml # Edit config ``` ### 6. CLI Command Reference diff --git a/examples/analyze_dependencies.py b/examples/analyze_dependencies.py index 5226e02..7211b61 100644 --- a/examples/analyze_dependencies.py +++ b/examples/analyze_dependencies.py @@ -34,11 +34,11 @@ def find_imports_in_file(file_path): def analyze_dependencies(): """Analyze all dependencies in the project.""" project_root = Path(__file__).parent - claude_rag_dir = project_root / "claude_rag" + mini_rag_dir = project_root / "mini_rag" # Find all Python files python_files = [] - for file_path in claude_rag_dir.glob("*.py"): + for file_path in mini_rag_dir.glob("*.py"): if file_path.name != "__pycache__": python_files.append(file_path) diff --git a/examples/basic_usage.py b/examples/basic_usage.py index da0f96d..ecac475 100644 --- a/examples/basic_usage.py +++ b/examples/basic_usage.py @@ -5,7 +5,7 @@ Shows how to index a project and search it programmatically. """ from pathlib import Path -from claude_rag import ProjectIndexer, CodeSearcher, CodeEmbedder +from mini_rag import ProjectIndexer, CodeSearcher, CodeEmbedder def main(): # Example project path - change this to your project diff --git a/install_mini_rag.sh b/install_mini_rag.sh index b381462..e6caf60 100755 --- a/install_mini_rag.sh +++ b/install_mini_rag.sh @@ -492,7 +492,7 @@ test_installation() { print_info "Testing basic functionality..." # Test import - if python3 -c "from claude_rag import CodeEmbedder, ProjectIndexer, CodeSearcher; print('โœ… Import successful')" 2>/dev/null; then + if python3 -c "from mini_rag import CodeEmbedder, ProjectIndexer, CodeSearcher; print('โœ… Import successful')" 2>/dev/null; then print_success "Python imports working" else print_error "Import test failed" @@ -501,7 +501,7 @@ test_installation() { # Test embedding system if python3 -c " -from claude_rag import CodeEmbedder +from mini_rag import CodeEmbedder embedder = CodeEmbedder() info = embedder.get_embedding_info() print(f'โœ… Embedding system: {info[\"method\"]}') diff --git a/claude_rag/__init__.py b/mini_rag/claude_rag/__init__.py similarity index 100% rename from claude_rag/__init__.py rename to mini_rag/claude_rag/__init__.py diff --git a/mini_rag/claude_rag/__main__.py b/mini_rag/claude_rag/__main__.py new file mode 100644 index 0000000..77409db --- /dev/null +++ b/mini_rag/claude_rag/__main__.py @@ -0,0 +1,6 @@ +"""Main entry point for mini_rag module.""" + +from .cli import cli + +if __name__ == '__main__': + cli() \ No newline at end of file diff --git a/claude_rag/auto_optimizer.py b/mini_rag/claude_rag/auto_optimizer.py similarity index 99% rename from claude_rag/auto_optimizer.py rename to mini_rag/claude_rag/auto_optimizer.py index cd839c7..3477d9e 100644 --- a/claude_rag/auto_optimizer.py +++ b/mini_rag/claude_rag/auto_optimizer.py @@ -16,7 +16,7 @@ class AutoOptimizer: def __init__(self, project_path: Path): self.project_path = project_path - self.rag_dir = project_path / '.claude-rag' + self.rag_dir = project_path / '.mini-rag' self.config_path = self.rag_dir / 'config.json' self.manifest_path = self.rag_dir / 'manifest.json' diff --git a/claude_rag/chunker.py b/mini_rag/claude_rag/chunker.py similarity index 100% rename from claude_rag/chunker.py rename to mini_rag/claude_rag/chunker.py diff --git a/claude_rag/cli.py b/mini_rag/claude_rag/cli.py similarity index 94% rename from claude_rag/cli.py rename to mini_rag/claude_rag/cli.py index e4c87a5..6fe4a3b 100644 --- a/claude_rag/cli.py +++ b/mini_rag/claude_rag/cli.py @@ -1,5 +1,5 @@ """ -Command-line interface for Claude RAG system. +Command-line interface for Mini RAG system. Beautiful, intuitive, and highly effective. """ @@ -47,9 +47,9 @@ console = Console() @click.option('--quiet', '-q', is_flag=True, help='Suppress output') def cli(verbose: bool, quiet: bool): """ - Claude RAG - Fast semantic code search that actually works. + Mini RAG - Fast semantic code search that actually works. - A local RAG system for improving Claude Code's grounding capabilities. + A local RAG system for improving the development environment's grounding capabilities. Indexes your codebase and enables lightning-fast semantic search. """ if verbose: @@ -71,10 +71,10 @@ def init(path: str, force: bool, reindex: bool, model: Optional[str]): """Initialize RAG index for a project.""" project_path = Path(path).resolve() - console.print(f"\n[bold cyan]Initializing Claude RAG for:[/bold cyan] {project_path}\n") + console.print(f"\n[bold cyan]Initializing Mini RAG for:[/bold cyan] {project_path}\n") # Check if already initialized - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' force_reindex = force or reindex if rag_dir.exists() and not force_reindex: console.print("[yellow][/yellow] Project already initialized!") @@ -131,9 +131,9 @@ def init(path: str, force: bool, reindex: bool, model: Optional[str]): # Show how to use console.print("\n[bold]Next steps:[/bold]") - console.print(" โ€ข Search your code: [cyan]claude-rag search \"your query\"[/cyan]") - console.print(" โ€ข Watch for changes: [cyan]claude-rag watch[/cyan]") - console.print(" โ€ข View statistics: [cyan]claude-rag stats[/cyan]\n") + console.print(" โ€ข Search your code: [cyan]mini-rag search \"your query\"[/cyan]") + console.print(" โ€ข Watch for changes: [cyan]mini-rag watch[/cyan]") + console.print(" โ€ข View statistics: [cyan]mini-rag stats[/cyan]\n") except Exception as e: console.print(f"\n[bold red]Error:[/bold red] {e}") @@ -160,9 +160,9 @@ def search(query: str, path: str, top_k: int, type: tuple, lang: tuple, show_con project_path = Path(path).resolve() # Check if indexed - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if not rag_dir.exists(): - console.print("[red]Error:[/red] Project not indexed. Run 'claude-rag init' first.") + console.print("[red]Error:[/red] Project not indexed. Run 'mini-rag init' first.") sys.exit(1) # Get performance monitor @@ -258,7 +258,7 @@ def search(query: str, path: str, top_k: int, type: tuple, lang: tuple, show_con # Show performance summary if monitor: monitor.print_summary() - console.print(" โ€ข Check if files are indexed with 'claude-rag stats'") + console.print(" โ€ข Check if files are indexed with 'mini-rag stats'") except Exception as e: console.print(f"\n[bold red]Search error:[/bold red] {e}") @@ -274,9 +274,9 @@ def stats(path: str): project_path = Path(path).resolve() # Check if indexed - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if not rag_dir.exists(): - console.print("[red]Error:[/red] Project not indexed. Run 'claude-rag init' first.") + console.print("[red]Error:[/red] Project not indexed. Run 'mini-rag init' first.") sys.exit(1) try: @@ -343,7 +343,7 @@ def debug_schema(path: str): project_path = Path(path).resolve() try: - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if not rag_dir.exists(): console.print("[red]No RAG index found. Run 'init' first.[/red]") @@ -406,10 +406,10 @@ def watch(path: str, delay: float, silent: bool): project_path = Path(path).resolve() # Check if indexed - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if not rag_dir.exists(): if not silent: - console.print("[red]Error:[/red] Project not indexed. Run 'claude-rag init' first.") + console.print("[red]Error:[/red] Project not indexed. Run 'mini-rag init' first.") sys.exit(1) try: @@ -532,9 +532,9 @@ def update(path: str): project_path = Path(path).resolve() # Check if indexed - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if not rag_dir.exists(): - console.print("[red]Error:[/red] Project not indexed. Run 'claude-rag init' first.") + console.print("[red]Error:[/red] Project not indexed. Run 'mini-rag init' first.") sys.exit(1) try: @@ -558,21 +558,21 @@ def update(path: str): @cli.command() @click.option('--show-code', '-c', is_flag=True, help='Show example code') def info(show_code: bool): - """Show information about Claude RAG.""" + """Show information about Mini RAG.""" # Create info panel info_text = """ -[bold cyan]Claude RAG[/bold cyan] - Local Semantic Code Search +[bold cyan]Mini RAG[/bold cyan] - Local Semantic Code Search [bold]Features:[/bold] โ€ข Fast code indexing with AST-aware chunking โ€ข Semantic search using CodeBERT embeddings โ€ข Real-time file watching and incremental updates โ€ข Language-aware parsing for Python, JS, Go, and more -โ€ข MCP integration for Claude Code +โ€ข MCP integration for the development environment [bold]How it works:[/bold] 1. Indexes your codebase into semantic chunks -2. Stores vectors locally in .claude-rag/ directory +2. Stores vectors locally in .mini-rag/ directory 3. Enables natural language search across your code 4. Updates automatically as you modify files @@ -582,28 +582,28 @@ def info(show_code: bool): โ€ข Storage: ~200MB for 10k files """ - panel = Panel(info_text, title="About Claude RAG", border_style="cyan") + panel = Panel(info_text, title="About Mini RAG", border_style="cyan") console.print(panel) if show_code: console.print("\n[bold]Example Usage:[/bold]\n") code = """# Initialize a project -claude-rag init +mini-rag init # Search for code -claude-rag search "database connection" -claude-rag search "auth middleware" --type function +mini-rag search "database connection" +mini-rag search "auth middleware" --type function # Find specific functions or classes -claude-rag find-function connect_to_db -claude-rag find-class UserModel +mini-rag find-function connect_to_db +mini-rag find-class UserModel # Watch for changes -claude-rag watch +mini-rag watch # Get statistics -claude-rag stats""" +mini-rag stats""" syntax = Syntax(code, "bash", theme="monokai") console.print(syntax) @@ -619,9 +619,9 @@ def server(path: str, port: int): project_path = Path(path).resolve() # Check if indexed - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if not rag_dir.exists(): - console.print("[red]Error:[/red] Project not indexed. Run 'claude-rag init' first.") + console.print("[red]Error:[/red] Project not indexed. Run 'mini-rag init' first.") sys.exit(1) try: @@ -667,7 +667,7 @@ def status(path: str, port: int, discovery: bool): # Check index status console.print("\n[bold]๐Ÿ—‚๏ธ Index Status:[/bold]") - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if rag_dir.exists(): try: indexer = ProjectIndexer(project_path) diff --git a/claude_rag/config.py b/mini_rag/claude_rag/config.py similarity index 99% rename from claude_rag/config.py rename to mini_rag/claude_rag/config.py index 4e5ccf8..1242ac1 100644 --- a/claude_rag/config.py +++ b/mini_rag/claude_rag/config.py @@ -95,7 +95,7 @@ class ConfigManager: def __init__(self, project_path: Path): self.project_path = Path(project_path) - self.rag_dir = self.project_path / '.claude-rag' + self.rag_dir = self.project_path / '.mini-rag' self.config_path = self.rag_dir / 'config.yaml' def load_config(self) -> RAGConfig: diff --git a/claude_rag/fast_server.py b/mini_rag/claude_rag/fast_server.py similarity index 99% rename from claude_rag/fast_server.py rename to mini_rag/claude_rag/fast_server.py index 91b48a6..d7dee4a 100644 --- a/claude_rag/fast_server.py +++ b/mini_rag/claude_rag/fast_server.py @@ -206,7 +206,7 @@ class FastRAGServer: def _check_indexing_needed(self) -> bool: """Quick check if indexing is needed""" - rag_dir = self.project_path / '.claude-rag' + rag_dir = self.project_path / '.mini-rag' if not rag_dir.exists(): return True @@ -492,7 +492,7 @@ class FastRAGServer: f"๐Ÿ“ Project: {self.project_path.name}\n" f"๐Ÿง  Model: {getattr(self.embedder, 'model_name', 'default')}\n" f"๐Ÿ“Š Chunks Indexed: {self.status.health_checks.get('database', {}).get('chunks', 0)}\n\n" - f"[dim]Ready to serve Claude Code queries...[/dim]", + f"[dim]Ready to serve the development environment queries...[/dim]", title="๐Ÿš€ Server Status", border_style="green" ) @@ -698,7 +698,7 @@ class FastRAGClient: except ConnectionRefusedError: return { 'success': False, - 'error': 'RAG server not running. Start with: python -m claude_rag server', + 'error': 'RAG server not running. Start with: python -m mini_rag server', 'error_type': 'connection_refused' } except socket.timeout: diff --git a/claude_rag/indexer.py b/mini_rag/claude_rag/indexer.py similarity index 99% rename from claude_rag/indexer.py rename to mini_rag/claude_rag/indexer.py index 6800e04..4462aed 100644 --- a/claude_rag/indexer.py +++ b/mini_rag/claude_rag/indexer.py @@ -44,7 +44,7 @@ class ProjectIndexer: max_workers: Number of parallel workers for indexing """ self.project_path = Path(project_path).resolve() - self.rag_dir = self.project_path / '.claude-rag' + self.rag_dir = self.project_path / '.mini-rag' self.manifest_path = self.rag_dir / 'manifest.json' self.config_path = self.rag_dir / 'config.json' diff --git a/claude_rag/non_invasive_watcher.py b/mini_rag/claude_rag/non_invasive_watcher.py similarity index 100% rename from claude_rag/non_invasive_watcher.py rename to mini_rag/claude_rag/non_invasive_watcher.py diff --git a/claude_rag/ollama_embeddings.py b/mini_rag/claude_rag/ollama_embeddings.py similarity index 100% rename from claude_rag/ollama_embeddings.py rename to mini_rag/claude_rag/ollama_embeddings.py diff --git a/claude_rag/path_handler.py b/mini_rag/claude_rag/path_handler.py similarity index 100% rename from claude_rag/path_handler.py rename to mini_rag/claude_rag/path_handler.py diff --git a/claude_rag/performance.py b/mini_rag/claude_rag/performance.py similarity index 100% rename from claude_rag/performance.py rename to mini_rag/claude_rag/performance.py diff --git a/claude_rag/search.py b/mini_rag/claude_rag/search.py similarity index 99% rename from claude_rag/search.py rename to mini_rag/claude_rag/search.py index d571e03..3552f6e 100644 --- a/claude_rag/search.py +++ b/mini_rag/claude_rag/search.py @@ -93,7 +93,7 @@ class CodeSearcher: embedder: CodeEmbedder instance (creates one if not provided) """ self.project_path = Path(project_path).resolve() - self.rag_dir = self.project_path / '.claude-rag' + self.rag_dir = self.project_path / '.mini-rag' self.embedder = embedder or CodeEmbedder() # Initialize database connection diff --git a/claude_rag/server.py b/mini_rag/claude_rag/server.py similarity index 98% rename from claude_rag/server.py rename to mini_rag/claude_rag/server.py index c4849e4..3d43e0a 100644 --- a/claude_rag/server.py +++ b/mini_rag/claude_rag/server.py @@ -272,7 +272,7 @@ class RAGClient: except ConnectionRefusedError: return { 'success': False, - 'error': 'RAG server not running. Start with: claude-rag server' + 'error': 'RAG server not running. Start with: mini-rag server' } except ConnectionError as e: # Try legacy mode without message framing @@ -389,7 +389,7 @@ def auto_start_if_needed(project_path: Path) -> Optional[subprocess.Popen]: if not client.is_running(): # Start server in background import subprocess - cmd = [sys.executable, "-m", "claude_rag.cli", "server", "--path", str(project_path)] + cmd = [sys.executable, "-m", "mini_rag.cli", "server", "--path", str(project_path)] process = subprocess.Popen( cmd, stdout=subprocess.PIPE, diff --git a/claude_rag/smart_chunking.py b/mini_rag/claude_rag/smart_chunking.py similarity index 100% rename from claude_rag/smart_chunking.py rename to mini_rag/claude_rag/smart_chunking.py diff --git a/claude_rag/watcher.py b/mini_rag/claude_rag/watcher.py similarity index 100% rename from claude_rag/watcher.py rename to mini_rag/claude_rag/watcher.py diff --git a/claude_rag/windows_console_fix.py b/mini_rag/claude_rag/windows_console_fix.py similarity index 100% rename from claude_rag/windows_console_fix.py rename to mini_rag/claude_rag/windows_console_fix.py diff --git a/rag-mini.py b/rag-mini.py index 0b5703f..5e39c50 100644 --- a/rag-mini.py +++ b/rag-mini.py @@ -15,9 +15,9 @@ import logging # Add the RAG system to the path sys.path.insert(0, str(Path(__file__).parent)) -from claude_rag.indexer import ProjectIndexer -from claude_rag.search import CodeSearcher -from claude_rag.ollama_embeddings import OllamaEmbedder +from mini_rag.indexer import ProjectIndexer +from mini_rag.search import CodeSearcher +from mini_rag.ollama_embeddings import OllamaEmbedder # Configure logging for user-friendly output logging.basicConfig( @@ -34,7 +34,7 @@ def index_project(project_path: Path, force: bool = False): print(f"๐Ÿš€ {action} {project_path.name}") # Quick pre-check - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if rag_dir.exists() and not force: print(" Checking for changes...") @@ -63,7 +63,7 @@ def index_project(project_path: Path, force: bool = False): print(f"โš ๏ธ {failed_count} files failed (check logs with --verbose)") # Quick tip for first-time users - if not (project_path / '.claude-rag' / 'last_search').exists(): + if not (project_path / '.mini-rag' / 'last_search').exists(): print(f"\n๐Ÿ’ก Try: rag-mini search {project_path} \"your search here\"") except Exception as e: @@ -75,7 +75,7 @@ def search_project(project_path: Path, query: str, limit: int = 5): """Search a project directory.""" try: # Check if indexed first - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if not rag_dir.exists(): print(f"โŒ Project not indexed: {project_path.name}") print(f" Run: rag-mini index {project_path}") @@ -144,7 +144,7 @@ def status_check(project_path: Path): print() # Check project indexing status first - rag_dir = project_path / '.claude-rag' + rag_dir = project_path / '.mini-rag' if not rag_dir.exists(): print("โŒ Project not indexed") print(f" Run: rag-mini index {project_path}") diff --git a/rag-tui.py b/rag-tui.py index 60fb8c2..9108c6b 100755 --- a/rag-tui.py +++ b/rag-tui.py @@ -136,7 +136,7 @@ class SimpleTUI: print("=================") print() - # Look for .claude-rag directories in common locations + # Look for .mini-rag directories in common locations search_paths = [ Path.home(), Path.home() / "projects", @@ -152,7 +152,7 @@ class SimpleTUI: try: for item in search_path.iterdir(): if item.is_dir(): - rag_dir = item / '.claude-rag' + rag_dir = item / '.mini-rag' if rag_dir.exists(): recent_projects.append(item) except (PermissionError, OSError): @@ -161,19 +161,19 @@ class SimpleTUI: # Remove duplicates and sort by modification time recent_projects = list(set(recent_projects)) try: - recent_projects.sort(key=lambda p: (p / '.claude-rag').stat().st_mtime, reverse=True) + recent_projects.sort(key=lambda p: (p / '.mini-rag').stat().st_mtime, reverse=True) except: pass if not recent_projects: print("โŒ No recently indexed projects found") - print(" Projects with .claude-rag directories will appear here") + print(" Projects with .mini-rag directories will appear here") return print("Found indexed projects:") for i, project in enumerate(recent_projects[:10], 1): # Show up to 10 try: - manifest = project / '.claude-rag' / 'manifest.json' + manifest = project / '.mini-rag' / 'manifest.json' if manifest.exists(): with open(manifest) as f: data = json.load(f) @@ -211,7 +211,7 @@ class SimpleTUI: print() # Check if already indexed - rag_dir = self.project_path / '.claude-rag' + rag_dir = self.project_path / '.mini-rag' if rag_dir.exists(): print("โš ๏ธ Project appears to be already indexed") print() @@ -233,7 +233,7 @@ class SimpleTUI: try: # Import here to avoid startup delays sys.path.insert(0, str(Path(__file__).parent)) - from claude_rag.indexer import ProjectIndexer + from mini_rag.indexer import ProjectIndexer indexer = ProjectIndexer(self.project_path) result = indexer.index_project(force_reindex=force) @@ -262,7 +262,7 @@ class SimpleTUI: return # Check if indexed - rag_dir = self.project_path / '.claude-rag' + rag_dir = self.project_path / '.mini-rag' if not rag_dir.exists(): print(f"โŒ Project not indexed: {self.project_path.name}") print(" Index the project first!") @@ -303,7 +303,7 @@ class SimpleTUI: # Actually run the search try: sys.path.insert(0, str(Path(__file__).parent)) - from claude_rag.search import CodeSearcher + from mini_rag.search import CodeSearcher searcher = CodeSearcher(self.project_path) results = searcher.search(query, top_k=limit) @@ -376,7 +376,7 @@ class SimpleTUI: self.print_cli_command(cli_cmd, "Show detailed status information") # Check project status - rag_dir = self.project_path / '.claude-rag' + rag_dir = self.project_path / '.mini-rag' if rag_dir.exists(): try: manifest = rag_dir / 'manifest.json' @@ -404,7 +404,7 @@ class SimpleTUI: # Show embedding system status try: sys.path.insert(0, str(Path(__file__).parent)) - from claude_rag.ollama_embeddings import OllamaEmbedder + from mini_rag.ollama_embeddings import OllamaEmbedder embedder = OllamaEmbedder() info = embedder.get_embedding_info() @@ -442,7 +442,7 @@ class SimpleTUI: print(f"Project: {self.project_path.name}") print() - config_path = self.project_path / '.claude-rag' / 'config.yaml' + config_path = self.project_path / '.mini-rag' / 'config.yaml' # Show current configuration if it exists if config_path.exists(): @@ -570,7 +570,7 @@ class SimpleTUI: # Show current project status if self.project_path: - rag_dir = self.project_path / '.claude-rag' + rag_dir = self.project_path / '.mini-rag' status = "โœ… Indexed" if rag_dir.exists() else "โŒ Not indexed" print(f"๐Ÿ“ Current project: {self.project_path.name} ({status})") print() diff --git a/requirements-full.txt b/requirements-full.txt index d00daf2..067a8bb 100644 --- a/requirements-full.txt +++ b/requirements-full.txt @@ -1,4 +1,4 @@ -# Full Claude RAG - With ML Fallback +# Full Mini RAG - With ML Fallback # Base lightweight dependencies + ML stack for offline use # Lightweight dependencies (always required) diff --git a/requirements.txt b/requirements.txt index 9be712e..fad790b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -# Lightweight Claude RAG - Ollama Edition +# Lightweight Mini RAG - Ollama Edition # Removed: torch, transformers, sentence-transformers (5.2GB+ saved) # Core vector database and data handling diff --git a/tests/01_basic_integration_test.py b/tests/01_basic_integration_test.py index 87d20b9..281322a 100644 --- a/tests/01_basic_integration_test.py +++ b/tests/01_basic_integration_test.py @@ -12,10 +12,10 @@ if sys.platform == 'win32': os.environ['PYTHONUTF8'] = '1' sys.stdout.reconfigure(encoding='utf-8') -from claude_rag.chunker import CodeChunker -from claude_rag.indexer import ProjectIndexer -from claude_rag.search import CodeSearcher -from claude_rag.embeddings import CodeEmbedder +from mini_rag.chunker import CodeChunker +from mini_rag.indexer import ProjectIndexer +from mini_rag.search import CodeSearcher +from mini_rag.embeddings import CodeEmbedder def main(): print("=" * 60) diff --git a/tests/02_search_examples.py b/tests/02_search_examples.py index a87b78b..b478d97 100644 --- a/tests/02_search_examples.py +++ b/tests/02_search_examples.py @@ -10,7 +10,7 @@ from rich.syntax import Syntax from rich.panel import Panel from rich.table import Table -from claude_rag.search import CodeSearcher +from mini_rag.search import CodeSearcher console = Console() @@ -18,7 +18,7 @@ console = Console() def demo_search(project_path: Path): """Run demo searches showing the hybrid system in action.""" - console.print("\n[bold cyan]Claude RAG Hybrid Search Demo[/bold cyan]\n") + console.print("\n[bold cyan]Mini RAG Hybrid Search Demo[/bold cyan]\n") # Initialize searcher console.print("Initializing search system...") @@ -123,9 +123,9 @@ def main(): # Use the RAG system itself as the demo project project_path = Path(__file__).parent - if not (project_path / '.claude-rag').exists(): - console.print("[red]Error: No RAG index found. Run 'claude-rag index' first.[/red]") - console.print(f"[dim]Looked in: {project_path / '.claude-rag'}[/dim]") + if not (project_path / '.mini-rag').exists(): + console.print("[red]Error: No RAG index found. Run 'mini-rag index' first.[/red]") + console.print(f"[dim]Looked in: {project_path / '.mini-rag'}[/dim]") return demo_search(project_path) diff --git a/tests/03_system_validation.py b/tests/03_system_validation.py index b4cf053..7fb2df6 100644 --- a/tests/03_system_validation.py +++ b/tests/03_system_validation.py @@ -12,10 +12,10 @@ if sys.platform == 'win32': os.environ['PYTHONUTF8'] = '1' sys.stdout.reconfigure(encoding='utf-8') -from claude_rag.chunker import CodeChunker -from claude_rag.indexer import ProjectIndexer -from claude_rag.search import CodeSearcher -from claude_rag.embeddings import CodeEmbedder +from mini_rag.chunker import CodeChunker +from mini_rag.indexer import ProjectIndexer +from mini_rag.search import CodeSearcher +from mini_rag.embeddings import CodeEmbedder def test_chunker(): """Test that chunker creates chunks with all required metadata.""" @@ -135,7 +135,7 @@ class MyClass: ''') # Index the project with small chunk size for testing - from claude_rag.chunker import CodeChunker + from mini_rag.chunker import CodeChunker chunker = CodeChunker(min_chunk_size=1) indexer = ProjectIndexer(project_path, chunker=chunker) stats = indexer.index_project() @@ -311,7 +311,7 @@ def test_server(): # Just check if we can import and create server instance try: - from claude_rag.server import RAGServer + from mini_rag.server import RAGServer server = RAGServer(Path("."), port=7778) print(" Server can be instantiated") return True diff --git a/tests/show_index_contents.py b/tests/show_index_contents.py index 721deae..177af07 100644 --- a/tests/show_index_contents.py +++ b/tests/show_index_contents.py @@ -13,7 +13,7 @@ if sys.platform == 'win32': sys.path.insert(0, str(Path(__file__).parent)) -from claude_rag.vector_store import VectorStore +from mini_rag.vector_store import VectorStore from collections import Counter project_path = Path.cwd() diff --git a/tests/test_context_retrieval.py b/tests/test_context_retrieval.py index 6f4bead..2db8d77 100644 --- a/tests/test_context_retrieval.py +++ b/tests/test_context_retrieval.py @@ -4,8 +4,8 @@ Test script for adjacent chunk retrieval functionality. """ from pathlib import Path -from claude_rag.search import CodeSearcher -from claude_rag.embeddings import CodeEmbedder +from mini_rag.search import CodeSearcher +from mini_rag.embeddings import CodeEmbedder def test_context_retrieval(): """Test the new context retrieval functionality.""" diff --git a/tests/test_hybrid_search.py b/tests/test_hybrid_search.py index e1ebbdd..0d3f0fe 100644 --- a/tests/test_hybrid_search.py +++ b/tests/test_hybrid_search.py @@ -15,8 +15,8 @@ from rich.columns import Columns from rich.syntax import Syntax from rich.progress import track -from claude_rag.search import CodeSearcher, SearchResult -from claude_rag.embeddings import CodeEmbedder +from mini_rag.search import CodeSearcher, SearchResult +from mini_rag.embeddings import CodeEmbedder console = Console() @@ -320,8 +320,8 @@ def main(): else: project_path = Path.cwd() - if not (project_path / '.claude-rag').exists(): - console.print("[red]Error: No RAG index found. Run 'claude-rag index' first.[/red]") + if not (project_path / '.mini-rag').exists(): + console.print("[red]Error: No RAG index found. Run 'mini-rag index' first.[/red]") return # Create tester @@ -329,7 +329,7 @@ def main(): # Run all tests console.print("\n" + "="*80) - console.print("[bold green]Claude RAG Hybrid Search Test Suite[/bold green]") + console.print("[bold green]Mini RAG Hybrid Search Test Suite[/bold green]") console.print("="*80) # Test 1: Query type analysis diff --git a/tests/test_min_chunk_size.py b/tests/test_min_chunk_size.py index 5c5f2d8..64d08ef 100644 --- a/tests/test_min_chunk_size.py +++ b/tests/test_min_chunk_size.py @@ -1,6 +1,6 @@ """Test with smaller min_chunk_size.""" -from claude_rag.chunker import CodeChunker +from mini_rag.chunker import CodeChunker from pathlib import Path test_code = '''"""Test module.""" diff --git a/tests/test_rag_integration.py b/tests/test_rag_integration.py index ec3f33d..7dae3d5 100644 --- a/tests/test_rag_integration.py +++ b/tests/test_rag_integration.py @@ -4,8 +4,8 @@ import tempfile import shutil from pathlib import Path -from claude_rag.indexer import ProjectIndexer -from claude_rag.search import CodeSearcher +from mini_rag.indexer import ProjectIndexer +from mini_rag.search import CodeSearcher # Sample Python file with proper structure sample_code = '''""" @@ -127,7 +127,7 @@ Markdown files are chunked by sections with: ### Basic Example ```python -from claude_rag import ProjectIndexer +from mini_rag import ProjectIndexer indexer = ProjectIndexer("/path/to/project") indexer.index_project() @@ -138,7 +138,7 @@ indexer.index_project() You can customize the chunking behavior: ```python -from claude_rag import CodeChunker +from mini_rag import CodeChunker chunker = CodeChunker( max_chunk_size=1000,