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
4 changes: 4 additions & 0 deletions public/__redirects
Original file line number Diff line number Diff line change
Expand Up @@ -1606,10 +1606,14 @@
# Guides section
/workers-ai/demos/ /workers-ai/guides/demos-architectures/ 301

# Features section
/workers-ai/markdown-conversion/ /workers-ai/features/markdown-conversion/ 301

# workflows

/workflows/reference/storage-options/ /workers/platform/storage-options/ 301


# workers KV
/kv/platform/environments/ /kv/reference/environments/ 301
/kv/platform/kv-commands/ /kv/reference/kv-commands/ 301
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,30 @@ In this example, we fetch a PDF document and an image from R2 and feed them both
import { Env } from "./env";

export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {

// https://pub-979cb28270cc461d94bc8a169d8f389d.r2.dev/somatosensory.pdf
const pdf = await env.R2.get('somatosensory.pdf');

// https://pub-979cb28270cc461d94bc8a169d8f389d.r2.dev/cat.jpeg
const cat = await env.R2.get('cat.jpeg');

return Response.json(
await env.AI.toMarkdown([
{
name: "somatosensory.pdf",
blob: new Blob([await pdf.arrayBuffer()], { type: "application/octet-stream" }),
},
{
name: "cat.jpeg",
blob: new Blob([await cat.arrayBuffer()], { type: "application/octet-stream" }),
},
]),
);
},
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
// https://pub-979cb28270cc461d94bc8a169d8f389d.r2.dev/somatosensory.pdf
const pdf = await env.R2.get("somatosensory.pdf");

// https://pub-979cb28270cc461d94bc8a169d8f389d.r2.dev/cat.jpeg
const cat = await env.R2.get("cat.jpeg");

return Response.json(
await env.AI.toMarkdown([
{
name: "somatosensory.pdf",
blob: new Blob([await pdf.arrayBuffer()], {
type: "application/octet-stream",
}),
},
{
name: "cat.jpeg",
blob: new Blob([await cat.arrayBuffer()], {
type: "application/octet-stream",
}),
},
]),
);
},
};
```

Expand All @@ -59,4 +62,4 @@ This is the result:
]
```

See [Markdown Conversion](/workers-ai/markdown-conversion/) for more information on supported formats, REST API and pricing.
See [Markdown Conversion](/workers-ai/features/markdown-conversion/) for more information on supported formats, REST API and pricing.
2 changes: 1 addition & 1 deletion src/content/docs/autorag/concepts/how-autorag-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Indexing begins automatically when you create an AutoRAG instance and connect a
Here is what happens during indexing:

1. **Data ingestion:** AutoRAG reads from your connected data source.
2. **Markdown conversion:** AutoRAG uses [Workers AI’s Markdown Conversion](/workers-ai/markdown-conversion/) to convert [supported data types](/autorag/configuration/data-source/) into structured Markdown. This ensures consistency across diverse file types. For images, Workers AI is used to perform object detection followed by vision-to-language transformation to convert images into Markdown text.
2. **Markdown conversion:** AutoRAG uses [Workers AI’s Markdown Conversion](/workers-ai/features/markdown-conversion/) to convert [supported data types](/autorag/configuration/data-source/) into structured Markdown. This ensures consistency across diverse file types. For images, Workers AI is used to perform object detection followed by vision-to-language transformation to convert images into Markdown text.
3. **Chunking:** The extracted text is [chunked](/autorag/configuration/chunking/) into smaller pieces to improve retrieval granularity.
4. **Embedding:** Each chunk is embedded using Workers AI’s embedding model to transform the content into vectors.
5. **Vector storage:** The resulting vectors, along with metadata like file name, are stored in a the [Vectorize](/vectorize/) database created on your Cloudflare account.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/autorag/configuration/data-source.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ AutoRAG supports the following plain text file types:

### Rich format file types

AutoRAG uses [Markdown Conversion](/workers-ai/markdown-conversion/) to convert rich format files to markdown. The following table lists the supported formats that will be converted to Markdown:
AutoRAG uses [Markdown Conversion](/workers-ai/features/markdown-conversion/) to convert rich format files to markdown. The following table lists the supported formats that will be converted to Markdown:

<Render file="markdown-conversion-support" product="workers-ai" />
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@

<sup>1</sup> Image conversion uses two Workers AI models for object detection
and summarization. See [Workers AI
pricing](/workers-ai/markdown-conversion/#pricing) for more details.
pricing](/workers-ai/features/markdown-conversion/#pricing) for more details.
Loading