Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Agentic Chat) Deep Cody docs #841

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions docs/cody/capabilities/agentic-chat.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Agentic Chat

<p className="subtitle"> Learn about the Agentic Chat experience, an exclusive chat-based AI agent with enhanced capabilities.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"agentic chat" is not a proper noun from a marketing POV, let's update this in the rest of the doc @MaedahBatool


<Callout type="info">Agentic Chat is currently in the Experimental stage for Cody Pro and Enterprise and is supported only on VS Code, Visual Studio, JetBrains editor extensions, and Web. Usage may be limited at this stage.</Callout>

Cody's Agentic Chat experience is an AI agent that can evaluate context and fetch any additional context by providing 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. These features help you get noticeably higher-quality responses.

This Agentic Chat experience 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also helps retrieve context from other tools such as terminal, OpenCtx, etc dynamically as needed to better answer the query


## Capabilities of Agentic Chat

The Agentic Chat experience leverages several key capabilities, including:

- **Proactive context gathering**: Automatically gathers relevant context from your codebase, project structure, and current task
- **Agentic context review**: Reviews the gathered context to ensure it is comprehensive and relevant to your query
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use "reflection" - review is an overloaded word

- **Iterative context improvement**: Performs multiple review loops to refine the context and ensure a thorough understanding
- **Enhanced response accuracy**: Leverages comprehensive context to provide more accurate and relevant responses, reducing the risk of hallucinations

## Enable Agentic Chat

Pro users can enable the Agentic Chat experience from the green **funnel** icon in Cody's chat panel. You can toggle the **Agentic Chat** feature on and off. Enterprise customers are required to opt-in to get access to this Agentic Chat feature.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up - @beyang proposed a new UX for the agentic chat that is changing this experience, so we will have to update these instructions/images


![Agentic chat interface](IMAGE LINK TO BE ADDED)

### Getting Agentic Chat access for Enterprise customers

Enterprise customers can get access by upgrading their supported client (VS Code, JetBrains, and Visual Studio) to the latest version of the plugin and enabling the following feature flags on their Sourcegraph Instance:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently they also need Haiku 3.5 available for their instance


- `agentic-chat-experimental` to get access to the feature
- `agentic-chat-cli-tool-experimental` to allow [terminal access](#terminal-commands)
- Users will also need to manually enable access to the terminal commands on the client's `settings.json` file i.e., set `"cody.agentic.context.experimentalShell": true`

## What can Agentic Chat do?

Agentic Chat can help you with the following:

### Tool Usage

It has access to a suite of tools for retrieving relevant context. These tools include:

- **Code Search**: Performs code searches
- **Codebase File**: Retrieves the full content from a file in your codebase
- **Terminal**: Executes shell commands in your terminal
- **Chat Memory**: Allows the agent to create personal notes that can be used across chat sessions
- **Web Browser*: Searches the web for live context
- **OpenCtx**: Any OpenCtx providers could be used by the agent

It 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).

Memory allows the Agentic Chat to learn and remember your preferences, enabling a more personalized experience. You can ask it to **remember** specific details for future interactions.

<Callout type="info">Terminal access is not supported on the Web. It currently only works with VS Code and JetBrains editor extensions.</Callout>

## Terminal access

MaedahBatool marked this conversation as resolved.
Show resolved Hide resolved
Agentic Chat can use the CLI Tool to request execution of shell commands in order to gather context from your terminal. Its 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. It's recommended not to request information that you don't want to share. Here's what you should consider:
* - **Requires user consent**: Agentic Chat will pause and ask for permission each time before executing any shell command.
- **Trusted workspaces only**: Commands can only be executed within trusted workspaces with a valid shell
- **Potential data sharing**: Any terminal-accessible information may be shared with the LLM

Commands are generated by the agent/LLM based on your request. Avoid asking it to execute destructive commands.

### Configure shell command execution

You can configure shell command execution via the `cody.agentic.context` setting in your editor:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can configure shell command execution via the `cody.agentic.context` setting in your editor:
You can configure terminal access in the chat UI, under the agentic context settings.
image


#### Enable Agentic Chat access to CLI

Update the `cody.agentic.context` setting to `allow` or `block` specific commands:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graceshih-sg I need to double-check this section with you. Is it factually correct?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave out the allowlist/blocklist -- we decided to not expose it at launch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 ^


```json
{
"cody.agentic.context": {
"shell": {
// Array of allowed command prefixes, or ["*"] for all commands
"allow": ["git", "gh", "ls"],
"block": ["git"] // Additional commands to block
}
}
}
```

Comment on lines +72 to +83

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this block -- does that sound okay @abeatrix?

#### Disable Agentic Chat access to CLI

To disable the feature, navigate to your user settings and set `cody.agentic.context` to an empty value. When disabled, the chat agent cannot access the CLI.
Comment on lines +68 to +86
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaedahBatool we have moved the settings out of the json file into the UI:

image
Suggested change
#### Enable Agentic Chat access to CLI
Update the `cody.agentic.context` setting to `allow` or `block` specific commands:
```json
{
"cody.agentic.context": {
"shell": {
// Array of allowed command prefixes, or ["*"] for all commands
"allow": ["git", "gh", "ls"],
"block": ["git"] // Additional commands to block
}
}
}
```
#### Disable Agentic Chat access to CLI
To disable the feature, navigate to your user settings and set `cody.agentic.context` to an empty value. When disabled, the chat agent cannot access the CLI.


## Use cases

Agentic Chat can be helpful to assist you with a wide range of tasks, including:

- **Improved response quality**: Helps you get better and more accurate responses than other LLMs, making the additional processing time for context gathering a non-issue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean "making up for" ? Little confused by the second half of the sentence

- **Error resolution**: It can automatically identify error sources and suggest fixes by analyzing error logs
- **Better unit tests**: Automatically includes imports and other missing contexts to generate better unit tests

## Known limitations

### Enterprise deployments

Cody Gateway customers are required to have Claude 3.5 Haiku enabled (this requires Sourcegraph v5.9 and new [model configuration](/cody/enterprise/model-configuration)). BYOK customers will use the selected models, but the quality may vary.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth putting a disclaimer - "Currently, agentic chat uses Claude 3.5 Haiku for the reflection steps as it provides a good balance between quality and latency. The Enterprise instance must have access to Claude 3.5 Haiku to use agentic chat ..... "


### Security concerns

As mentioned above, Agentic Chat'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 be shared with the LLM.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should mention how they can disable this feature by setting agentic-chat-cli-tool-experimental to false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

1 change: 1 addition & 0 deletions src/data/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const navigation: NavigationItem[] = [
{ title: "Chat", href: "/cody/capabilities/chat", },
{ title: "Autocomplete", href: "/cody/capabilities/autocomplete", },
{ title: "Prompts", href: "/cody/capabilities/commands", },
{ title: "Agentic Chat", href: "/cody/capabilities/agentic-chat", },
{ title: "OpenCtx", href: "/cody/capabilities/openctx", },
{ title: "Debug Code", href: "/cody/capabilities/debug-code", },
{ title: "Context Filters", href: "/cody/capabilities/ignore-context", },
Expand Down
Loading