{"id":10285,"date":"2025-12-09T02:13:28","date_gmt":"2025-12-09T10:13:28","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/couchbase-ag2-rag\/"},"modified":"2025-12-09T02:13:28","modified_gmt":"2025-12-09T10:13:28","slug":"couchbase-ag2-rag","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/","title":{"rendered":"Build an Agentic RAG Application with Couchbase and AG2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/couchbase-examples\/vector-search-cookbook\/tree\/main\/ag2\/agentchat_RetrieveChat_couchbase.ipynb\">View Source<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This tutorial will show you how we&#8217;ve made building Retrieval-Augmented Generation (RAG) applications much easier with <a href=\"https:\/\/www.couchbase.com\/\">Couchbase<\/a> and <a href=\"https:\/\/ag2.ai\/\">AG2<\/a>. By leveraging <a href=\"https:\/\/docs.couchbase.com\/cloud\/vector-search\/vector-search.html\">Couchbase&#8217;s Search vector index<\/a> for storing and retrieving document embeddings, along with <a href=\"https:\/\/docs.ag2.ai\/docs\/user-guide\/basic-concepts\/installing-ag2\">AG2&#8217;s powerful AI capabilities<\/a>, our integration simplifies the entire process. As part of this tutorial, we&#8217;ll also build a demo application where an AI agent can answer questions based on documentation links provided for any framework. This hands-on approach will demonstrate how effortlessly you can create intelligent, context-aware AI applications using this integration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">RetrieveChat is a conversational system for retrieval-augmented code generation and question answering. In this notebook, we demonstrate how to utilize RetrieveChat to generate code and answer questions based on customized documentations that are not present in the LLM&#8217;s training dataset. RetrieveChat uses the <code>AssistantAgent<\/code> and <code>RetrieveUserProxyAgent<\/code>, which is similar to the usage of <code>AssistantAgent<\/code> and <code>UserProxyAgent<\/code> in other notebooks (e.g., <a href=\"https:\/\/docs.ag2.ai\/docs\/use-cases\/notebooks\/notebooks\/agentchat_auto_feedback_from_code_execution\">Automated Task Solving with Code Generation, Execution &amp; Debugging<\/a>). Essentially, <code>RetrieveUserProxyAgent<\/code> implement a different auto-reply mechanism corresponding to the RetrieveChat prompts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some extra dependencies are needed for this notebook, which can be installed via pip<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>%pip install &quot;pyautogen[openai,retrievechat-couchbase]==0.8.7&quot; &quot;flaml[automl]==2.3.4&quot; couchbase==4.3.3\n# For more information, please refer to the [installation guide](\/docs\/installation\/).\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-environment-setup\" class=\"wp-block-heading\">Environment Setup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before we proceed with the notebook, we will require a Couchbase Capella Database Cluster running.<\/p>\n\n\n\n<h3 id=\"h-setting-up-a-free-cluster\" class=\"wp-block-heading\">Setting Up a Free Cluster<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To set up a free operational cluster, head over to <a href=\"https:\/\/cloud.couchbase.com\">Couchbase Cloud<\/a> and create an account. There, create a free cluster. For more details on creating a cluster, <a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/create-account.html\">refer here<\/a>.<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-creating-required-resources\" class=\"wp-block-heading\">Creating Required Resources<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After creating the cluster, we need to create our required bucket, scope, and collections. Head over to <strong>Data Tools<\/strong>. On the left-hand side panel, you will find an option to create a bucket. Assign appropriate names for the Bucket, Scope, and Collection. For this tutorial, use the following:\n<ul>\n<li><strong>Bucket Name<\/strong>: <code>new_bucket<\/code><\/li>\n<li><strong>Scope Name<\/strong>: <code>new_scope<\/code><\/li>\n<li><strong>Collection Name<\/strong>: <code>new_collection<\/code><\/li>\n<li><strong>Vector SearchIndex Name<\/strong>: <code>vector_index<\/code><\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-creating-a-search-index\" class=\"wp-block-heading\">Creating a Search Index<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before proceeding further, we need to set up a search index for vector-based retrieval. This is essential for efficient querying in our RAG pipeline. Follow the steps below:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><a href=\"https:\/\/docs.couchbase.com\/cloud\/search\/import-search-index.html\">Couchbase Capella<\/a><\/p>\n<ul>\n<li>Copy the index definition below to a new file index.json<\/li>\n<li>Import the file in Capella using the instructions in the documentation.<\/li>\n<li>Click on Create Index to create the index.<\/li>\n<\/ul>\n<\/li>\n\n\n<li>\n<p><a href=\"https:\/\/docs.couchbase.com\/server\/current\/search\/import-search-index.html\">Couchbase Server<\/a><\/p>\n<ul>\n<li>Click on Search -&gt; Add Index -&gt; Import<\/li>\n<li>Copy the following index definition in the Import screen<\/li>\n<li>Click on Create Index to create the index.<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<h5 id=\"h-index-definition\" class=\"wp-block-heading\">Index Definition<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\"><code>bucket<\/code>, <code>scope<\/code>, <code>collection<\/code> === <code>sample_bucekt<\/code>, <code>sample_scope<\/code>, <code>sample_collection<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>{\n  &quot;name&quot;: &quot;vector_index&quot;,\n  &quot;type&quot;: &quot;fulltext-index&quot;,\n  &quot;params&quot;: {\n    &quot;doc_config&quot;: {\n      &quot;docid_prefix_delim&quot;: &quot;&quot;,\n      &quot;docid_regexp&quot;: &quot;&quot;,\n      &quot;mode&quot;: &quot;scope.collection.type_field&quot;,\n      &quot;type_field&quot;: &quot;type&quot;\n    },\n    &quot;mapping&quot;: {\n      &quot;default_analyzer&quot;: &quot;standard&quot;,\n      &quot;default_datetime_parser&quot;: &quot;dateTimeOptional&quot;,\n      &quot;default_field&quot;: &quot;_all&quot;,\n      &quot;default_mapping&quot;: {\n        &quot;dynamic&quot;: true,\n        &quot;enabled&quot;: false\n      },\n      &quot;default_type&quot;: &quot;_default&quot;,\n      &quot;docvalues_dynamic&quot;: false,\n      &quot;index_dynamic&quot;: true,\n      &quot;store_dynamic&quot;: false,\n      &quot;type_field&quot;: &quot;_type&quot;,\n      &quot;types&quot;: {\n        &quot;sample_scope.sample_collection&quot;: {\n          &quot;dynamic&quot;: true,\n          &quot;enabled&quot;: true,\n          &quot;properties&quot;: {\n            &quot;embedding&quot;: {\n              &quot;enabled&quot;: true,\n              &quot;dynamic&quot;: false,\n              &quot;fields&quot;: [\n                {\n                  &quot;dims&quot;: 384,\n                  &quot;index&quot;: true,\n                  &quot;name&quot;: &quot;embedding&quot;,\n                  &quot;similarity&quot;: &quot;dot_product&quot;,\n                  &quot;type&quot;: &quot;vector&quot;,\n                  &quot;vector_index_optimized_for&quot;: &quot;recall&quot;\n                }\n              ]\n            },\n            &quot;content&quot;: {\n              &quot;enabled&quot;: true,\n              &quot;dynamic&quot;: false,\n              &quot;fields&quot;: [\n                {\n                  &quot;index&quot;: true,\n                  &quot;name&quot;: &quot;content&quot;,\n                  &quot;store&quot;: true,\n                  &quot;type&quot;: &quot;text&quot;\n                }\n              ]\n            }\n          }\n        }\n      }\n    },\n    &quot;store&quot;: {\n      &quot;indexType&quot;: &quot;scorch&quot;,\n      &quot;segmentVersion&quot;: 16\n    }\n  },\n  &quot;sourceType&quot;: &quot;gocbcore&quot;,\n  &quot;sourceName&quot;: &quot;sample_bucket&quot;,\n  &quot;sourceParams&quot;: {},\n  &quot;planParams&quot;: {\n    &quot;maxPartitionsPerPIndex&quot;: 64,\n    &quot;indexPartitions&quot;: 16,\n    &quot;numReplicas&quot;: 0\n  }\n}\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-connecting-to-the-cluster\" class=\"wp-block-heading\">Connecting to the Cluster<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Now, we will connect to the cluster. <a href=\"https:\/\/docs.couchbase.com\/cloud\/get-started\/connect.html\">Refer to this page for connection details<\/a>.<\/p>\n<\/li>\n\n\n<li>\n<p><strong>Create a user to connect:<\/strong><\/p>\n<ul>\n<li>Navigate to the <strong>Settings<\/strong> tab.<\/li>\n<li>Click <strong>Create Cluster Access<\/strong> and specify a username and password.<\/li>\n<li>Assign <strong>read\/write access to all buckets<\/strong> (you may create more users with restricted permissions as needed).<\/li>\n<li>For more details, <a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/manage-database-users.html#create-database-credentials\">refer here<\/a>.<\/li>\n<\/ul>\n<\/li>\n\n\n<li>\n<p><strong>Add an IP Address to the allowed list:<\/strong><\/p>\n<ul>\n<li>In <strong>Settings<\/strong>, click on <strong>Networking<\/strong>.<\/li>\n<li>Add an <a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/allow-ip-address.html\">allowed IP<\/a> based on your requirements.<\/li>\n<\/ul>\n<\/li>\n\n\n<li>\n<p><strong>Set up environment variables:<\/strong><br>\nRetrieve the connection string from the <strong>Connect<\/strong> tab. Then, configure the following environment variables:<\/p>\n<ul>\n<li><code>CB_CONN_STR<\/code>: Couchbase Cluster Connection String<\/li>\n<li><code>CB_USERNAME<\/code>: Username of the created user<\/li>\n<li><code>CB_PASSWORD<\/code>: Password of the created user<\/li>\n<li><code>OPENAI_API_KEY<\/code>: OpenAI API Key (required for agents)<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>import os\n# Environment Variables\nos.environ[&quot;CB_CONN_STR&quot;] = &quot;&lt;&lt;CONNECTION_STRING_TO_YOUR_CLUSTER&gt;&gt;&quot;\nos.environ[&quot;CB_USERNAME&quot;] = &quot;&lt;&lt;CLUSTER_ACCESS_USERNAME&gt;&gt;&quot;\nos.environ[&quot;CB_PASSWORD&quot;] = &quot;&lt;&lt;CLUSTER_ACCESS_PASSWORD&gt;&gt;&quot;\nos.environ[&quot;OPENAI_API_KEY&quot;] = &quot;&lt;&lt;OPENAI_API_KEY&gt;&gt;&quot;\n\n# you can chge the ones below, but then  you will have to change these in the vector search index created in the couchbase cluster as well. \nos.environ[&quot;CB_BUCKET&quot;] = &quot;sample_bucket&quot;\nos.environ[&quot;CB_SCOPE&quot;] = &quot;sample_scope&quot;\nos.environ[&quot;CB_COLLECTION&quot;] = &quot;sample_collection&quot;\nos.environ[&quot;CB_INDEX_NAME&quot;] = &quot;vector_index&quot;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Voila! Your cluster is now ready to be used.<\/strong><\/p>\n\n\n\n<h3 id=\"h-initializing-agents\" class=\"wp-block-heading\">Initializing Agents<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We start by initializing the <code>AssistantAgent<\/code> and <code>RetrieveUserProxyAgent<\/code>. The system message needs to be set to &#8220;You are a helpful assistant.&#8221; for AssistantAgent. The detailed instructions are given in the user message. Later we will use the <code>RetrieveUserProxyAgent.message_generator<\/code> to combine the instructions and a retrieval augmented generation task for an initial prompt to be sent to the LLM assistant.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>import os\nimport sys\n\nfrom autogen import AssistantAgent\n\nsys.path.append(os.path.abspath(&quot;\/workspaces\/autogen\/autogen\/agentchat\/contrib&quot;))\n\nfrom autogen.agentchat.contrib.retrieve_user_proxy_agent import RetrieveUserProxyAgent\n\n# Accepted file formats that can be stored in\n# a vector database instance\nfrom autogen.retrieve_utils import TEXT_FORMATS\n\nconfig_list = [{&quot;model&quot;: &quot;gpt-4o&quot;, &quot;api_key&quot;: os.environ[&quot;OPENAI_API_KEY&quot;], &quot;api_type&quot;: &quot;openai&quot;}]\nassert len(config_list) &gt; 0\nprint(&quot;models to use: &quot;, [config_list[i][&quot;model&quot;] for i in range(len(config_list))])\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>print(&quot;Accepted file formats for `docs_path`:&quot;)\nprint(TEXT_FORMATS)\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-understanding-codeassistantagentcode-in-autogen\" class=\"wp-block-heading\">Understanding <code>AssistantAgent<\/code> in AutoGen<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>AssistantAgent<\/code> in AutoGen is a specialized subclass of <code>ConversableAgent<\/code> designed to perform tasks using large language models (LLMs). By default, it generates code suggestions and debugging assistance but does not execute code autonomously; it relies on user intervention for code execution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Key Components of the <code>AssistantAgent<\/code> Initialization:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><strong><code>name<\/code><\/strong>: Assigns a unique identifier to the agent.<\/p>\n<\/li>\n\n\n<li>\n<p><strong><code>system_message<\/code><\/strong>: Sets the default behavior and role of the agent. In this case, it&#8217;s initialized with &#8220;You are a helpful assistant,&#8221; guiding the agent to provide assistance aligned with this directive.<\/p>\n<\/li>\n\n\n<li>\n<p><strong><code>llm_config<\/code><\/strong>: Configures the LLM&#8217;s behavior with parameters like timeout settings, caching mechanisms, and a list of model configurations (<code>config_list<\/code>).<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How <code>AssistantAgent<\/code> Operates:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once initialized, the <code>AssistantAgent<\/code> can interact with users or other agents to process tasks. It leverages the specified LLM configurations to generate responses, code snippets, or debugging advice based on the input it receives. However, it does not execute code by default, awaiting user approval or execution commands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more detailed information, refer to the official AG2 documentation on <a href=\"https:\/\/docs.ag2.ai\/docs\/api-reference\/autogen\/AssistantAgent\"><code>AssistantAgent<\/code><\/a>.<\/p>\n\n\n\n<h4 id=\"h-implementing-codeassistantagentcode-for-llmpowered-assistance\" class=\"wp-block-heading\">Implementing <code>AssistantAgent<\/code> for LLM-Powered Assistance<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The provided code snippet demonstrates the creation of an <code>AssistantAgent<\/code> instance named &#8220;assistant&#8221; using the AutoGen framework. The <code>AssistantAgent<\/code> class is designed to interact with large language models (LLMs) to solve tasks, including suggesting Python code blocks and debugging. By default, it does not execute code and expects the user to handle code execution.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><strong><code>name=\"assistant\"<\/code><\/strong>: Assigns the name &#8220;assistant&#8221; to the agent.<\/p>\n<\/li>\n\n\n<li>\n<p><strong><code>system_message=\"You are a helpful assistant.\"<\/code><\/strong>: Sets a system message that defines the assistant&#8217;s role and behavior during interactions.<\/p>\n<\/li>\n\n\n<li>\n<p><strong><code>llm_config={...}<\/code><\/strong>: Provides configuration settings for the LLM:<\/p>\n<ul>\n<li><strong><code>timeout=600<\/code><\/strong>: Specifies a timeout of 600 seconds for LLM responses.<\/li>\n<li><strong><code>cache_seed=42<\/code><\/strong>: Sets a seed value for caching mechanisms to ensure consistent results.<\/li>\n<li><strong><code>config_list=config_list<\/code><\/strong>: Includes a list of additional configurations, which can define specific LLM models or parameters to use.<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">By default, the <code>AssistantAgent<\/code> has <code>human_input_mode<\/code> set to &#8220;NEVER&#8221; and <code>code_execution_config<\/code> set to <code>False<\/code>, meaning it doesn&#8217;t execute code and doesn&#8217;t require human input during interactions.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code># 1. create an AssistantAgent instance named &quot;assistant&quot;\nassistant = AssistantAgent( # As defined above \n    name=&quot;assistant&quot;,\n    system_message=&quot;You are a helpful assistant.&quot;,\n    llm_config={ \n        &quot;timeout&quot;: 600,\n        &quot;cache_seed&quot;: 42,\n        &quot;config_list&quot;: config_list,\n    },\n)\nprint(&quot;AssistantAgent instance created, with the configurations as defined above.&quot;)\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-fetching-documentation\" class=\"wp-block-heading\">Fetching Documentation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following function recursively fetches all unique internal links from the given documentation URL within a specified time limit. This is useful for gathering documentation pages that will be used to augment the LLM&#8217;s responses.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>import requests\nfrom bs4 import BeautifulSoup\nfrom urllib.parse import urljoin, urlparse\nimport time\nimport os\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\ndef get_documentation_links(base_url, visited=None, start_time=None, time_limit=10):\n    &quot;&quot;&quot;\n    Recursively fetch all unique internal links from the given documentation URL with a time constraint.\n\n    Args:\n        base_url (str): The URL of the documentation homepage.\n        visited (set): A set to keep track of visited URLs.\n        start_time (float): The start time of execution.\n        time_limit (int): The maximum time allowed for execution in seconds.\n\n    Returns:\n        list: A list of unique internal links found in the documentation.\n    &quot;&quot;&quot;\n    if visited is None:\n        visited = set()\n    if start_time is None:\n        start_time = time.time()\n\n    # Stop recursion if time limit is exceeded\n    if time.time() - start_time &gt; time_limit:\n        return list(visited)\n\n    try:\n        response = requests.get(base_url, timeout=5)\n        response.raise_for_status()\n    except requests.RequestException as e:\n        print(f&quot;Error fetching the page: {e}&quot;)\n        return list(visited)\n\n    soup = BeautifulSoup(response.text, &quot;html.parser&quot;)\n    domain = urlparse(base_url).netloc\n\n    links = set()\n    for a_tag in soup.find_all(&quot;a&quot;, href=True):\n        href = a_tag[&quot;href&quot;].strip()\n        full_url = urljoin(base_url, href)\n        parsed_url = urlparse(full_url)\n\n        if parsed_url.netloc == domain and full_url not in visited:  # Ensure it&#039;s an internal link within the same domain\n            visited.add(full_url)\n            links.add(full_url)\n            links.update(get_documentation_links(full_url, visited, start_time, time_limit))  # Recursive call with time check\n\n    return list(visited)\n\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>def fetch_content_generators(links, num_workers=5):\n    &quot;&quot;&quot;\n    Splits the links into separate lists for each worker and returns generators for each worker.\n    Extracts only plain text from HTML before yielding.\n\n    Args:\n        links (list): List of URLs to fetch content from.\n        num_workers (int): Number of workers, each receiving a distinct set of links.\n\n    Returns:\n        list: A list of generators, one for each worker.\n    &quot;&quot;&quot;\n    def fetch_content(sub_links):\n        for link in sub_links:\n            try:\n                response = requests.get(link, timeout=5)\n                response.raise_for_status()\n\n                # Extract plain text from HTML\n                soup = BeautifulSoup(response.text, &quot;html.parser&quot;)\n                text_content = soup.get_text()\n\n                yield link, text_content\n            except requests.RequestException as e:\n                print(f&quot;Error fetching {link}: {e}&quot;)\n                yield link, None\n\n    # Split links into chunks for each worker\n    chunk_size = (len(links) + num_workers - 1) \/\/ num_workers  # Ensure even distribution\n    link_chunks = [links[i:i + chunk_size] for i in range(0, len(links), chunk_size)]\n\n    return [fetch_content(chunk) for chunk in link_chunks]\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>def save_content_to_files(links, output_folder=&quot;docs_data&quot;, num_workers=5):\n    &quot;&quot;&quot;\n    Uses fetch_content_generators to fetch content in parallel and save it to local files.\n\n    Args:\n        links (list): List of URLs to fetch content from.\n        output_folder (str): Folder to store the saved text files.\n        num_workers (int): Number of workers for parallel processing.\n\n    Returns:\n        list: A list of file paths where content is saved.\n    &quot;&quot;&quot;\n    os.makedirs(output_folder, exist_ok=True)\n    generators = fetch_content_generators(links, num_workers=num_workers)\n\n    file_paths = []\n\n    def process_and_save(gen, worker_id):\n        local_paths = []\n        for j, (url, content) in enumerate(gen):\n            if content:  # Avoid saving empty or failed fetches\n                file_name = f&quot;doc_{worker_id}_{j}.txt&quot;\n                file_path = os.path.join(output_folder, file_name)\n                with open(file_path, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f:\n                    f.write(content)\n                local_paths.append(file_path)\n        return local_paths\n\n    with ThreadPoolExecutor(max_workers=num_workers) as executor:\n        futures = {executor.submit(process_and_save, gen, i): i for i, gen in enumerate(generators)}\n        for future in as_completed(futures):\n            file_paths.extend(future.result())\n\n    return file_paths\n<\/code><\/pre>\n\n\n\n<h4 id=\"h--input-documentation-link-here\" class=\"wp-block-heading\">\ud83d\udccc Input Documentation Link Here<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Please enter the link to the documentation below.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>default_link = &quot;https:\/\/docs.ag2.ai\/docs\/use-cases\/notebooks\/Notebooks&quot;\nmain_doc_link = input(f&quot;Enter documentation link: &quot;) or default_link\nprint(&quot;Selected link:&quot;, main_doc_link)\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>docs_links = get_documentation_links(main_doc_link, None, None, 5)\ndocs_file_paths = save_content_to_files(docs_links, &quot;.\/docs&quot;, 12)\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>len(docs_file_paths), len(docs_links)\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>(454, 454)\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-using-retrievechat\" class=\"wp-block-heading\">Using RetrieveChat<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>RetrieveUserProxyAgent<\/code> in AutoGen is a specialized agent designed to facilitate retrieval-augmented generation (RAG) by leveraging external knowledge sources, typically a vector database. It acts as an intermediary between the user and an AI assistant, ensuring that relevant context is retrieved and supplied to the assistant for more informed responses.<\/p>\n\n\n\n<h4 id=\"h-stronghow-retrieveuserproxyagent-worksstrong\" class=\"wp-block-heading\"><strong>How RetrieveUserProxyAgent Works<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\n<p><strong>Query Processing &amp; Context Retrieval<\/strong><br>\nWhen the user submits a question, the <code>RetrieveUserProxyAgent<\/code> first determines if the available context is sufficient. If not, it retrieves additional relevant information from an external knowledge base (e.g., a vector database) using similarity search.<\/p>\n<\/li>\n\n\n<li>\n<p><strong>Interaction with the Assistant<\/strong><br>\nOnce the relevant context is retrieved, the agent forwards both the user&#8217;s query and the retrieved context to the <code>AssistantAgent<\/code> (such as an OpenAI-based model). This step ensures that the assistant generates an informed and contextually accurate response.<\/p>\n<\/li>\n\n\n<li>\n<p><strong>Handling Responses<\/strong><\/p>\n<ul>\n<li>If the assistant&#8217;s response satisfies the user, the conversation ends.<\/li>\n<li>If the response is unsatisfactory or additional context is needed, the agent updates the context and repeats the retrieval process.<\/li>\n<\/ul>\n<\/li>\n\n\n<li>\n<p><strong>User Feedback &amp; Iteration<\/strong><\/p>\n<ul>\n<li>The user can provide feedback, request refinements, or terminate the interaction.<\/li>\n<li>If updates are needed, the agent refines the context and interacts with the assistant again.<\/li>\n<\/ul>\n<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"https:\/\/microsoft.github.io\/autogen\/0.2\/assets\/images\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png\" alt=\"Retrival-Augmented Assistant\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Source: <a href=\"https:\/\/microsoft.github.io\/autogen\/0.2\/blog\/2023\/10\/18\/RetrieveChat\/\">Retrieval-Augmented Generation (RAG) Applications with AutoGen<\/a><\/p>\n\n\n\n<h4 id=\"h-strongconfiguring-coderetrieveuserproxyagentcode-with-custom-text-splitting-and-openai-embeddings-for-ragstrong\" class=\"wp-block-heading\"><strong>Configuring <code>RetrieveUserProxyAgent<\/code> with Custom Text Splitting and OpenAI Embeddings for RAG<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This code snippet demonstrates how to configure a <code>RetrieveUserProxyAgent<\/code> in AutoGen with a custom text splitter and an OpenAI-based embedding function for retrieval-augmented generation (RAG). It utilizes <code>RecursiveCharacterTextSplitter<\/code> to break documents into structured chunks for better embedding and retrieval.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The embedding function is set up using OpenAI&#8217;s <code>text-embedding-3-small<\/code> model, but users can alternatively use the default <strong>SentenceTransformers<\/strong> embedding model. The <code>RetrieveUserProxyAgent<\/code> is then initialized with a predefined task, auto-reply constraints, and a document retrieval path, enabling it to fetch relevant context dynamically and generate accurate responses in an automated workflow.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>from chromadb.utils import embedding_functions\nfrom langchain.text_splitter import RecursiveCharacterTextSplitter\n\n# Initialize a recursive character text splitter with specified separators\nrecur_spliter = RecursiveCharacterTextSplitter(separators=[&quot;n&quot;, &quot;r&quot;, &quot;t&quot;])\n\n# Option 1: Using OpenAI Embeddings\nopenai_ef = embedding_functions.OpenAIEmbeddingFunction(\n    api_key=os.environ[&quot;OPENAI_API_KEY&quot;],\n    model_name=&quot;text-embedding-3-small&quot;,\n)\n\nragproxyagent = RetrieveUserProxyAgent(\n    name=&quot;ragproxyagent&quot;,\n    human_input_mode=&quot;NEVER&quot;,\n    max_consecutive_auto_reply=2,\n    retrieve_config={\n        &quot;task&quot;: &quot;code&quot;,\n        &quot;docs_path&quot;: docs_file_paths,\n        &quot;chunk_token_size&quot;: 1200,  # Defines chunk size for document splitting\n        &quot;model&quot;: config_list[0][&quot;model&quot;],\n        &quot;vector_db&quot;: &quot;couchbase&quot;,  # Using Couchbase Capella VectorDB\n        &quot;collection_name&quot;: os.environ[&quot;CB_COLLECTION&quot;] ,  # Collection name in Couchbase\n        &quot;db_config&quot;: {\n            &quot;connection_string&quot;: os.environ[&quot;CB_CONN_STR&quot;],  # Connection string for Couchbase\n            &quot;username&quot;: os.environ[&quot;CB_USERNAME&quot;],  # Couchbase username\n            &quot;password&quot;: os.environ[&quot;CB_PASSWORD&quot;],  # Couchbase password\n            &quot;bucket_name&quot;: os.environ[&quot;CB_BUCKET&quot;],  # Bucket name in Couchbase\n            &quot;scope_name&quot;: os.environ[&quot;CB_SCOPE&quot;],  # Scope name in Couchbase\n            &quot;index_name&quot;: os.environ[&quot;CB_INDEX_NAME&quot;],  # Index name in Couchbase\n        },\n        &quot;get_or_create&quot;: True,  # Set to False to avoid reusing an existing collection\n        &quot;overwrite&quot;: False,  # Set to True to overwrite an existing collection (forces index recreation)\n\n        # Option 1: Use OpenAI embedding function (Uncomment below to enable)\n        # &quot;embedding_function&quot;: openai_ef,\n\n        # Option 2: Default embedding model (SentenceTransformers &#039;all-mpnet-base-v2&#039;)\n        &quot;embedding_model&quot;: &quot;all-mpnet-base-v2&quot;,  # Default model if OpenAI embeddings are not used\n\n        # Custom text splitter function\n        &quot;custom_text_split_function&quot;: recur_spliter.split_text,\n    },\n    code_execution_config=False,  # Set to True if you want to execute retrieved code\n)\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-chat-interaction\" class=\"wp-block-heading\">Chat Interaction<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This section marks the beginning of the chat interaction using RetrieveChat powered by Couchbase Capella for Retrieve Augmented Code Generation and Question Answering in AG2.<\/p>\n\n\n\n<h4 id=\"h-example-1\" class=\"wp-block-heading\">Example 1<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Use RetrieveChat to help generate sample code and automatically run the code and fix errors if there is any.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Problem: How to use RetrieveChat Powered by Couchbase Capella for Retrieve Augmented Code Generation and Question Answering in AG2?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note: You may need to create an index on the cluster to query<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>assistant.reset()\ncode_problem = &quot;How to use RetrieveChat Powered by Couchbase Capella for Retrieve Augmented Code Generation and Question Answering in AG2?&quot;\nchat_result = ragproxyagent.initiate_chat(assistant, message=ragproxyagent.message_generator, problem=code_problem)\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Expected Output<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The notebook which explains how to use Couchbase with AG2 contains this code snippet. And so, the RAG Agent should return some code snippet similiar to this.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>ragproxyagent = RetrieveUserProxyAgent(\n    name=&quot;ragproxyagent&quot;,\n    human_input_mode=&quot;NEVER&quot;,\n    max_consecutive_auto_reply=3,\n    retrieve_config={\n        &quot;task&quot;: &quot;code&quot;,\n        &quot;docs_path&quot;: [\n            &quot;https:\/\/raw.githubusercontent.com\/microsoft\/FLAML\/main\/website\/docs\/Examples\/Integrate%20-%20Spark.md&quot;,\n            &quot;https:\/\/raw.githubusercontent.com\/microsoft\/FLAML\/main\/website\/docs\/Research.md&quot;,\n        ],\n        &quot;chunk_token_size&quot;: 2000,\n        &quot;model&quot;: config_list[0][&quot;model&quot;],\n        &quot;vector_db&quot;: &quot;couchbase&quot;,  # Couchbase Capella VectorDB\n        &quot;collection_name&quot;: &quot;demo_collection&quot;,  # Couchbase Capella collection name to be utilized\/created\n        &quot;db_config&quot;: {\n            &quot;connection_string&quot;: os.environ[&quot;CB_CONN_STR&quot;],  # Couchbase Capella connection string\n            &quot;username&quot;: os.environ[&quot;CB_USERNAME&quot;],  # Couchbase Capella username\n            &quot;password&quot;: os.environ[&quot;CB_PASSWORD&quot;],  # Couchbase Capella password\n            &quot;bucket_name&quot;: &quot;test_db&quot;,  # Couchbase Capella bucket name\n            &quot;scope_name&quot;: &quot;test_scope&quot;,  # Couchbase Capella scope name\n            &quot;index_name&quot;: &quot;vector_index&quot;,  # Couchbase Capella index name to be created\n        },\n        &quot;get_or_create&quot;: True,  # set to False if you don&#039;t want to reuse an existing collection\n        &quot;overwrite&quot;: False,  # set to True if you want to overwrite an existing collection, each overwrite will force a index creation and reupload of documents\n    },\n    code_execution_config=False,  # set to False if you don&#039;t want to execute the code\n)\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>View Source This tutorial will show you how we&#8217;ve made building Retrieval-Augmented Generation (RAG) applications much easier with Couchbase and AG2. By leveraging Couchbase&#8217;s Search vector index for storing and retrieving document embeddings, along with AG2&#8217;s powerful AI capabilities, our integration simplifies the entire process. As part of this tutorial, we&#8217;ll also build a demo [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[606],"tutorial-tags":[618,607,617,616],"tutorial-technologies":[613],"tutorial-types":[555],"class_list":["post-10285","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-python","tutorial-tags-ag2","tutorial-tags-artificial-intelligence","tutorial-tags-autogen","tutorial-tags-fts","tutorial-technologies-vector-search","tutorial-types-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Build an Agentic RAG Application with Couchbase and AG2 - Couchbase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build an Agentic RAG Application with Couchbase and AG2\" \/>\n<meta property=\"og:description\" content=\"View Source This tutorial will show you how we&#8217;ve made building Retrieval-Augmented Generation (RAG) applications much easier with Couchbase and AG2. By leveraging Couchbase&#8217;s Search vector index for storing and retrieving document embeddings, along with AG2&#8217;s powerful AI capabilities, our integration simplifies the entire process. As part of this tutorial, we&#8217;ll also build a demo [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/microsoft.github.io\/autogen\/0.2\/assets\/images\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"16 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/couchbase-ag2-rag\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/couchbase-ag2-rag\\\/\",\"name\":\"Build an Agentic RAG Application with Couchbase and AG2 - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/couchbase-ag2-rag\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/couchbase-ag2-rag\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/microsoft.github.io\\\/autogen\\\/0.2\\\/assets\\\/images\\\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png\",\"datePublished\":\"2025-12-09T10:13:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/couchbase-ag2-rag\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/couchbase-ag2-rag\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/couchbase-ag2-rag\\\/#primaryimage\",\"url\":\"https:\\\/\\\/microsoft.github.io\\\/autogen\\\/0.2\\\/assets\\\/images\\\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png\",\"contentUrl\":\"https:\\\/\\\/microsoft.github.io\\\/autogen\\\/0.2\\\/assets\\\/images\\\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/couchbase-ag2-rag\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build an Agentic RAG Application with Couchbase and AG2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Build an Agentic RAG Application with Couchbase and AG2 - Couchbase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/","og_locale":"it_IT","og_type":"article","og_title":"Build an Agentic RAG Application with Couchbase and AG2","og_description":"View Source This tutorial will show you how we&#8217;ve made building Retrieval-Augmented Generation (RAG) applications much easier with Couchbase and AG2. By leveraging Couchbase&#8217;s Search vector index for storing and retrieving document embeddings, along with AG2&#8217;s powerful AI capabilities, our integration simplifies the entire process. As part of this tutorial, we&#8217;ll also build a demo [&hellip;]","og_url":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"url":"https:\/\/microsoft.github.io\/autogen\/0.2\/assets\/images\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"16 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/","url":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/","name":"Build an Agentic RAG Application with Couchbase and AG2 - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/it\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/#primaryimage"},"thumbnailUrl":"https:\/\/microsoft.github.io\/autogen\/0.2\/assets\/images\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png","datePublished":"2025-12-09T10:13:28+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/#primaryimage","url":"https:\/\/microsoft.github.io\/autogen\/0.2\/assets\/images\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png","contentUrl":"https:\/\/microsoft.github.io\/autogen\/0.2\/assets\/images\/retrievechat-arch-959e180405c99ceb3da88a441c02f45e.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/couchbase-ag2-rag\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Build an Agentic RAG Application with Couchbase and AG2"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/it\/#website","url":"https:\/\/www.couchbase.com\/it\/","name":"Couchbase","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/it\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/it\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/it\/#organization","name":"Couchbase","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/it\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.couchbase.com\/it\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/it\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase \u00e8 una societ\u00e0 di software per database con sede a San Jose, in California, che fornisce una piattaforma operativa per i dati utilizzata da centinaia di aziende globali.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10285\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/media?parent=10285"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-languages?post=10285"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-tags?post=10285"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-technologies?post=10285"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-types?post=10285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}