Skip to content
Merged
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
164 changes: 0 additions & 164 deletions src/content/docs/extensions/db2i/AI/Continue/Continue.mdx

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 15 additions & 19 deletions src/content/docs/extensions/db2i/AI/code-assistant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ sidebar:
import { Aside, CardGrid, Card, LinkCard, Steps, Badge } from '@astrojs/starlight/components';
import { Image } from 'astro:assets';

<Badge text="Start Here" size="large" />The Db2 for IBM i extension, as of 1.6.3, has the ability to integrate with specific AI extensions:
<Badge text="Start Here" size="large" />The Db2 for IBM i extension, as of 1.6.3, has the ability to integrate with AI extensions:

<CardGrid>
<Card title="Continue" icon="rocket">
✅ Multiple AI Providers available, including Watsonx!
</Card>
<Card title="GitHub Copilot" icon="github">
✅ Requires GitHub Copilot licence
</Card>
</CardGrid>
<CardGrid>
<LinkCard title="Continue" href="https://marketplace.visualstudio.com/items?itemName=Continue.continue" icon="github"/>
<LinkCard title="GitHub Copilot" href="https://marketplace.visualstudio.com/items?itemName=GitHub.copilot" icon="github"/>
</CardGrid>

## Introduction
![alt text](image-8.png)

The Db2 for i SQL code assistant provides intregrations with AI code assistants such as GitHub Copilot Chat and Continue. These integrations allow you to ask questions about your Db2 for IBM i database, and get help with writing SQL queries. The best part is that you can do this directly from your VS Code editor.
The Db2 for i SQL code assistant provides integration with GitHub Copilot Chat, allowing you to ask questions about your Db2 for IBM i database, and get help with writing SQL queries. The best part is that you can do this directly from your VS Code editor.


## Use cases
Expand All @@ -43,7 +39,7 @@ Common Use cases of the SQL code assistant include:

## How does this work?

The `@db2i` GitHub Copilot chat participant and the `@Db2i` Continue context provider work in the same way by extracting relevant database information from the user prompt. Here is breakdown of the algorithm:
The `@db2i` GitHub Copilot chat participant works by extracting relevant database information from the user prompt. Here is a breakdown of the algorithm:

![alt text](image-21.png)

Expand Down Expand Up @@ -77,7 +73,7 @@ tell me about the columns in sample.employee

#### Step 4: Add Metadata to Prompt Context

- Finally, we insert the fetched column metadata into the prompt context using the Continue API
- Finally, we insert the fetched column metadata into the prompt context

![Metadata Integration](https://github.com/user-attachments/assets/f62d360e-215b-4a36-8681-6a8fc9a5d010)

Expand All @@ -86,15 +82,15 @@ tell me about the columns in sample.employee
* Since Database metadata is fetched from the SQL Job Manager, it is important to ensure that the SQL Job Manager is connected and configured correctly.
</Aside>

let's break down the process of how the `@db2i` chat participant and the `@Db2i` context provider work:
let's break down the process of how the `@db2i` chat participant works:


### Heres a breakdown of the process:
### Here's a breakdown of the process:
![alt text](../AI/image-19.png)


1. **Activate the `@Db2i` Context Provider**
- Start by typing the "@" symbol in the chat text box to invoke the `@Db2i` context provider.
1. **Activate the `@db2i` Chat Participant**
- Start by typing the "@" symbol in the chat text box to invoke the `@db2i` chat participant.
2. **Enter Your Query**
- Use a prompt like:
```
Expand All @@ -109,7 +105,7 @@ By integrating database context directly into our prompts, we make SQL generatio

## What data is shared?

If you do not want to share your data with any AI services, then do not invoke the functionality through VS Code. For example, we only fetch metadata when the user explicitly requests it through the chat windows. We do not fetch any metadata without the user explicitly using the chat windows in either Copilot Chat or Continue. Simply don't install the extensions, or don't use the `@db2i` context.
If you do not want to share your data with any AI services, then do not invoke the functionality through VS Code. For example, we only fetch metadata when the user explicitly requests it through the chat windows. We do not fetch any metadata without the user explicitly using the chat windows in Copilot Chat. Simply don't install the extension, or don't use the `@db2i` context.

<Aside type="note">
We do not give any service user data that exists on your system. But, we feed the following metadata into the context of the chat so it can generate more accurate answers.
Expand All @@ -129,22 +125,22 @@ If you do not want to share your data with any AI services, then do not invoke t
---

<Aside title="A Note about Open Source">
Our AI integration is fully open-source. We are transparent about how we connect our users to services and support multiple providers (such as GitHub Copilot and Continue). This gives our users the freedom to choose which AI services they want to use, if any.
Our AI integration is fully open-source. We are transparent about how we connect our users to services. This gives our users the freedom to choose which AI services they want to use, if any.

You can see all our AI integration code in the [GitHub repository for the Db2 for IBM i extension](https://github.com/codefori/vscode-db2i/tree/main/src/aiProviders).
</Aside>

## Known Limitations

The `@db2i` chat participant and the `@Db2i` context provider are designed to provide accurate and insightful SQL generation based on the user's database context. However, there are some limitations to keep in mind:
The `@db2i` chat participant is designed to provide accurate and insightful SQL generation based on the user's database context. However, there are some limitations to keep in mind:

1. **Schema Resolution**
- The `@db2i` chat participant and the `@Db2i` context provider rely on the active SQL Job's schema to resolve table references. If the schema is not set or is incorrect, the model may not be able to resolve table references accurately.
- The `@db2i` chat participant relies on the active SQL Job's schema to resolve table references. If the schema is not set or is incorrect, the model may not be able to resolve table references accurately.
2. **Complex Queries**
- The `@db2i` chat participant and the `@Db2i` context provider are optimized for generating simple SQL queries. For more complex queries, the model may not be able to provide accurate results.
- The `@db2i` chat participant is optimized for generating simple SQL queries. For more complex queries, the model may not be able to provide accurate results.
- For complex queries, it is recommended to manually write the SQL query or use the model's generated SQL as a starting point.
3. **Data Sensitivity**
- The `@db2i` chat participant and the `@Db2i` context provider do not store or transmit any user data. All database metadata is fetched from the SQL Job Manager based on the user's active connection.
- The `@db2i` chat participant does not store or transmit any user data. All database metadata is fetched from the SQL Job Manager based on the user's active connection.
- To ensure data privacy and security, it is recommended to review the model's generated SQL before executing it in the active SQL editor.
4. **Model Accuracy**
- The `@db2i` chat participant and the `@Db2i` context provider are continuously being improved to provide more accurate and insightful SQL generation. If you encounter any issues or have feedback, please let us know!
- The `@db2i` chat participant is continuously being improved to provide more accurate and insightful SQL generation. If you encounter any issues or have feedback, please let us know!
2 changes: 1 addition & 1 deletion src/content/docs/extensions/db2i/AI/roadmap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Here is a list of things that we want to work on in 2025 for the AI tooling in t

<Steps>

1. **Standardise Copilot and Continue to use the same contexts and prompts.** <Badge text="WIP" variant="note" />
1. **Improve Copilot contexts and prompts.** <Badge text="WIP" variant="note" />

2. **Better support system naming, and specifically, the library list**

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/extensions/db2i/AI/use-cases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Aside, CardGrid, Card, LinkCard, Steps } from '@astrojs/starlight/compo
<Aside>
✏️ More Examples and Tutorials coming soon!
</Aside>
This is a collection of use cases for the Db2 for i Code Assistant in Github Copilot and Continue. For these examples, I will be using Continue, but the same features apply to Copilot.
This is a collection of use cases for the Db2 for i Code Assistant in GitHub Copilot.


## SQL Generation
Expand Down