Codebase Indexing in PS Smart Agent

Codebase indexing enables fast semantic search across your project. Instead of searching by text, you can search by meaning.

What is Codebase Indexing?

Codebase indexing:

  • Creates embeddings for your code
  • Enables semantic search
  • Helps AI understand your codebase
  • Speeds up context gathering

Enabling Codebase Indexing

1. Open Settings

  1. Click the settings icon
  2. Navigate to “Codebase Indexing”

2. Configure Indexing

{
  "codeIndexing.enabled": true,
  "codeIndexing.maxFiles": 10000,
  "codeIndexing.embeddingBatchSize": 60
}

3. Start Indexing

Click “Index Codebase” to begin the process.

In Chat

Use @ to search your codebase:

@ Where is the authentication logic?
  1. Click the search icon
  2. Enter your query
  3. Results show relevant code snippets

Indexing Settings

SettingDescriptionDefault
maxFilesMaximum files to index10,000
embeddingBatchSizeBatch size for embeddings60
excludePatternsFiles to excludenode_modules, .git

Best Practices

1. Exclude Large Directories

{
  "codeIndexing.excludePatterns": [
    "node_modules/**",
    "dist/**",
    "build/**",
    "*.min.js",
    "*.lock"
  ]
}

2. Use Meaningful Queries

Instead of: function name Try: handles user login validation

3. Keep Index Updated

  • Re-index after major changes
  • Use auto-reindex on file changes

Performance Tips

  1. Limit file count - Don’t index generated files
  2. Use appropriate batch size - Lower for rate-limited APIs
  3. Clear old indexes - Remove outdated embeddings

Troubleshooting

Index Not Building

  • Check API key has embedding access
  • Verify file permissions
  • Check available disk space
  • Reduce max files
  • Clear and rebuild index
  • Check network connection

Learn more at pyshine.com