You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorial/markdown/nodejs/quickstart-mastra/mastra-couchbase-nextJS-tutorial.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,19 @@ length: 60 Mins
25
25
26
26
This tutorial will guide you through building a complete Retrieval-Augmented Generation (RAG) application from scratch using [Next.js](https://nextjs.org/), the [Mastra AI framework](https://mastra.ai/), and [Couchbase](https://www.couchbase.com/) for [vector search](https://www.couchbase.com/products/vector-search/). We'll start by getting the pre-built application running and then break down how each part works so you can build it yourself.
27
27
28
+
29
+
## About Mastra
30
+
31
+
Mastra is an open-source TypeScript agent framework designed to provide the necessary primitives for building AI applications and features. It allows you to create AI agents with memory, execute functions, and chain LLM calls in deterministic workflows. Here are some key features of Mastra:
32
+
33
+
-**Model Routing:** Utilizes the Vercel AI SDK for model routing, offering a unified interface to interact with various LLM providers like OpenAI, Anthropic, and Google Gemini.
34
+
-**Agent Memory and Tool Calling:** Agents can be equipped with tools (functions) they can call, and their memory can be persisted and retrieved based on recency, semantic similarity, or conversation thread.
35
+
-**Workflow Graphs:** Provides a graph-based workflow engine for executing LLM calls deterministically, with simple syntax for control flow.
36
+
-**Retrieval-Augmented Generation (RAG):** Offers APIs to process documents into chunks, create embeddings, and store them in a vector database, retrieving relevant chunks at query time to ground LLM responses in your data.
37
+
-**Deployment:** Supports bundling agents and workflows within existing applications or as standalone endpoints, with easy deployment to platforms like Vercel, Cloudflare Workers, or Netlify.
38
+
39
+
This framework is integral to the tutorial, as it powers the AI orchestration and workflow management, enabling the creation of a robust RAG application with Couchbase and Next.js.
40
+
28
41
## Part 1: Quick Start
29
42
30
43
First, let's get the completed application running to see what we're building.
@@ -328,15 +341,15 @@ This separation of concerns allows the backend to focus on the heavy lifting of
328
341
329
342
---
330
343
331
-
## Part 6: Customization and Extensions
344
+
## Appendix: Customization and Extensions
332
345
333
-
### 7.1 Supporting Different Document Types
346
+
### Supporting Different Document Types
334
347
You can extend the `readDocument`functionin`ingestPdf/route.ts` to support other file types like `.docx` or `.txt` by using different parsing libraries.
335
348
336
-
### 7.2 Advanced Mastra Features
349
+
### Advanced Mastra Features
337
350
Explore more of Mastra's capabilities by creating multi-agent workflows, adding more custom tools (e.g., a tool to perform web searches), or implementing more sophisticated memory strategies.
338
351
339
-
### 7.3 Enhanced Vector Search
352
+
### Enhanced Vector Search
340
353
Improve retrieval by experimenting with hybrid search (combining vector search with traditional keyword search), filtering by metadata, or implementing more advanced chunking and embedding strategies.
0 commit comments