Codebase Indexing
Codebase Indexing helps brewdata understand your code better by creating a searchable database of your workspace. This feature allows the extension to find relevant code snippets based on what you're asking about, even if you don't know exact function names or file locations.
How Codebase Indexing Works
When you enable indexing:
- Analyzes your code: The system scans your workspace and identifies meaningful code blocks (functions, classes, methods)
- Creates vector representations: Each code block is converted into numerical vectors that capture its meaning
- Stores only these vectors: For privacy and security, your actual code is never stored - only mathematical representations
- Powers intelligent search: The
codebase_search
tool uses these vectors to find relevant code
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: brewdata 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
Privacy & Security
Brewdata takes your code privacy seriously:
- Code privacy: Only vector representations are stored, not your actual code
- Embeddings are numeric: These mathematical vectors cannot be reversed to reveal your code
- Secure storage: API keys encrypted in VS Code's secure storage
- Local option: Use Ollama for completely local processing without sending data externally
- Access control: Respects existing file permissions
Accessing and Managing Codebase Indexing
You can manage codebase indexing through the brewdata extension:
- Click on the Settings icon ()
- Navigate to the Authentication tab
- Look for the Codebase Indexing section
Indexing Status Indicators
The indexing interface shows you the current status:
- Not Indexed (Red): Your codebase hasn't been indexed yet
- Indexing... (Yellow): Currently processing your codebase
- Synced (Green): Shows how many records have been indexed successfully

Managing Your Index
- Start Indexing: If your codebase isn't indexed, click this button to begin
- Resync Index: After making changes to your code, use this to update the index
- Delete Index: Removes the current index if you need to start fresh

When to Resync
For optimal results, resync your index:
- After significant code changes
- When switching branches
- After adding new features or libraries
- If you notice brewdata missing context from recent code changes
Privacy and Security
The codebase indexing feature is designed with privacy in mind:
- Only mathematical vector representations are stored
- No one (including OpenAI) can reconstruct your code from these vectors
- You maintain complete control over your index