|
| 1 | +# Deep Cody |
| 2 | + |
| 3 | +<p className="subtitle"> Learn about Deep Cody, an exclusive chat-based AI agent with enhanced capabilities.</p> |
| 4 | + |
| 5 | +<Callout type="info">Deep Cody is currently in the Experimental stage and is available to Cody Pro and Enterprise users.</Callout> |
| 6 | + |
| 7 | +Deep Cody is an AI agent that provides enhanced, context-aware chat capabilities. It extends Cody's functionality by proactively understanding your coding environment and gathering relevant information based on your requests before responding. This allows Deep Cody to deliver noticeably higher-quality responses. |
| 8 | + |
| 9 | +Deep Cody aims to reduce the learning curve associated with traditional coding assistants by minimizing users' need to provide context manually. It achieves this through agentic context retrieval, where the AI autonomously gathers and analyzes context before generating a response. |
| 10 | + |
| 11 | +Deep Cody can be used from the LLM selection drop-down in the Cody chat interface. All Cody Pro and Enterprise users can choose Deep Cody for fetching chat responses. |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +## What can Deep Cody do? |
| 16 | + |
| 17 | +Deep Cody can help you with the following: |
| 18 | + |
| 19 | +- **Proactive context gathering**: Automatically gathers relevant context from your codebase, project structure, and current task |
| 20 | +- **Agentic context review**: Reviews the gathered context to ensure it is comprehensive and relevant to your query |
| 21 | +- **Iterative context improvement**: Performs multiple review loops to refine the context and ensure a thorough understanding |
| 22 | +- **Enhanced response accuracy**: Leverages comprehensive context to provide more accurate and relevant responses, reducing the risk of hallucinations |
| 23 | + |
| 24 | +## Context fetching sources |
| 25 | + |
| 26 | +Deep Cody has access to a suite of tools for retrieving relevant context: |
| 27 | + |
| 28 | +- **Search**: Searches the codebase using keywords extracted from your query |
| 29 | +- **File**: Retrieves the content of specific files in your codebase |
| 30 | +- **CLI**: Executes terminal commands to gather system or project-specific information |
| 31 | +- **Memory**: Allows the agent to create personal notes that can be used across chat sessions |
| 32 | +- **Web browser (via OpenCtx)**: Searches the web for live context |
| 33 | +- **Linear issues (via OpenCtx)**: Integrates with Linear issue tracking when the provider is configured |
| 34 | + |
| 35 | +Deep Cody integrates seamlessly with external services, such as web content retrieval and issue tracking systems, using OpenCtx providers. To learn more, [read the OpenCtx docs](/cody/capabilities/openctx). |
| 36 | + |
| 37 | +Memory allows Deep Cody to learn and remember your preferences, enabling a more personalized experience. You can ask Deep Cody to **remember** specific details for future interactions. |
| 38 | + |
| 39 | +## Terminal commands |
| 40 | + |
| 41 | +Deep Cody can use the CLI Tool to execute shell commands and gather context from your terminal. This feature requires proper configuration on both your Sourcegraph instance and editor: |
| 42 | + |
| 43 | +- **Sourcegraph Instance**: The `deep-cody-shell-context` feature flag must be enabled for your account (this flag is disabled by default). Site administrators can enable it for all users or specific individuals |
| 44 | +- Cody editor: Ensure compatibility with your configured setup |
| 45 | + |
| 46 | +<Callout type="info">It's recommended not to request information that you don't want to share.</Callout> |
| 47 | + |
| 48 | +Deep Cody’s ability to execute terminal commands enhances its context-gathering capabilities. However, it’s essential to understand that any information accessible via your terminal could potentially be shared with the LLM. Here's what you should consider: |
| 49 | + |
| 50 | +- **Trusted workspaces only**: Commands can only be executed within trusted workspaces with a valid shell |
| 51 | +- **Potential data sharing**: Any terminal-accessible information may be shared with the LLM. |
| 52 | +- **Allow list configuration**: This feature is disabled if the allow list is empty. By default, the allow list is set to ['*'], which allows all commands. For enhanced security, use specific command prefixes instead of the wildcard *. |
| 53 | + |
| 54 | +Commands are generated by the agent/LLM based on your request. Avoid asking it to execute destructive commands if you do not want them to run. |
| 55 | + |
| 56 | +## Configure shell command execution |
| 57 | + |
| 58 | +You can configure shell command execution via the `cody.agentic.context` setting in your editor: |
| 59 | + |
| 60 | +### Enable Deep Cody access to CLI |
| 61 | + |
| 62 | +Update the `cody.agentic.context` setting to `allow` or `block` specific commands: |
| 63 | + |
| 64 | +```json |
| 65 | +{ |
| 66 | + "cody.agentic.context": { |
| 67 | + "shell": { |
| 68 | + // Array of allowed command prefixes, or ["*"] for all commands |
| 69 | + "allow": ["git", "gh", "ls"], |
| 70 | + "block": ["git"] // Additional commands to block |
| 71 | + } |
| 72 | + } |
| 73 | +} |
| 74 | +``` |
| 75 | + |
| 76 | +### Disable Deep Cody access to CLI |
| 77 | + |
| 78 | +To disable the feature, navigate to your user settings and set `cody.agentic.context` to an empty value. When disabled, the Deep Cody agent cannot access the CLI. |
| 79 | + |
| 80 | +## Access to Deep Cody |
| 81 | + |
| 82 | +Site admins must enable the following feature flags that are disabled by default to access Deep Cody: |
| 83 | + |
| 84 | +- `deep-cody`: Enables access to Deep Cody for your Sourcegraph instance |
| 85 | +- `deep-cody-shell-context`: Enables Deep Cody to execute terminal commands automatically during the context retrieval step |
| 86 | + |
| 87 | +## Use cases |
| 88 | + |
| 89 | +Deep Cody can be helpful to assist with a wide range of tasks, including: |
| 90 | + |
| 91 | +- **Improved response quality**: Deep Cody helps you get better and more accurate responses than other LLMs, making the additional processing time for context gathering a non-issue. |
| 92 | +- **Error resolution**: Deep Cody can automatically identify error sources and suggest fixes by analyzing error logs |
| 93 | +- **Better unit tests**: Automatically includes imports and other missing contexts to generate better unit tests |
0 commit comments