diff --git a/docs/advanced-usage/available-tools/codebase-search.md b/docs/advanced-usage/available-tools/codebase-search.md
new file mode 100644
index 00000000..41472536
--- /dev/null
+++ b/docs/advanced-usage/available-tools/codebase-search.md
@@ -0,0 +1,221 @@
+# codebase_search
+
+:::warning Experimental Feature
+The `codebase_search` tool is part of the experimental [Codebase Indexing](/features/experimental/codebase-indexing) feature. This feature is under active development and may change significantly in future releases. It requires additional setup including an embedding provider and vector database.
+:::
+
+The `codebase_search` tool performs semantic searches across your entire codebase using AI embeddings. Unlike traditional text-based search, it understands the meaning of your queries and finds relevant code even when exact keywords don't match.
+
+## Parameters
+
+The tool accepts these parameters:
+
+- `query` (required): Natural language search query describing what you're looking for
+- `path` (optional): Directory path to limit search scope to a specific part of your codebase
+
+## What It Does
+
+This tool searches through your indexed codebase using semantic similarity rather than exact text matching. It finds code blocks that are conceptually related to your query, even if they don't contain the exact words you searched for. Results include relevant code snippets with file paths, line numbers, and similarity scores.
+
+## When is it used?
+
+- When Roo needs to find code related to specific functionality across your project
+- When looking for implementation patterns or similar code structures
+- When searching for error handling, authentication, or other conceptual code patterns
+- When exploring unfamiliar codebases to understand how features are implemented
+- When finding related code that might be affected by changes or refactoring
+
+## Key Features
+
+- **Semantic Understanding**: Finds code by meaning rather than exact keyword matches
+- **Cross-Project Search**: Searches across your entire indexed codebase, not just open files
+- **Contextual Results**: Returns code snippets with file paths and line numbers for easy navigation
+- **Similarity Scoring**: Results ranked by relevance with similarity scores (0-1 scale)
+- **Scope Filtering**: Optional path parameter to limit searches to specific directories
+- **Intelligent Ranking**: Results sorted by semantic relevance to your query
+- **UI Integration**: Results displayed with syntax highlighting and navigation links
+- **Performance Optimized**: Fast vector-based search with configurable result limits
+
+## Requirements
+
+This tool is only available when the experimental Codebase Indexing feature is properly configured:
+
+- **Feature Enabled**: Codebase Indexing must be enabled in experimental settings
+- **Embedding Provider**: OpenAI API key or Ollama configuration required
+- **Vector Database**: Qdrant instance running and accessible
+- **Index Status**: Codebase must be indexed (status: "Indexed" or "Indexing")
+
+## Limitations
+
+- **Experimental Feature**: Part of the experimental codebase indexing system
+- **Requires Configuration**: Depends on external services (embedding provider + Qdrant)
+- **Index Dependency**: Only searches through indexed code blocks
+- **Result Limits**: Maximum of 50 results per search to maintain performance
+- **Similarity Threshold**: Only returns results above 0.4 similarity score
+- **File Size Limits**: Limited to files under 1MB that were successfully indexed
+- **Language Support**: Effectiveness depends on Tree-sitter language support
+
+## How It Works
+
+When the `codebase_search` tool is invoked, it follows this process:
+
+1. **Availability Validation**:
+ - Verifies that the CodeIndexManager is available and initialized
+ - Confirms codebase indexing is enabled in settings
+ - Checks that indexing is properly configured (API keys, Qdrant URL)
+ - Validates the current index state allows searching
+
+2. **Query Processing**:
+ - Takes your natural language query and generates an embedding vector
+ - Uses the same embedding provider configured for indexing (OpenAI or Ollama)
+ - Converts the semantic meaning of your query into a mathematical representation
+
+3. **Vector Search Execution**:
+ - Searches the Qdrant vector database for similar code embeddings
+ - Uses cosine similarity to find the most relevant code blocks
+ - Applies the minimum similarity threshold (0.4) to filter results
+ - Limits results to 50 matches for optimal performance
+
+4. **Path Filtering** (if specified):
+ - Filters results to only include files within the specified directory path
+ - Uses normalized path comparison for accurate filtering
+ - Maintains relevance ranking within the filtered scope
+
+5. **Result Processing and Formatting**:
+ - Converts absolute file paths to workspace-relative paths
+ - Structures results with file paths, line ranges, similarity scores, and code content
+ - Formats for both AI consumption and UI display with syntax highlighting
+
+6. **Dual Output Format**:
+ - **AI Output**: Structured text format with query, file paths, scores, and code chunks
+ - **UI Output**: JSON format with syntax highlighting and navigation capabilities
+
+## Search Query Best Practices
+
+### Effective Query Patterns
+
+**Good: Conceptual and specific**
+```xml
+
+user authentication and password validation
+
+```
+
+**Good: Feature-focused**
+```xml
+
+database connection pool setup
+
+```
+
+**Good: Problem-oriented**
+```xml
+
+error handling for API requests
+
+```
+
+**Less effective: Too generic**
+```xml
+
+function
+
+```
+
+### Query Types That Work Well
+
+- **Functional Descriptions**: "file upload processing", "email validation logic"
+- **Technical Patterns**: "singleton pattern implementation", "factory method usage"
+- **Domain Concepts**: "user profile management", "payment processing workflow"
+- **Architecture Components**: "middleware configuration", "database migration scripts"
+
+## Directory Scoping
+
+Use the optional `path` parameter to focus searches on specific parts of your codebase:
+
+**Search within API modules:**
+```xml
+
+endpoint validation middleware
+src/api
+
+```
+
+**Search in test files:**
+```xml
+
+mock data setup patterns
+tests
+
+```
+
+**Search specific feature directories:**
+```xml
+
+component state management
+src/components/auth
+
+```
+
+## Result Interpretation
+
+### Similarity Scores
+
+- **0.8-1.0**: Highly relevant matches, likely exactly what you're looking for
+- **0.6-0.8**: Good matches with strong conceptual similarity
+- **0.4-0.6**: Potentially relevant but may require review
+- **Below 0.4**: Filtered out as too dissimilar
+
+### Result Structure
+
+Each search result includes:
+- **File Path**: Workspace-relative path to the file containing the match
+- **Score**: Similarity score indicating relevance (0.4-1.0)
+- **Line Range**: Start and end line numbers for the code block
+- **Code Chunk**: The actual code content that matched your query
+
+## Examples When Used
+
+- When implementing a new feature, Roo searches for "authentication middleware" to understand existing patterns before writing new code.
+- When debugging an issue, Roo searches for "error handling in API calls" to find related error patterns across the codebase.
+- When refactoring code, Roo searches for "database transaction patterns" to ensure consistency across all database operations.
+- When onboarding to a new codebase, Roo searches for "configuration loading" to understand how the application bootstraps.
+
+## Usage Examples
+
+Searching for authentication-related code across the entire project:
+```xml
+
+user login and authentication logic
+
+```
+
+Finding database-related code in a specific directory:
+```xml
+
+database connection and query execution
+src/data
+
+```
+
+Looking for error handling patterns in API code:
+```xml
+
+HTTP error responses and exception handling
+src/api
+
+```
+
+Searching for testing utilities and mock setups:
+```xml
+
+test setup and mock data creation
+tests
+
+```
+
+Finding configuration and environment setup code:
+```xml
+
+environment variables and application configuration
+
\ No newline at end of file
diff --git a/docs/advanced-usage/available-tools/tool-use-overview.md b/docs/advanced-usage/available-tools/tool-use-overview.md
index c92c2448..6e0c38ca 100644
--- a/docs/advanced-usage/available-tools/tool-use-overview.md
+++ b/docs/advanced-usage/available-tools/tool-use-overview.md
@@ -10,7 +10,8 @@ Tools are organized into logical groups based on their functionality:
| Category | Purpose | Tools | Common Use |
|----------|---------|-------|------------|
-| **Read Group** | File system reading and searching | [read_file](/advanced-usage/available-tools/read-file), [search_files](/advanced-usage/available-tools/search-files), [list_files](/advanced-usage/available-tools/list-files), [list_code_definition_names](/advanced-usage/available-tools/list-code-definition-names) | Code exploration and analysis |
+| **Read Group** | File system reading and exploration | [read_file](/advanced-usage/available-tools/read-file), [list_files](/advanced-usage/available-tools/list-files), [list_code_definition_names](/advanced-usage/available-tools/list-code-definition-names) | Code exploration and analysis |
+| **Search Group** | Pattern and semantic searching | [search_files](/advanced-usage/available-tools/search-files), [codebase_search](/advanced-usage/available-tools/codebase-search) | Finding code patterns and functionality |
| **Edit Group** | File system modifications | [apply_diff](/advanced-usage/available-tools/apply-diff), [insert_content](/advanced-usage/available-tools/insert-content), [search_and_replace](/advanced-usage/available-tools/search-and-replace), [write_to_file](/advanced-usage/available-tools/write-to-file) | Code changes and file manipulation |
| **Browser Group** | Web automation | [browser_action](/advanced-usage/available-tools/browser-action) | Web testing and interaction |
| **Command Group** | System command execution | [execute_command](/advanced-usage/available-tools/execute-command) | Running scripts, building projects |
@@ -32,10 +33,15 @@ Certain tools are accessible regardless of the current mode:
These tools help Roo understand your code and project:
- [read_file](/advanced-usage/available-tools/read-file) - Examines the contents of files
-- [search_files](/advanced-usage/available-tools/search-files) - Finds patterns across multiple files
- [list_files](/advanced-usage/available-tools/list-files) - Maps your project's file structure
- [list_code_definition_names](/advanced-usage/available-tools/list-code-definition-names) - Creates a structural map of your code
+### Search Tools
+These tools help Roo find patterns and functionality across your codebase:
+
+- [search_files](/advanced-usage/available-tools/search-files) - Finds patterns across multiple files using regex
+- [codebase_search](/advanced-usage/available-tools/codebase-search) - Performs semantic searches across your indexed codebase
+
### Edit Tools
These tools help Roo make changes to your code:
@@ -211,7 +217,7 @@ Tools are made available based on the current mode:
1. **Information Gathering**
```
- [ask_followup_question](/advanced-usage/available-tools/ask-followup-question) → [read_file](/advanced-usage/available-tools/read-file) → [search_files](/advanced-usage/available-tools/search-files)
+ [ask_followup_question](/advanced-usage/available-tools/ask-followup-question) → [read_file](/advanced-usage/available-tools/read-file) → [codebase_search](/advanced-usage/available-tools/codebase-search)
```
2. **Code Modification**
diff --git a/docs/faq.md b/docs/faq.md
index 25485182..111479e5 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -136,6 +136,14 @@ Yes, if you use a [local model](/advanced-usage/local-models).
Yes, you can create your own MCP servers to add custom functionality to Roo Code. See the [MCP documentation](https://github.com/modelcontextprotocol) for details.
+### What is Codebase Indexing?
+
+[Codebase Indexing](/features/experimental/codebase-indexing) is an experimental feature that creates a semantic search index of your project using AI embeddings. This enables Roo Code to better understand and navigate large codebases by finding relevant code based on meaning rather than just keywords.
+
+### How much does Codebase Indexing cost?
+
+Codebase Indexing requires an OpenAI API key for generating embeddings and a Qdrant vector database for storage. Costs depend on your project size and the embedding model used. Initial indexing is the most expensive part; subsequent updates are incremental and much cheaper.
+
## Troubleshooting
### Roo Code isn't responding. What should I do?
@@ -148,7 +156,7 @@ Yes, you can create your own MCP servers to add custom functionality to Roo Code
### I'm seeing an error message. What does it mean?
-The error message should provide some information about the problem. If you're unsure how to resolve it, seek help in the community forums.
+The error message should provide some information about the problem. If you're unsure how to resolve it, seek help in [Discord](https://discord.gg/roocode).
### Roo Code made changes I didn't want. How do I undo them?
diff --git a/docs/features/experimental/codebase-indexing.mdx b/docs/features/experimental/codebase-indexing.mdx
new file mode 100644
index 00000000..60209014
--- /dev/null
+++ b/docs/features/experimental/codebase-indexing.mdx
@@ -0,0 +1,188 @@
+import Codicon from '@site/src/components/Codicon';
+
+# Codebase Indexing
+
+**⚠️ Experimental Feature:** This feature is under active development and may change significantly in future releases.
+
+Codebase Indexing enables semantic code search across your entire project using AI embeddings. Instead of searching for exact text matches, it understands the *meaning* of your queries, helping Roo Code find relevant code even when you don't know specific function names or file locations.
+
+
+
+## What It Does
+
+When enabled, the indexing system:
+
+1. **Parses your code** using Tree-sitter to identify semantic blocks (functions, classes, methods)
+2. **Creates embeddings** of each code block using AI models
+3. **Stores vectors** in a Qdrant database for fast similarity search
+4. **Provides the [`codebase_search`](/advanced-usage/available-tools/codebase-search) tool** to Roo for intelligent code discovery
+
+This enables natural language queries like "user authentication logic" or "database connection handling" to find relevant code across your entire project.
+
+## Key Benefits
+
+- **Semantic Search**: Find code by meaning, not just keywords
+- **Enhanced AI Understanding**: Roo can better comprehend and work with your codebase
+- **Cross-Project Discovery**: Search across all files, not just what's open
+- **Pattern Recognition**: Locate similar implementations and code patterns
+
+## Setup Requirements
+
+### Embedding Provider
+
+Choose one of these options for generating embeddings:
+
+**OpenAI (Recommended)**
+- Requires OpenAI API key
+- Supports all OpenAI embedding models
+- Default: `text-embedding-3-small`
+- Processes up to 100,000 tokens per batch
+
+**Ollama (Local)**
+- Requires local Ollama installation
+- No API costs or internet dependency
+- Supports any Ollama-compatible embedding model
+- Requires Ollama base URL configuration
+
+### Vector Database
+
+**Qdrant** is required for storing and searching embeddings:
+- **Local**: `http://localhost:6333` (recommended for testing)
+- **Cloud**: Qdrant Cloud or self-hosted instance
+- **Authentication**: Optional API key for secured deployments
+
+## Setting Up Qdrant
+
+### Quick Local Setup
+
+**Using Docker:**
+```bash
+docker run -p 6333:6333 qdrant/qdrant
+```
+
+**Using Docker Compose:**
+```yaml
+version: '3.8'
+services:
+ qdrant:
+ image: qdrant/qdrant
+ ports:
+ - "6333:6333"
+ volumes:
+ - qdrant_storage:/qdrant/storage
+volumes:
+ qdrant_storage:
+```
+
+### Production Deployment
+
+For team or production use:
+- [Qdrant Cloud](https://cloud.qdrant.io/) - Managed service
+- Self-hosted on AWS, GCP, or Azure
+- Local server with network access for team sharing
+
+## Configuration
+
+1. Open Roo Code settings ( icon)
+2. Navigate to **Experimental** section
+3. Enable **"Enable Codebase Indexing"**
+4. Configure your embedding provider:
+ - **OpenAI**: Enter API key and select model
+ - **Ollama**: Enter base URL and select model
+5. Set Qdrant URL and optional API key
+6. Click **Save** to start initial indexing
+
+## Understanding Index Status
+
+The interface shows real-time status with color indicators:
+
+- **Standby** (Gray): Not running, awaiting configuration
+- **Indexing** (Yellow): Currently processing files
+- **Indexed** (Green): Up-to-date and ready for searches
+- **Error** (Red): Failed state requiring attention
+
+## How Files Are Processed
+
+### Smart Code Parsing
+- **Tree-sitter Integration**: Uses AST parsing to identify semantic code blocks
+- **Language Support**: All languages supported by Tree-sitter
+- **Fallback**: Line-based chunking for unsupported file types
+- **Block Sizing**:
+ - Minimum: 100 characters
+ - Maximum: 1,000 characters
+ - Splits large functions intelligently
+
+### Automatic File Filtering
+The indexer automatically excludes:
+- Binary files and images
+- Large files (>1MB)
+- Git repositories (`.git` folders)
+- Dependencies (`node_modules`, `vendor`, etc.)
+- Files matching `.gitignore` and `.rooignore` patterns
+
+### Incremental Updates
+- **File Watching**: Monitors workspace for changes
+- **Smart Updates**: Only reprocesses modified files
+- **Hash-based Caching**: Avoids reprocessing unchanged content
+- **Branch Switching**: Automatically handles Git branch changes
+
+## Best Practices
+
+### Model Selection
+
+**For OpenAI:**
+- **`text-embedding-3-small`**: Best balance of performance and cost
+- **`text-embedding-3-large`**: Higher accuracy, 5x more expensive
+- **`text-embedding-ada-002`**: Legacy model, lower cost
+
+**For Ollama:**
+- Choose models based on your hardware capabilities
+- Larger models provide better accuracy but require more resources
+
+### Security Considerations
+- **API Keys**: Stored securely in VS Code's encrypted storage
+- **Code Privacy**: Only small code snippets sent for embedding (not full files)
+- **Local Processing**: All parsing happens locally
+- **Qdrant Security**: Use authentication for production deployments
+
+## Current Limitations
+
+- **File Size**: 1MB maximum per file
+- **Markdown**: Not currently supported due to parsing complexity
+- **Single Workspace**: One workspace at a time
+- **Dependencies**: Requires external services (embedding provider + Qdrant)
+- **Language Coverage**: Limited to Tree-sitter supported languages
+
+## Using the Search Feature
+
+Once indexed, Roo can use the [`codebase_search`](/advanced-usage/available-tools/codebase-search) tool to find relevant code:
+
+**Example Queries:**
+- "How is user authentication handled?"
+- "Database connection setup"
+- "Error handling patterns"
+- "API endpoint definitions"
+
+The tool provides Roo with:
+- Relevant code snippets
+- File paths and line numbers
+- Similarity scores
+- Contextual information
+
+## Privacy & Security
+
+- **Code stays local**: Only small code snippets sent for embedding
+- **Embeddings are numeric**: Not human-readable representations
+- **Secure storage**: API keys encrypted in VS Code storage
+- **Local option**: Use Ollama for completely local processing
+- **Access control**: Respects existing file permissions
+
+## Future Enhancements
+
+Planned improvements:
+- Additional embedding providers
+- Improved markdown and documentation support
+- Multi-workspace indexing
+- Enhanced filtering and configuration options
+- Team sharing capabilities
+- Integration with VS Code's native search
\ No newline at end of file
diff --git a/docs/features/experimental/experimental-features.md b/docs/features/experimental/experimental-features.md
index 063dde60..4b041c86 100644
--- a/docs/features/experimental/experimental-features.md
+++ b/docs/features/experimental/experimental-features.md
@@ -16,6 +16,7 @@ To enable or disable experimental features:
The following experimental features are currently available:
+- [Codebase Indexing](/features/experimental/codebase-indexing) - Semantic search through AI-powered codebase indexing
- [Intelligently Condense the Context Window](/features/experimental/intelligent-context-condensing)
- [Power Steering](/features/experimental/power-steering)
diff --git a/sidebars.ts b/sidebars.ts
index fdc86ec4..56a93949 100644
--- a/sidebars.ts
+++ b/sidebars.ts
@@ -60,6 +60,7 @@ const sidebars: SidebarsConfig = {
label: 'Experimental',
items: [
'features/experimental/experimental-features',
+ 'features/experimental/codebase-indexing',
'features/experimental/intelligent-context-condensing',
'features/experimental/power-steering',
],
@@ -81,6 +82,7 @@ const sidebars: SidebarsConfig = {
'advanced-usage/available-tools/ask-followup-question',
'advanced-usage/available-tools/attempt-completion',
'advanced-usage/available-tools/browser-action',
+ 'advanced-usage/available-tools/codebase-search',
'advanced-usage/available-tools/execute-command',
'advanced-usage/available-tools/insert-content',
'advanced-usage/available-tools/list-code-definition-names',
diff --git a/static/img/codebase-indexing/codebase-indexing.png b/static/img/codebase-indexing/codebase-indexing.png
new file mode 100644
index 00000000..9b18c982
Binary files /dev/null and b/static/img/codebase-indexing/codebase-indexing.png differ
diff --git a/static/img/experimental-features/experimental-features.png b/static/img/experimental-features/experimental-features.png
new file mode 100644
index 00000000..d6bf53d7
Binary files /dev/null and b/static/img/experimental-features/experimental-features.png differ