| 1 | --- |
| 2 | title: "@Codebase (Deprecated)" |
| 3 | description: Deprecated codebase context provider - use the new codebase awareness approach instead |
| 4 | keywords: [deprecated, codebase, embeddings, context, legacy] |
| 5 | noindex: true |
| 6 | --- |
| 7 | |
| 8 | <Warning> |
| 9 | **This feature is deprecated.** The `@Codebase` context provider has been deprecated in favor of a more integrated approach to codebase awareness. Please refer to our [Guide on Making Agents Aware of Codebases and Documentation](/guides/codebase-documentation-awareness) for the recommended approach. |
| 10 | </Warning> |
| 11 | |
| 12 | ## Migration Guide |
| 13 | |
| 14 | If you're currently using `@Codebase` or `@Folder` context providers, please migrate to the new approach outlined in our [codebase and documentation awareness guide](/guides/codebase-documentation-awareness). The new approach provides: |
| 15 | |
| 16 | - Better integration with Continue's Agent features |
| 17 | - More intelligent context selection |
| 18 | - Improved performance and accuracy |
| 19 | |
| 20 | ## Legacy Documentation |
| 21 | |
| 22 | *Below is the original documentation for the `@Codebase` context provider, preserved for reference* |
| 23 | |
| 24 | Continue indexes your codebase so that it can later automatically pull in the most relevant context from throughout your workspace. This is done via a combination of embeddings-based retrieval and keyword search. By default, all embeddings are calculated locally using `transformers.js` and stored locally in `~/.continue/index`. |
| 25 | |
| 26 | <Info> |
| 27 | **Note:** `transformers.js` cannot be used in JetBrains IDEs. However, you can |
| 28 | select a different embeddings model from [the list |
| 29 | here](../customize/model-roles/embeddings). |
| 30 | </Info> |
| 31 | |
| 32 | ## How to Use @Codebase and @Folder Context Providers |
| 33 | |
| 34 | Currently, the codebase retrieval feature is available as the "codebase" and "folder" context providers. You can use them by typing `@Codebase` or `@Folder` in the input box, and then asking a question. The contents of the input box will be compared with the embeddings from the rest of the codebase (or folder) to determine relevant files. |
| 35 | |
| 36 | ### When @Codebase Context Provider Is Useful |
| 37 | |
| 38 | Here are some common use cases where it can be useful: |
| 39 | |
| 40 | - **Asking high-level questions about your codebase** |
| 41 | - "How do I add a new endpoint to the server?" |
| 42 | - "Do we use VS Code's CodeLens feature anywhere?" |
| 43 | - "Is there any code written already to convert HTML to markdown?" |
| 44 | - **Generate code using existing samples as reference** |
| 45 | - "Generate a new React component with a date picker, using the same patterns as existing components" |
| 46 | - "Write a draft of a CLI application for this project using Python's argparse" |
| 47 | - "Implement the `foo` method in the `bar` class, following the patterns seen in other subclasses of `baz`. |
| 48 | - **Use `@Folder` to ask questions about a specific folder, increasing the likelihood of relevant results** |
| 49 | - "What is the main purpose of this folder?" |
| 50 | - "How do we use VS Code's CodeLens API?" |
| 51 | - Or any of the above examples, but with `@Folder` instead of `@Codebase` |
| 52 | |
| 53 | ### When @Codebase Context Provider Is Not Useful |
| 54 | |
| 55 | Here are use cases where it is not useful: |
| 56 | |
| 57 | - **When you need the LLM to see _literally every_ file in your codebase** |
| 58 | - "Find everywhere where the `foo` function is called" |
| 59 | - "Review our codebase and find any spelling mistakes" |
| 60 | - **Refactoring tasks** |
| 61 | - "Add a new parameter to the `bar` function and update usages" |
| 62 | |
| 63 | ## How to Configure @Codebase Context Provider Settings |
| 64 | |
| 65 | There are a few options that let you configure the behavior of the `@codebase` context provider, which are the same for the `@folder` context provider: |
| 66 | |
| 67 | <Tabs> |
| 68 | <Tab title="YAML"> |
| 69 | ```yaml title="config.yaml" |
| 70 | context: |
| 71 | - provider: codebase |
| 72 | params: |
| 73 | nRetrieve: 25 |
| 74 | nFinal: 5 |
| 75 | useReranking: true |
| 76 | ``` |
| 77 | </Tab> |
| 78 | <Tab title="JSON"> |
| 79 | ```json title="config.json" |
| 80 | { |
| 81 | "contextProviders": [ |
| 82 | { |
| 83 | "name": "codebase", |
| 84 | "params": { |
| 85 | "nRetrieve": 25, |
| 86 | "nFinal": 5, |
| 87 | "useReranking": true |
| 88 | } |
| 89 | } |
| 90 | ] |
| 91 | } |
| 92 | ``` |
| 93 | </Tab> |
| 94 | </Tabs> |
| 95 | |
| 96 | ### `nRetrieve` |
| 97 | |
| 98 | Number of results to initially retrieve from vector database (default: 25) |
| 99 | |
| 100 | ### `nFinal` |
| 101 | |
| 102 | Final number of results to use after re-ranking (default: 5) |
| 103 | |
| 104 | ### `useReranking` |
| 105 | |
| 106 | Whether to use re-ranking, which will allow initial selection of `nRetrieve` results, then will use an LLM to select the top `nFinal` results (default: true) |
| 107 | |
| 108 | ## How to Ignore Files During Indexing |
| 109 | |
| 110 | Continue respects `.gitignore` files in order to determine which files should not be indexed. If you'd like to exclude additional files, you can add them to a `.continueignore` file, which follows the exact same rules as `.gitignore`. |
| 111 | |
| 112 | Continue also supports a **global** `.continueignore` file that will be respected for all workspaces, which can be created at `~/.continue/.continueignore`. |
| 113 | |
| 114 | If you want to see exactly what files Continue has indexed, the metadata is stored in `~/.continue/index/index.sqlite`. You can use a tool like [DB Browser for SQLite](https://sqlitebrowser.org/) to view the `tag_catalog` table within this file. |
| 115 | |
| 116 | If you need to force a refresh of the index, reload the VS Code window with <kbd>cmd/ctrl</kbd> + <kbd>shift</kbd> + <kbd>p</kbd> + "Reload Window". |