Skip to content

Commit 8d011cb

Browse files
committed
getting started + bindings
1 parent bc9ebad commit 8d011cb

File tree

8 files changed

+188
-4
lines changed

8 files changed

+188
-4
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
pcx_content_type: concept
3+
title: How AutoRAG works
4+
sidebar:
5+
order: 6
6+
---
7+
8+
xyz
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
pcx_content_type: navigation
3+
title: Key concepts
4+
sidebar:
5+
order: 2
6+
group:
7+
hideIndex: true
8+
---
9+
10+
import { DirectoryListing } from "~/components";
11+
12+
<DirectoryListing />
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
pcx_content_type: navigation
3+
title: Configuration
4+
sidebar:
5+
order: 4
6+
group:
7+
hideIndex: true
8+
---
9+
10+
import { DirectoryListing } from "~/components";
11+
12+
<DirectoryListing />
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
pcx_content_type: concept
3+
title: Workers binding
4+
sidebar:
5+
order: 6
6+
---
7+
8+
import {
9+
Badge,
10+
Description,
11+
Render,
12+
TabItem,
13+
Tabs,
14+
WranglerConfig,
15+
MetaInfo,
16+
Type,
17+
} from "~/components";
18+
19+
A binding enables your Worker or Pages Function to interact with resources, like AutoRAG, on the Cloudflare Developer Platform. To use your AutoRAG with Workers or Pages, you can create an AI binding.
20+
21+
22+
## Workers
23+
24+
[Workers](/workers/) provides a serverless execution environment that allows you to create new applications or augment existing ones.
25+
26+
You can create bindings on the Cloudflare dashboard or by updating your [Wrangler file](/workers/wrangler/configuration/). To bind AutoRAG to your Worker, add the following to the end of your Wrangler file:
27+
28+
<WranglerConfig>
29+
30+
```toml
31+
[ai]
32+
binding = "AI" # i.e. available in your Worker on env.AI
33+
```
34+
35+
</WranglerConfig>
36+
37+
## Pages Functions
38+
39+
[Pages Functions](/pages/functions/) allow you to build full-stack applications with Cloudflare Pages by executing code on the Cloudflare network. Functions are Workers under the hood.
40+
41+
To configure an AutoRAG binding in your Pages Function, you must use the Cloudflare Dashboard. Refer to [AI bindings](/pages/functions/bindings/#workers-ai) for instructions. [Anni Need to update here!]
42+
43+
## Methods
44+
45+
There are...
46+
47+
### `aiSearch()`
48+
49+
For an AutoRAG named `my-autorag`...
50+
51+
```js
52+
const answer = await env.AI.AutoRAG('my-autorag').aiSearch({
53+
query: 'What are the latest Cloudflare Workers updates?'
54+
});
55+
```
56+
57+
#### Parameters
58+
59+
- `query` <Type text="string" /> <MetaInfo text="required" />
60+
- `max_num_results` <Type text="number" /> <MetaInfo text="optional" />
61+
- `ranking_options`
62+
- `score_threshold` <Type text="number" /> <MetaInfo text="optional" />
63+
- `rewrite_query` <Type text="boolean" /> <MetaInfo text="optional" />
64+
65+
#### Response
66+
67+
### `search()`
68+
69+
For an AutoRAG named `my-autorag`...
70+
71+
```js
72+
const answer = await env.AI.AutoRAG('my-autorag').search({
73+
query: 'What are the latest Cloudflare Workers updates?'
74+
});
75+
```
76+
77+
#### Parameters
78+
79+
#### Response
80+
81+
82+
83+
84+
85+
86+
87+

src/content/docs/autorag/get-started.mdx

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,62 @@ sidebar:
55
order: 2
66
head:
77
- tag: title
8-
content: Get started with Cloudflare DNS
9-
Description:
8+
content: Get started with AutoRAG
9+
Description: XX
1010
---
11+
12+
AutoRAG allows developers to create fully managed retrieval-augmented generation (RAG) pipelines to power AI applications with accurate and up-to-date information without needing to manage infrastructure.
13+
14+
## 1. (Optional) Upload data
15+
16+
AutoRAG integrates with R2 for data import. Create an R2 bucket if you don’t have one and upload your data.
17+
18+
:::note
19+
Before you create your first bucket, you must purchase R2 from the Cloudflare dashboard.
20+
:::
21+
22+
To create and upload objects to your bucket from the Cloudflare Dashboard:
23+
24+
1. Log in to the [Cloudflare Dashboard](https://dash.cloudflare.com) and select **R2**.
25+
2. Select Create bucket, name the bucket, and select **Create bucket**.
26+
3. Choose to either drag and drop your file into the upload area or **select from computer**.
27+
28+
## 2. Create an AutoRAG
29+
30+
To create a new AutoRAG:
31+
32+
1. Log in to the [Cloudflare Dashboard](https://dash.cloudflare.com) and select **AI** then **AutoRAG**.
33+
2. Select **Create AutoRAG** and complete the setup process:
34+
- Select a **R2 bucket**.
35+
- Select an **embedding model**.
36+
- Select a **LLM model**.
37+
- Select or create an **AI Gateway**.
38+
- Enter a **name** for the AutoRAG.
39+
- Create a new **API token** or reuse an existing API token.
40+
3. Select **Create**
41+
42+
## 3. Monitor indexing
43+
44+
Once created, AutoRAG will create a Vectorize database in your account and begin indexing the data.
45+
46+
To monitor the indexing progress:
47+
48+
1. From the **AutoRAG** page in the dashboard, locate and select your AutoRAG.
49+
2. Navigate to the **Overview** page to view the current indexing progress.
50+
51+
## 4. Try it out
52+
53+
Once indexing is complete, to try out the AutoRAG:
54+
55+
1. From the **AutoRAG** page in the dashboard, locate and select your AutoRAG.
56+
2. Navigate to the **Playground** page.
57+
3. Select **Search with AI** or **Search**.
58+
4. Enter a **query** to test out its response.
59+
60+
61+
## Use AutoRAG options
62+
63+
Cloudflare provides multiple ways for developers to use AutoRAG in their applications:
64+
65+
- REST API
66+
- Workers Binding

src/content/docs/autorag/index.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ head:
99
content: Cloudflare AutoRAG
1010
---
1111

12+
import {
13+
CardGrid,
14+
Description,
15+
LinkTitleCard,
16+
Plan,
17+
RelatedProduct,
18+
} from "~/components";
19+
1220
<Plan type="all" />
1321
---
1422

src/content/products/autorag.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ product:
99

1010
meta:
1111
title: AutoRAG
12-
description:
12+
description: Create fully managed RAG pipelines for your AI applications.
1313
author: '@cloudflare'
1414

1515
resources:
16-
community:
16+
community:
1717
dashboard_link:
1818
discord: https://discord.gg/cloudflaredev

src/icons/autorag.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)