Skip to content

Commit 5a59be8

Browse files
committed
Merge main into update-ruby-on-rails-tutorial
Resolved merge conflict in test/test-markdown-frontmatter.js by keeping both PHP Laravel and Ruby on Rails test configuration changes.
2 parents 34ad7e0 + f33fe7c commit 5a59be8

10 files changed

+1587
-1227
lines changed

test/test-markdown-frontmatter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ const yaml = require('js-yaml')
44
const chalk = require('chalk')
55

66
// accepted data field values
7-
const sdk_languages = ['nodejs', 'scala', 'python', 'swift', 'csharp', 'objective-c', 'android-java', 'any', 'java', 'kotlin', 'dart', 'golang', 'ruby', 'c++']
7+
const sdk_languages = ['nodejs', 'scala', 'python', 'swift', 'csharp', 'objective-c', 'android-java', 'any', 'java', 'kotlin', 'dart', 'golang', 'ruby', 'php', 'c++']
88

9-
const tags = ['Ottoman', 'Ktor', 'REST API', 'Express', 'Flask', 'TLS', 'Configuration', 'Next.js', 'iOS', 'Xcode', '.NET', 'Xamarin', 'Authentication', 'OpenID', 'Keycloak', 'Android', 'P2P', 'UIKit', 'Installation', 'Spring Boot', 'Spring Data', 'Transactions', 'SQL++ (N1QL)', 'Optimization', 'Community Edition', 'Docker', 'Data Modeling', 'Metadata', 'Best Practices', 'Data Ingestion', 'Kafka', 'Airbyte', 'Support', 'Customer', 'Prometheus', 'Monitoring', 'Observability', 'Metrics', 'Query Workbench', 'ASP.NET', 'linq', 'DBaaS', 'App Services', 'Flutter', 'Gin Gonic', 'FastAPI', 'Rails', 'Couchbase ORM', 'LangChain', 'OpenAI', 'Streamlit', 'Google Gemini', 'Nvidia NIM', 'LLama3', 'AWS', 'Artificial Intelligence', 'Cohere', 'Jina AI', 'Mistral AI', 'Ragas', 'Haystack', 'LangGraph', 'Amazon Bedrock', 'CrewAI', 'PydanticAI', 'C++', 'C++ SDK', 'smolagents', 'Ag2', 'Autogen', 'Couchbase Edge Server', 'Deepseek', 'OpenRouter', 'mastra', 'Looker Studio', 'Google Data Studio', 'Connector', 'Couchbase Columnar', 'TAVs', 'Custom Queries', 'Data API', 'FTS', 'GSI', 'Hugging Face', 'LlamaIndex', 'GraphQL', 'Semantic Kernel', 'Hyperscale Vector Index', 'Composite Vector Index', 'Search Vector Index']
9+
const tags = ['Ottoman', 'Ktor', 'REST API', 'Express', 'Flask', 'TLS', 'Configuration', 'Next.js', 'iOS', 'Xcode', '.NET', 'Xamarin', 'Authentication', 'OpenID', 'Keycloak', 'Android', 'P2P', 'UIKit', 'Installation', 'Spring Boot', 'Spring Data', 'Transactions', 'SQL++ (N1QL)', 'Optimization', 'Community Edition', 'Docker', 'Data Modeling', 'Metadata', 'Best Practices', 'Data Ingestion', 'Kafka', 'Airbyte', 'Support', 'Customer', 'Prometheus', 'Monitoring', 'Observability', 'Metrics', 'Query Workbench', 'ASP.NET', 'linq', 'DBaaS', 'App Services', 'Flutter', 'Gin Gonic', 'FastAPI', 'Rails', 'Couchbase ORM', 'Laravel', 'LangChain', 'OpenAI', 'Streamlit', 'Google Gemini', 'Nvidia NIM', 'LLama3', 'AWS', 'Artificial Intelligence', 'Cohere', 'Jina AI', 'Mistral AI', 'Ragas', 'Haystack', 'LangGraph', 'Amazon Bedrock', 'CrewAI', 'PydanticAI', 'C++', 'C++ SDK', 'smolagents', 'Ag2', 'Autogen', 'Couchbase Edge Server', 'Deepseek', 'OpenRouter', 'mastra', 'Looker Studio', 'Google Data Studio', 'Connector', 'Couchbase Columnar', 'TAVs', 'Custom Queries', 'Data API', 'FTS', 'GSI', 'Hugging Face', 'LlamaIndex', 'GraphQL', 'Semantic Kernel', 'Hyperscale Vector Index', 'Composite Vector Index', 'Search Vector Index']
1010

1111
const technologies = ['connectors', 'kv', 'query', 'capella', 'server', 'index', 'mobile', 'fts', 'sync gateway', 'eventing', 'analytics', 'udf', 'vector search', 'react', 'edge-server', 'app-services', 'hyperscale vector index', 'composite vector index']
1212

1313
const content_types = ['quickstart', 'tutorial', 'learn']
1414

1515

16+
1617
const test = (data, path) => {
1718
// test path
1819
if (!data.path) {

tutorial/markdown/generated/vector-search-cookbook/crewai-short-term-memory-gsi-CouchbaseStorage_Demo.md

Lines changed: 0 additions & 1085 deletions
This file was deleted.

tutorial/markdown/generated/vector-search-cookbook/crewai-short-term-memory-query_based-CouchbaseStorage_Demo.md

Lines changed: 878 additions & 0 deletions
Large diffs are not rendered by default.

tutorial/markdown/generated/vector-search-cookbook/crewai-short-term-memory-fts-CouchbaseStorage_Demo.md renamed to tutorial/markdown/generated/vector-search-cookbook/crewai-short-term-memory-search_based-CouchbaseStorage_Demo.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
# frontmatter
3-
path: "/tutorial-crewai-short-term-memory-couchbase-with-fts"
4-
title: Implementing Short-Term Memory for CrewAI Agents with Couchbase using FTS Service
5-
short_title: CrewAI Short-Term Memory with Couchbase using FTS
3+
path: "/tutorial-crewai-short-term-memory-couchbase-with-search-vector-index"
4+
title: Implementing Short-Term Memory for CrewAI Agents with Couchbase Search Vector Index
5+
short_title: CrewAI Short-Term Memory with Couchbase Search Vector Index
66
description:
7-
- Learn how to implement short-term memory for CrewAI agents using Couchbase's vector search capabilities using FTS.
7+
- Learn how to implement short-term memory for CrewAI agents using Couchbase's vector search capabilities with Search Vector Index.
88
- This tutorial demonstrates how to store and retrieve agent interactions using semantic search.
99
- You'll understand how to enhance CrewAI agents with memory capabilities using LangChain and Couchbase.
1010
content_type: tutorial
1111
filter: sdk
1212
technology:
1313
- vector search
1414
tags:
15-
- FTS
15+
- Search Vector Index
1616
- Artificial Intelligence
1717
- LangChain
1818
- CrewAI
@@ -22,28 +22,28 @@ length: 45 Mins
2222
---
2323

2424

25+
2526
<!--- *** WARNING ***: Autogenerated markdown file from jupyter notebook. ***DO NOT EDIT THIS FILE***. Changes should be made to the original notebook file. See commit message for source repo. -->
2627

2728

28-
[View Source](https://github.com/couchbase-examples/vector-search-cookbook/tree/main/crewai-short-term-memory/fts/CouchbaseStorage_Demo.ipynb)
29+
[View Source](https://github.com/couchbase-examples/vector-search-cookbook/tree/main/crewai-short-term-memory/search_based/CouchbaseStorage_Demo.ipynb)
2930

30-
# CrewAI with Couchbase Short-Term Memory
31+
## Introduction
3132

32-
This notebook demonstrates how to implement a custom storage backend for CrewAI's memory system using Couchbase and vector search. Alternatively if you want to perform semantic search using the GSI index, please take a look at [this.](https://developer.couchbase.com/tutorial-crewai-short-term-memory-couchbase-with-global-secondary-index)
33+
This notebook demonstrates how to implement a custom storage backend for CrewAI's memory system using Couchbase and Search Vector Index. Alternatively if you want to perform semantic search using Hyperscale or Composite Vector Index, please take a look at [this tutorial.](https://developer.couchbase.com/tutorial-crewai-short-term-memory-couchbase-with-hyperscale-or-composite-vector-index)
3334

3435
Here's a breakdown of each section:
3536

36-
How to run this tutorial
37-
----------------------
37+
### How to run this tutorial
38+
3839
This tutorial is available as a Jupyter Notebook (.ipynb file) that you can run
39-
interactively. You can access the original notebook [here](https://github.com/couchbase-examples/vector-search-cookbook/blob/main/crewai-short-term-memory/fts/CouchbaseStorage_Demo.ipynb).
40+
interactively. You can access the original notebook [here](https://github.com/couchbase-examples/vector-search-cookbook/blob/main/crewai-short-term-memory/search_based/CouchbaseStorage_Demo.ipynb).
4041

4142
You can either:
4243
- Download the notebook file and run it on [Google Colab](https://colab.research.google.com)
4344
- Run it on your system by setting up the Python environment
4445

45-
Before you start
46-
---------------
46+
### Before you start
4747

4848
1. Create and Deploy Your Free Tier Operational cluster on [Capella](https://cloud.couchbase.com/sign-up)
4949
- To get started with [Couchbase Capella](https://cloud.couchbase.com), create an account and use it to deploy
@@ -58,7 +58,7 @@ Before you start
5858
used in the application
5959
- Allow access to the Cluster from the IP on which the application is running by following the [Network Security documentation](https://docs.couchbase.com/cloud/security/security.html#public-access)
6060

61-
# Memory in AI Agents
61+
## Memory in AI Agents
6262

6363
Memory in AI agents is a crucial capability that allows them to retain and utilize information across interactions, making them more effective and contextually aware. Without memory, agents would be limited to processing only the immediate input, lacking the ability to build upon past experiences or maintain continuity in conversations.
6464

@@ -119,7 +119,7 @@ This section installs the necessary Python packages:
119119

120120

121121
```python
122-
%pip install --quiet crewai==0.186.1 langchain-couchbase==0.4.0 langchain-openai==0.3.33 python-dotenv==1.1.1
122+
%pip install --quiet crewai==0.186.1 langchain-couchbase==1.0.1 langchain-openai python-dotenv==1.1.1
123123
```
124124

125125
Note: you may need to restart the kernel to use updated packages.
@@ -175,6 +175,23 @@ The script uses environment variables to store sensitive information, enhancing
175175
>
176176
> You can set these variables in a `.env` file in the same directory as this notebook, or set them directly in your environment.
177177
178+
### Google Colab Setup
179+
180+
If running in Google Colab, use the Secrets feature:
181+
1. Click the 🔑 (key icon) in the left sidebar
182+
2. Add secrets with these names: `OPENAI_API_KEY`, `CB_HOST`, `CB_USERNAME`, `CB_PASSWORD`
183+
3. Toggle "Notebook access" for each secret
184+
4. Run this code before the environment verification cell:
185+
186+
```python
187+
from google.colab import userdata
188+
import os
189+
os.environ['OPENAI_API_KEY'] = userdata.get('OPENAI_API_KEY')
190+
os.environ['CB_HOST'] = userdata.get('CB_HOST')
191+
os.environ['CB_USERNAME'] = userdata.get('CB_USERNAME')
192+
os.environ['CB_PASSWORD'] = userdata.get('CB_PASSWORD')
193+
```
194+
178195

179196
```python
180197
load_dotenv("./.env")
@@ -188,12 +205,13 @@ for var in required_vars:
188205

189206
## Implement CouchbaseStorage
190207

191-
This section demonstrates the implementation of a custom vector storage solution using Couchbase:
208+
This section demonstrates the implementation of a custom vector storage solution using Couchbase with Search Vector Index:
192209

193210
> **Note on Implementation:** This example uses the LangChain Couchbase integration (`langchain_couchbase`) for simplicity and to demonstrate integration with the broader LangChain ecosystem. In production environments, you may want to use the Couchbase SDK directly for better performance and more control.
194211
195-
> For more information on using the Couchbase SDK directly, refer to:
212+
> For more information on using the Couchbase SDK directly and Search Vector Indexes, refer to:
196213
> - [Couchbase Python SDK Documentation](https://docs.couchbase.com/python-sdk/current/howtos/full-text-searching-with-sdk.html#single-vector-query)
214+
> - [Couchbase Vector Index Documentation](https://docs.couchbase.com/cloud/vector-index/use-vector-indexes.html)
197215
198216

199217
```python
@@ -374,13 +392,13 @@ class CouchbaseStorage(RAGStorage):
374392
break
375393
break
376394
if not search_available:
377-
raise RuntimeError("Search/FTS service not found or not responding")
395+
raise RuntimeError("Search service not found or not responding")
378396

379397
# Set up storage configuration
380398
self.bucket_name = os.getenv('CB_BUCKET_NAME', 'vector-search-testing')
381-
self.scope_name = os.getenv('SCOPE_NAME', 'shared')
382-
self.collection_name = os.getenv('COLLECTION_NAME', 'crew')
383-
self.index_name = os.getenv('INDEX_NAME', 'vector_search_crew')
399+
self.scope_name = os.getenv('CB_SCOPE_NAME', 'shared')
400+
self.collection_name = os.getenv('CB_COLLECTION_NAME', 'crew')
401+
self.index_name = os.getenv('CB_INDEX_NAME', 'vector_search_crew')
384402

385403
# Initialize vector store
386404
self.vector_store = CouchbaseSearchVectorStore(

0 commit comments

Comments
 (0)