{"id":63235,"date":"2025-01-02T13:37:39","date_gmt":"2025-01-02T13:37:39","guid":{"rendered":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/"},"modified":"2025-01-02T13:38:44","modified_gmt":"2025-01-02T13:38:44","slug":"introduction-to-vector-databases-and-how-to-use-ai-for-seo","status":"publish","type":"post","link":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/","title":{"rendered":"Introduction To Vector Databases And How To Use AI For SEO"},"content":{"rendered":"<p> <a href=\"https:\/\/go.fiverr.com\/visit\/?bta=1052423&nci=17043\" Target=\"_Top\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/fiverr.ck-cdn.com\/tn\/serve\/?cid=40081059\"  width=\"601\" height=\"201\"><\/a>\n<\/p>\n<div id=\"narrow-cont\">\n<p>A vector database is a set of knowledge the place every bit of knowledge is saved as a (numerical) vector. A vector represents an object or entity, resembling a picture, particular person, place and so forth. within the summary N-dimensional area.<\/p>\n<p>Vectors, as defined within the <a href=\"https:\/\/www.searchenginejournal.com\/llm-embeddings-seo\/518297\/\">previous chapter<\/a>, are essential for figuring out how entities are associated and can be utilized to search out their semantic similarity. This may be utilized in a number of methods for search engine marketing \u2013 resembling grouping related key phrases or content material (utilizing <a href=\"https:\/\/realpython.com\/knn-python\/\" target=\"_blank\" rel=\"noopener\">kNN<\/a>).<\/p>\n<p>On this article, we&#8217;re going to study a number of methods to use AI to search engine marketing, together with discovering semantically related content material for inner linking. This might help you refine your content material technique in an period the place serps more and more <a href=\"https:\/\/www.searchenginejournal.com\/are-llms-and-search-engines-the-same\/500057\/\">rely on LLMs<\/a>.<\/p>\n<p>You can too learn a earlier article on this sequence about the best way to discover <a href=\"https:\/\/www.searchenginejournal.com\/find-keyword-cannibalization-using-openai-text-embeddings-examples\/520274\/\">keyword cannibalization using OpenAI\u2019s text embeddings<\/a>.<\/p>\n<p>Let\u2019s dive in right here to start out constructing the premise of our software.<\/p>\n<h2 id=\"understandi\">Understanding Vector Databases<\/h2>\n<p>When you&#8217;ve got hundreds of articles and wish to discover the closest semantic similarity to your goal question, you possibly can\u2019t create vector embeddings for all of them on the fly to check, as it&#8217;s extremely inefficient.<\/p>\n<p>For that to occur, we would want to generate vector embeddings solely as soon as and hold them in a database we are able to question and discover the closest match article.<\/p>\n<p>And that&#8217;s what vector databases do: They&#8217;re particular varieties of databases that retailer embeddings (vectors).<\/p>\n<p>Whenever you question the database, in contrast to conventional databases, they carry out <a href=\"https:\/\/www.searchenginejournal.com\/llm-embeddings-seo\/518297\/#:~:text=What%20Is%20The%20Cosine%20Similarity%3F\">cosine similarity match<\/a> and return vectors (on this case articles) closest to a different vector (on this case a key phrase phrase) being queried.<\/p>\n<p><span id=\"records\">Here&#8217;s what it appears to be like like<\/span>:<\/p>\n<div id=\"attachment_534297\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/create-vector-database-875.png\" alt=\"Text embedding record example in the vector database.\" width=\"720\" height=\"342\" class=\"wp-image-534297 \" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/create-vector-database-875.png 1920w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/create-vector-database-875-480x228.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/create-vector-database-875-680x323.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/create-vector-database-875-384x182.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/create-vector-database-875-768x365.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/create-vector-database-875-1024x486.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/create-vector-database-875-1600x760.png 1600w\" data-sizes=\"auto, (max-width: 720px) 100vw, 720px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Textual content embedding document instance within the vector database.<\/span><\/div>\n<p>Within the vector\u00a0database, you possibly can see vectors alongside metadata saved, which we are able to\u00a0<a href=\"https:\/\/docs.pinecone.io\/guides\/get-started\/quickstart\" target=\"_blank\" rel=\"noopener\">easily query<\/a> utilizing a programming language of our selection.<\/p>\n<p>On this article, we will likely be utilizing\u00a0<a href=\"https:\/\/www.pinecone.io\/\" target=\"_blank\" rel=\"noopener\">Pinecone<\/a>\u00a0because of its ease of understanding and ease of use, however there are different suppliers resembling\u00a0<a href=\"https:\/\/docs.trychroma.com\/\" target=\"_blank\" rel=\"noopener\">Chroma<\/a>,\u00a0<a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/vector-search\" target=\"_blank\" rel=\"noopener\">BigQuery<\/a>, or\u00a0<a href=\"https:\/\/qdrant.tech\/\" target=\"_blank\" rel=\"noopener\">Qdrant<\/a>\u00a0you might wish to try.<\/p>\n<p>Let\u2019s dive in.<\/p>\n<nav role=\"navigation\" class=\"sej-tcont white_toc\" id=\"table-content\">\n<ol class=\"indexlist\">\n<li class=\"\"><span class=\"index_ico\">1. <\/span><a class=\"index_a\" id=\"understandi-ah\" href=\"#understandi\">Understanding Vector Databases<\/a><\/li>\n<li class=\"\"><span class=\"index_ico\">2. <\/span><a class=\"index_a\" id=\"createavect-ah\" href=\"#createavect\">Create A Vector Database<\/a><\/li>\n<li class=\"\"><span class=\"index_ico\">3. <\/span><a class=\"index_a\" id=\"exportyoura-ah\" href=\"#exportyoura\">Export Your Articles From Your CMS<\/a><\/li>\n<li class=\"\"><span class=\"index_ico\">4. <\/span><a class=\"index_a\" id=\"insertingop-ah\" href=\"#insertingop\">Inserting OpenAi&#8217;s Text Embeddings Into The Vector Database<\/a><\/li>\n<li class=\"\"><span class=\"index_ico\">5. <\/span><a class=\"index_a\" id=\"findinganar-ah\" href=\"#findinganar\">Finding An Article Match For A Keyword<\/a><\/li>\n<li class=\"\"><span class=\"index_ico\">6. <\/span><a class=\"index_a\" id=\"insertinggo-ah\" href=\"#insertinggo\">Inserting Google Vertex AI Text Embeddings Into The Vector Database<\/a><\/li>\n<li class=\"hidden-tbl\"><span class=\"index_ico\">7. <\/span><a class=\"index_a\" id=\"findinganar-ah\" href=\"#findinganar\">Finding An Article Match For A Keyword Using Google Vertex AI<\/a><\/li>\n<li class=\"hidden-tbl\"><span class=\"index_ico\">8. <\/span><a class=\"index_a\" id=\"trytestingt-ah\" href=\"#trytestingt\">Try Testing The Relevance Of Your Article Writing<\/a><\/li>\n<\/ol>\n<p><span class=\"sej-tblcont-more\">            <span style=\"\" class=\"svg-icon\"><br \/>\n                <svg role=\"img\">\n                    <use xlink:href=\"http:\/\/www.searchenginejournal.com\/icons.svg?ver=141#arrow-down\"\/>\n                <\/svg><br \/>\n            <\/span><\/p>\n<p>    <\/span><\/nav>\n<h2 id=\"createavect\">1. Create A Vector Database<\/h2>\n<p>First, register an account at Pinecone and create an index with a configuration of \u201ctext-embedding-ada-002\u201d with \u2018cosine\u2019 as a metric to measure vector distance. You possibly can title the index something, we are going to title it<span><code>article-index-all-ada<\/code><\/span>\u2018.<\/p>\n<div id=\"attachment_534000\" style=\"width: 612px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-record-example-302.png\" alt=\"Creating a vector database \" width=\"602\" height=\"286\" class=\"wp-image-534000\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-record-example-302.png 1920w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-record-example-302-480x228.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-record-example-302-680x323.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-record-example-302-384x182.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-record-example-302-768x365.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-record-example-302-1024x486.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-record-example-302-1600x760.png 1600w\" data-sizes=\"auto, (max-width: 602px) 100vw, 602px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Making a vector database.<\/span><\/div>\n<p>This helper UI is just for helping you throughout the setup, in case you wish to retailer Vertex AI vector embedding it&#8217;s essential to set \u2018dimensions\u2019 to <a href=\"https:\/\/cloud.google.com\/vertex-ai\/generative-ai\/docs\/embeddings\/get-text-embeddings#get_text_embeddings_for_a_snippet_of_text\" target=\"_blank\" rel=\"noopener\">768<\/a> within the config display manually to match default dimensionality and you&#8217;ll retailer Vertex AI textual content vectors (you possibly can set dimension worth something from <a href=\"https:\/\/cloud.google.com\/vertex-ai\/generative-ai\/docs\/embeddings\/get-text-embeddings#:~:text=output%20dimensionality%20between-,1%20and%20768,-.%20By%20selecting%20a\" target=\"_blank\" rel=\"noopener\">1 to 768<\/a> to avoid wasting reminiscence).<\/p>\n<p>On this article we are going to discover ways to use OpenAi\u2019s \u2018text-embedding-ada-002\u2019 and <a href=\"#vertex\">Google\u2019s Vertex AI<\/a> \u2018text-embedding-005\u2019 fashions.<\/p>\n<p>As soon as created, we want an API key to have the ability to connect with the database utilizing a bunch URL of the vector database.<\/p>\n<div id=\"gallery-1\" class=\"gallery galleryid-533993 gallery-columns-3 gallery-size-full\">\n<figure class=\"gallery-item\">\n<div class=\"gallery-icon landscape\">\n\t\t\t\t<a href=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45.png\" target=\"_blank\"><img decoding=\"async\" width=\"1920\" height=\"912\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45.png\" class=\"attachment-full size-full\" alt=\"Generate an API key\" aria-describedby=\"gallery-1-534001\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45.png 1920w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45-480x228.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45-680x323.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45-384x182.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45-768x365.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45-1024x486.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-api-key-45-1600x760.png 1600w\" data-sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" loading=\"lazy\"\/><\/a>\n\t\t\t<\/div><figcaption class=\"wp-caption-text gallery-caption\" id=\"gallery-1-534001\">\n\t\t\t\tGenerate an API key<br \/>\n\t\t\t\t<\/figcaption><\/figure>\n<figure class=\"gallery-item\">\n<div class=\"gallery-icon landscape\">\n\t\t\t\t<a href=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98.png\" target=\"_blank\"><img decoding=\"async\" width=\"1920\" height=\"912\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98.png\" class=\"attachment-full size-full\" alt=\"Host URL of vector database\" aria-describedby=\"gallery-1-534003\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98.png 1920w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98-480x228.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98-680x323.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98-384x182.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98-768x365.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98-1024x486.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/11\/vector-database-host-98-1600x760.png 1600w\" data-sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" loading=\"lazy\"\/><\/a>\n\t\t\t<\/div><figcaption class=\"wp-caption-text gallery-caption\" id=\"gallery-1-534003\">\n\t\t\t\tHost URL of vector database<br \/>\n\t\t\t\t<\/figcaption><\/figure>\n<\/p><\/div>\n<p>Subsequent, you will have to make use of <a href=\"https:\/\/jupyter.org\/install\" target=\"_blank\" rel=\"noopener\">Jupyter Notebook<\/a>. In case you don\u2019t have it put in, observe <a href=\"https:\/\/www.searchenginejournal.com\/find-keyword-cannibalization-using-openai-text-embeddings-examples\/520274\/#:~:text=ADVERTISEMENT-,In%20a%20nutshell%3A,-Download%20and%20install\">this guide<\/a> to put in it and run this command (under) afterward in your PC\u2019s terminal to put in all crucial packages.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>pip set up openai google-cloud-aiplatform google-auth pandas pinecone-client tabulate ipython numpy<\/code><\/pre>\n<\/div>\n<p>And bear in mind ChatGPT could be very helpful whenever you encounter points throughout coding!<\/p>\n<h2 id=\"exportyoura\">2. Export Your Articles From Your CMS<\/h2>\n<p>Subsequent, we have to put together a CSV export file of articles out of your CMS. In case you use WordPress, you should utilize a plugin to do <a href=\"https:\/\/wordpress.org\/plugins\/wp-import-export-lite\/\" target=\"_blank\" rel=\"noopener\">customized exports<\/a>.<\/p>\n<p>As our final objective is to construct an inner linking software, we have to resolve which knowledge needs to be pushed to the vector database as metadata. Primarily, metadata-based filtering acts as a further layer of retrieval steering, aligning it with the final <a href=\"https:\/\/www.searchenginejournal.com\/unlocking-the-power-of-llm-knowledge-graph-introduction\/518343\/\">RAG framework<\/a> by incorporating exterior data, which can assist to enhance retrieval high quality.<\/p>\n<p>For example, if we&#8217;re modifying an article on \u201cPPC\u201d and wish to insert a hyperlink to the phrase \u201cKey phrase Analysis,\u201d we are able to specify in our software that \u201cClass=PPC.\u201d It will enable the software to question solely articles throughout the \u201cPPC\u201d class, guaranteeing correct and contextually related linking, or we might wish to hyperlink to the phrase \u201cmost up-to-date google replace\u201d and restrict the match solely to information articles by utilizing \u2018Sort\u2019 and revealed this yr.<\/p>\n<p>In our case, we will likely be exporting:<\/p>\n<ul>\n<li>Title.<\/li>\n<li><spangoogle sans=\"\" arial=\"\" font-weight:normal=\"\" font-style:normal=\"\" color:=\"\" data-sheets-root=\"1\">Class.<\/spangoogle><\/li>\n<li>Sort.<\/li>\n<li>Publish Date.<\/li>\n<li>Publish 12 months.<\/li>\n<li>Permalink.<\/li>\n<li>Meta Description.<\/li>\n<li>Content material.<\/li>\n<\/ul>\n<p>To assist return the very best outcomes, we might concatenate the title and meta descriptions fields as they&#8217;re the very best illustration of the article that we are able to vectorize and preferrred for embedding and inner linking functions.<\/p>\n<p>Utilizing the total article content material for embeddings might scale back precision and dilute the relevance of the vectors.<\/p>\n<p>This occurs as a result of a single giant embedding tries to characterize a number of matters coated within the article directly, resulting in a much less targeted and related illustration. Chunking <a href=\"https:\/\/www.pinecone.io\/learn\/chunking-strategies\/\" target=\"_blank\" rel=\"noopener\">strategies<\/a> (splitting the article by pure headings or semantically significant segments) must be utilized, however these aren&#8217;t the main target of this text.<\/p>\n<p>Right here\u2019s the <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/126o9sinxvAMRtgwAO7H-l7jcEtb0UqP8bPNg-C4sXO8\/edit?usp=sharing\" target=\"_blank\" rel=\"noopener\">sample export file<\/a> you possibly can obtain and use for our code pattern under.<\/p>\n<h2 id=\"insertingop\">2. Inserting OpenAi\u2019s Textual content Embeddings Into The Vector Database<\/h2>\n<p>Assuming you have already got an <a href=\"https:\/\/www.searchenginejournal.com\/find-keyword-cannibalization-using-openai-text-embeddings-examples\/520274\/\">OpenAI API key<\/a>, this code will generate vector embeddings from the textual content and insert them into the vector database in Pinecone.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>import pandas as pd&#13;\nfrom openai import OpenAI&#13;\nfrom pinecone import Pinecone&#13;\nfrom IPython.show import clear_output&#13;\n&#13;\n# Setup your OpenAI and Pinecone API keys&#13;\nopenai_client = OpenAI(api_key='YOUR_OPENAI_API_KEY')  # Instantiate OpenAI consumer&#13;\npinecone = Pinecone(api_key='YOUR_PINECON_API_KEY')&#13;\n&#13;\n# Connect with an present Pinecone index&#13;\nindex_name = \"article-index-all-ada\"&#13;\nindex = pinecone.Index(index_name)&#13;\n&#13;\ndef generate_embeddings(textual content):&#13;\n    \"\"\"&#13;\n    Generates an embedding for the given textual content utilizing OpenAI's API.&#13;\n    Returns None if textual content is invalid or an error happens.&#13;\n    \"\"\"&#13;\n    strive:&#13;\n        if not textual content or not isinstance(textual content, str):&#13;\n            increase ValueError(\"Enter textual content should be a non-empty string.\")&#13;\n&#13;\n        consequence = openai_client.embeddings.create(&#13;\n            enter=textual content,&#13;\n            mannequin=\"text-embedding-ada-002\"&#13;\n        )&#13;\n&#13;\n        clear_output(wait=True)  # Clear output for a contemporary show&#13;\n&#13;\n        if hasattr(consequence, 'knowledge') and len(consequence.knowledge) &gt; 0:&#13;\n            print(\"API Response:\", consequence)&#13;\n            return consequence.knowledge[0].embedding&#13;\n        else:&#13;\n            increase ValueError(\"Invalid response from the OpenAI API. No knowledge returned.\")&#13;\n&#13;\n    besides ValueError as ve:&#13;\n        print(f\"ValueError: {ve}\")&#13;\n        return None&#13;\n    besides Exception as e:&#13;\n        print(f\"An error occurred whereas producing embeddings: {e}\")&#13;\n        return None&#13;\n&#13;\n# Load your articles from a CSV&#13;\ndf = pd.read_csv('Pattern Export File.csv')&#13;\n&#13;\n# Course of every article&#13;\nfor idx, row in df.iterrows():&#13;\n    strive:&#13;\n        clear_output(wait=True)&#13;\n        content material = row[\"Content\"]&#13;\n        vector = generate_embeddings(content material)&#13;\n&#13;\n        if vector is None:&#13;\n            print(f\"Skipping article ID {row['ID']} because of empty or invalid embedding.\")&#13;\n            proceed&#13;\n&#13;\n        index.upsert(vectors=[&#13;\n            (&#13;\n                row['Permalink'],  # Distinctive ID&#13;\n                vector,            # The embedding&#13;\n                {&#13;\n                    'title': row['Title'],&#13;\n                    'class': row['Category'],&#13;\n                    'sort': row['Type'],&#13;\n                    'publish_date': row['Publish Date'],&#13;\n                    'publish_year': row['Publish Year']&#13;\n                }&#13;\n            )&#13;\n        ])&#13;\n    besides Exception as e:&#13;\n        clear_output(wait=True)&#13;\n        print(f\"Error processing article ID {row['ID']}: {str(e)}\")&#13;\n&#13;\nprint(\"Embeddings are efficiently saved within the vector database.\")&#13;\n<\/code><\/pre>\n<\/div>\n<p>It&#8217;s worthwhile to create a pocket book file and duplicate and paste it in there, then add the CSV file \u2018Pattern Export File.csv\u2019 in the identical folder.<\/p>\n<div id=\"attachment_534303\" style=\"width: 638px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-37.png\" alt=\"Jupyter project\" width=\"628\" height=\"304\" class=\"wp-image-534303 \" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-37.png 1809w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-37-480x232.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-37-680x329.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-37-384x186.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-37-768x371.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-37-1024x495.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-37-1600x774.png 1600w\" data-sizes=\"auto, (max-width: 628px) 100vw, 628px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Jupyter venture.<\/span><\/div>\n<p>As soon as carried out, click on on the Run button and it&#8217;ll begin pushing all textual content embedding vectors into the index <span><code>article-index-all-ada<\/code><\/span> we created in step one.<\/p>\n<div id=\"attachment_534306\" style=\"width: 612px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-run-419.png\" alt=\"Running the script\" width=\"602\" height=\"307\" class=\" wp-image-534306\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-run-419.png 1824w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-run-419-480x245.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-run-419-680x347.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-run-419-384x196.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-run-419-768x392.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-run-419-1024x523.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/jupyter-project-run-419-1600x817.png 1600w\" data-sizes=\"auto, (max-width: 602px) 100vw, 602px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Working the script.<\/span><\/div>\n<p>You will notice an output log textual content of embedding vectors. As soon as completed, it&#8217;s going to present the message on the finish that it was efficiently completed. Now go and test your index within the Pinecone and you will note your <a href=\"#records\">records are there<\/a>.<\/p>\n<h2 id=\"findinganar\">3. Discovering An Article Match For A Key phrase<\/h2>\n<p>Okay now, let\u2019s attempt to discover an article match for the Key phrase.<\/p>\n<p>Create a brand new pocket book file and duplicate and paste this code.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>from openai import OpenAI&#13;\nfrom pinecone import Pinecone&#13;\nfrom IPython.show import clear_output&#13;\nfrom tabulate import tabulate  # Import tabulate for desk formatting&#13;\n&#13;\n# Setup your OpenAI and Pinecone API keys&#13;\nopenai_client = OpenAI(api_key='YOUR_OPENAI_API_KEY')  # Instantiate OpenAI consumer&#13;\npinecone = Pinecone(api_key='YOUR_OPENAI_API_KEY')&#13;\n&#13;\n# Connect with an present Pinecone index&#13;\nindex_name = \"article-index-all-ada\"&#13;\nindex = pinecone.Index(index_name)&#13;\n&#13;\n&#13;\n# Perform to generate embeddings utilizing OpenAI's API&#13;\ndef generate_embeddings(textual content):&#13;\n    \"\"\"&#13;\n    Generates an embedding for a given textual content utilizing OpenAI's API.&#13;\n&#13;\n    \"\"\"&#13;\n    strive:&#13;\n        if not textual content or not isinstance(textual content, str):&#13;\n            increase ValueError(\"Enter textual content should be a non-empty string.\")&#13;\n&#13;\n        consequence = openai_client.embeddings.create(&#13;\n            enter=textual content,&#13;\n            mannequin=\"text-embedding-ada-002\"&#13;\n        )&#13;\n&#13;\n        # Debugging: Print the response to grasp its construction&#13;\n        clear_output(wait=True)&#13;\n        #print(\"API Response:\", consequence)&#13;\n&#13;\n        if hasattr(consequence, 'knowledge') and len(consequence.knowledge) &gt; 0:&#13;\n            return consequence.knowledge[0].embedding&#13;\n        else:&#13;\n            increase ValueError(\"Invalid response from the OpenAI API. No knowledge returned.\")&#13;\n&#13;\n    besides ValueError as ve:&#13;\n        print(f\"ValueError: {ve}\")&#13;\n        return None&#13;\n&#13;\n    besides Exception as e:&#13;\n        print(f\"An error occurred whereas producing embeddings: {e}\")&#13;\n        return None&#13;\n&#13;\n# Perform to question the Pinecone index with key phrases and metadata&#13;\ndef match_keywords_to_index(key phrases):&#13;\n    \"\"\"&#13;\n    Matches an inventory of key phrases to the closest article within the Pinecone index, filtering by metadata dynamically.&#13;\n    \"\"\"&#13;\n    outcomes = []&#13;\n&#13;\n    for keyword_pair in key phrases:&#13;\n        strive:&#13;\n            clear_output(wait=True)&#13;\n            # Extract the key phrase and class from the sub-array&#13;\n            key phrase = keyword_pair[0]&#13;\n            class = keyword_pair[1]&#13;\n&#13;\n            # Generate embedding for the present key phrase&#13;\n            vector = generate_embeddings(key phrase)&#13;\n            if vector is None:&#13;\n                print(f\"Skipping key phrase '{key phrase}' because of embedding error.\")&#13;\n                proceed&#13;\n&#13;\n            # Question the Pinecone index for the closest vector with metadata filter&#13;\n            query_results = index.question(&#13;\n                vector=vector,  # The embedding of the key phrase&#13;\n                top_k=1,  # Retrieve solely the closest match&#13;\n                include_metadata=True,  # Embrace metadata within the outcomes&#13;\n                filter={\"class\": class}  # Filter outcomes by metadata class dynamically&#13;\n            )&#13;\n&#13;\n            # Retailer the closest match&#13;\n            if query_results['matches']:&#13;\n                closest_match = query_results['matches'][0]&#13;\n                outcomes.append({&#13;\n                    'Key phrase': key phrase,  # The searched key phrase&#13;\n                    'Class': class,  # The class used for filtering&#13;\n                    'Match Rating': f\"{closest_match['score']:.2f}\",  # Similarity rating (formatted to 2 decimal locations)&#13;\n                    'Title': closest_match['metadata'].get('title', 'N\/A'),  # Title of the article&#13;\n                    'URL': closest_match['id']  # Utilizing 'id' because the URL&#13;\n                })&#13;\n            else:&#13;\n                outcomes.append({&#13;\n                    'Key phrase': key phrase,&#13;\n                    'Class': class,&#13;\n                    'Match Rating': 'N\/A',&#13;\n                    'Title': 'No match discovered',&#13;\n                    'URL': 'N\/A'&#13;\n                })&#13;\n&#13;\n        besides Exception as e:&#13;\n            clear_output(wait=True)&#13;\n            print(f\"Error processing key phrase '{key phrase}' with class '{class}': {e}\")&#13;\n            outcomes.append({&#13;\n                'Key phrase': key phrase,&#13;\n                'Class': class,&#13;\n                'Match Rating': 'Error',&#13;\n                'Title': 'Error occurred',&#13;\n                'URL': 'N\/A'&#13;\n            })&#13;\n&#13;\n    return outcomes&#13;\n&#13;\n# Instance utilization: Discover matches for an array of key phrases and classes&#13;\nkey phrases = [[\"SEO Tools\", \"SEO\"], [\"TikTok\", \"TikTok\"], [\"SEO Consultant\", \"SEO\"]]  # Substitute along with your key phrases and classes&#13;\nmatches = match_keywords_to_index(key phrases)&#13;\n&#13;\n# Show the leads to a desk&#13;\nprint(tabulate(matches, headers=\"keys\", tablefmt=\"fancy_grid\"))&#13;\n<\/code><\/pre>\n<\/div>\n<p>We\u2019re looking for a match for these key phrases:<\/p>\n<ul>\n<li>search engine marketing Instruments.<\/li>\n<li>TikTok.<\/li>\n<li>search engine marketing Guide.<\/li>\n<\/ul>\n<p>And that is the consequence we get after executing the code:<\/p>\n<div id=\"attachment_536256\" style=\"width: 1601px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/open-ai-ada-kw-match-output-463.png\" alt=\"Find a match for the keyword phrase from vector database\" width=\"1591\" height=\"441\" class=\"size-full wp-image-536256\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/open-ai-ada-kw-match-output-463.png 1591w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/open-ai-ada-kw-match-output-463-480x133.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/open-ai-ada-kw-match-output-463-680x188.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/open-ai-ada-kw-match-output-463-384x106.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/open-ai-ada-kw-match-output-463-768x213.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/open-ai-ada-kw-match-output-463-1024x284.png 1024w\" data-sizes=\"auto, (max-width: 1591px) 100vw, 1591px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Discover a match for the key phrase phrase from vector database<\/span><\/div>\n<p>The desk formatted output on the backside exhibits the closest article matches to our key phrases.<\/p>\n<h2 id=\"insertinggo\">4. Inserting Google Vertex AI Textual content Embeddings Into The Vector Database<\/h2>\n<p>Now let\u2019s do the identical however with <a href=\"https:\/\/cloud.google.com\/blog\/products\/ai-machine-learning\/improve-gen-ai-search-with-vertex-ai-embeddings-and-task-types\" target=\"_blank\" rel=\"noopener\">Google Vertex AI<\/a> \u2018<code>text-embedding-005<\/code>\u2019embedding. This mannequin is notable as a result of it\u2019s developed by Google, powers <a href=\"https:\/\/cloud.google.com\/enterprise-search?hl=en\" target=\"_blank\" rel=\"noopener\">Vertex AI Search<\/a>, and is particularly educated to deal with retrieval and query-matching duties, making it well-suited for our use case.<\/p>\n<p>You possibly can even construct an <a href=\"https:\/\/cloud.google.com\/generative-ai-app-builder\/docs\/add-widget\" target=\"_blank\" rel=\"noopener\">internal search widget<\/a> and add it to your web site.<\/p>\n<p>Begin by signing in to Google Cloud Console and <a href=\"https:\/\/developers.google.com\/workspace\/guides\/create-project\" target=\"_blank\" rel=\"noopener\">create a project<\/a>. Then from the <a href=\"https:\/\/console.cloud.google.com\/apis\/library\/browse\" target=\"_blank\" rel=\"noopener\">API library<\/a> discover Vertex AI API and allow it.<\/p>\n<div id=\"attachment_534509\" style=\"width: 694px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/how-to-enable-vertex-ai-in-google-cloud-832.png\" alt=\"Vertex AI API\" width=\"684\" height=\"292\" class=\"wp-image-534509\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/how-to-enable-vertex-ai-in-google-cloud-832.png 1717w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/how-to-enable-vertex-ai-in-google-cloud-832-480x205.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/how-to-enable-vertex-ai-in-google-cloud-832-680x290.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/how-to-enable-vertex-ai-in-google-cloud-832-384x164.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/how-to-enable-vertex-ai-in-google-cloud-832-768x327.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/how-to-enable-vertex-ai-in-google-cloud-832-1024x437.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/how-to-enable-vertex-ai-in-google-cloud-832-1600x682.png 1600w\" data-sizes=\"auto, (max-width: 684px) 100vw, 684px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Screenshot from Google Cloud Console, December 2024<\/span><\/div>\n<p>Arrange your billing account to have the ability to use Vertex AI as pricing is <a href=\"https:\/\/cloud.google.com\/vertex-ai\/generative-ai\/pricing#:~:text=%240.0002%20\/%201k%20characters%20input\" target=\"_blank\" rel=\"noopener\">$0.0002<\/a> per 1,000 characters (and it provides $300 credit for brand spanking new customers).<\/p>\n<p>When you set it, it&#8217;s essential to navigate to <a href=\"https:\/\/console.cloud.google.com\/apis\/credentials\" target=\"_blank\" rel=\"noopener\">API Services &gt; Credentials<\/a> create a service account, generate a key, and obtain them as JSON.<\/p>\n<div id=\"gallery-2\" class=\"gallery galleryid-533993 gallery-columns-3 gallery-size-full\">\n<figure class=\"gallery-item\">\n<div class=\"gallery-icon landscape\">\n\t\t\t\t<a href=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-919.png\" target=\"_blank\"><img decoding=\"async\" width=\"974\" height=\"526\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-919.png\" class=\"attachment-full size-full\" alt=\"Step 1: Create a Service a Account\" aria-describedby=\"gallery-2-534516\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-919.png 974w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-919-480x259.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-919-680x367.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-919-384x207.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-919-768x415.png 768w\" data-sizes=\"auto, (max-width: 974px) 100vw, 974px\" loading=\"lazy\"\/><\/a>\n\t\t\t<\/div><figcaption class=\"wp-caption-text gallery-caption\" id=\"gallery-2-534516\">\n\t\t\t\tStep 1: Create a Service a Account<br \/>\n\t\t\t\t<\/figcaption><\/figure>\n<figure class=\"gallery-item\">\n<div class=\"gallery-icon landscape\">\n\t\t\t\t<a href=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-2-308.png\" target=\"_blank\"><img decoding=\"async\" width=\"1049\" height=\"656\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-2-308.png\" class=\"attachment-full size-full\" alt=\"Step 2: Add New Key under Keys Tab of Service Account\" aria-describedby=\"gallery-2-534513\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-2-308.png 1049w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-2-308-480x300.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-2-308-680x425.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-2-308-384x240.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-2-308-768x480.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-2-308-1024x640.png 1024w\" data-sizes=\"auto, (max-width: 1049px) 100vw, 1049px\" loading=\"lazy\"\/><\/a>\n\t\t\t<\/div><figcaption class=\"wp-caption-text gallery-caption\" id=\"gallery-2-534513\">\n\t\t\t\tStep 2: Add New Key underneath Keys Tab of Service Account<br \/>\n\t\t\t\t<\/figcaption><\/figure>\n<figure class=\"gallery-item\">\n<div class=\"gallery-icon landscape\">\n\t\t\t\t<a href=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505.png\" target=\"_blank\"><img decoding=\"async\" width=\"1645\" height=\"710\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505.png\" class=\"attachment-full size-full\" alt=\"Step 3: Create a JSON key\" aria-describedby=\"gallery-2-534514\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505.png 1645w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505-480x207.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505-680x293.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505-384x166.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505-768x331.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505-1024x442.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/service-account-key-3-505-1600x691.png 1600w\" data-sizes=\"auto, (max-width: 1645px) 100vw, 1645px\" loading=\"lazy\"\/><\/a>\n\t\t\t<\/div><figcaption class=\"wp-caption-text gallery-caption\" id=\"gallery-2-534514\">\n\t\t\t\tStep 3: Create a JSON key<br \/>\n\t\t\t\t<\/figcaption><\/figure>\n<\/p><\/div>\n<p>Rename the JSON file to config.json and add it (by way of the arrow up icon) to your Jupyter Pocket book venture folder.<\/p>\n<div id=\"attachment_536250\" style=\"width: 859px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/jupyter-vertex-138.png\" alt=\"Screenshot from Google Cloud Console, December 2024\" width=\"849\" height=\"342\" class=\" wp-image-536250\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/jupyter-vertex-138.png 1839w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/jupyter-vertex-138-480x193.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/jupyter-vertex-138-680x274.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/jupyter-vertex-138-384x155.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/jupyter-vertex-138-768x309.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/jupyter-vertex-138-1024x413.png 1024w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/jupyter-vertex-138-1600x645.png 1600w\" data-sizes=\"auto, (max-width: 849px) 100vw, 849px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Screenshot from Google Cloud Console, December 2024<\/span><\/div>\n<p>Within the setup first step, create a brand new vector database known as article-index-vertex by setting dimension 768 manually.<\/p>\n<p>As soon as created you possibly can run this script to start out producing vector embeddings from the the identical pattern file utilizing Google Vertex AI <code>text-embedding-005<\/code> mannequin (you possibly can select text-multilingual-embedding-002 if in case you have non-English textual content).<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>import os&#13;\nimport sys&#13;\nimport time&#13;\nimport numpy as np&#13;\nimport pandas as pd&#13;\nfrom typing import Listing, Non-obligatory&#13;\n&#13;\nfrom google.auth import load_credentials_from_file&#13;\nfrom google.cloud import aiplatform&#13;\nfrom google.api_core.exceptions import ServiceUnavailable&#13;\n&#13;\nfrom pinecone import Pinecone&#13;\nfrom vertexai.language_models import TextEmbeddingModel, TextEmbeddingInput&#13;\n&#13;\n# Arrange your Google Cloud credentials&#13;\nos.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"] = \"config.json\"  # Substitute along with your JSON key file&#13;\ncredentials, project_id = load_credentials_from_file(os.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"])&#13;\n&#13;\n# Initialize Pinecone&#13;\npinecone = Pinecone(api_key='YOUR_PINECON_API_KEY')  # Substitute along with your Pinecone API key&#13;\nindex = pinecone.Index(\"article-index-vertex\")       # Substitute along with your Pinecone index title&#13;\n&#13;\n# Initialize Vertex AI&#13;\naiplatform.init(venture=project_id, credentials=credentials, location=\"us-central1\")&#13;\n&#13;\ndef generate_embeddings(&#13;\n    textual content: str,&#13;\n    activity: str = \"RETRIEVAL_DOCUMENT\",&#13;\n    model_id: str = \"text-embedding-005\",&#13;\n    dimensions: Non-obligatory[int] = 768&#13;\n) -&gt; Non-obligatory[List[float]]:&#13;\n    if not textual content or not textual content.strip():&#13;\n        print(\"Textual content enter is empty. Skipping.\")&#13;\n        return None&#13;\n    &#13;\n    strive:&#13;\n        mannequin = TextEmbeddingModel.from_pretrained(model_id)&#13;\n        input_data = TextEmbeddingInput(textual content, task_type=activity)&#13;\n        vectors = mannequin.get_embeddings([input_data], output_dimensionality=dimensions)&#13;\n        return vectors[0].values&#13;\n    besides ServiceUnavailable as e:&#13;\n        print(f\"Vertex AI service is unavailable: {e}\")&#13;\n        return None&#13;\n    besides Exception as e:&#13;\n        print(f\"Error producing embeddings: {e}\")&#13;\n        return None&#13;\n&#13;\n&#13;\n# Load knowledge from CSV&#13;\nknowledge = pd.read_csv(\"Pattern Export File.csv\")         # Substitute along with your CSV file path&#13;\n&#13;\nfor idx, row in knowledge.iterrows():&#13;\n    strive:&#13;\n        permalink = str(row[\"Permalink\"])&#13;\n        content material = row[\"Content\"]&#13;\n        embedding = generate_embeddings(content material)&#13;\n        &#13;\n        if not embedding:&#13;\n            print(f\"Skipping article ID {row['ID']} because of empty or failed embedding.\")&#13;\n            proceed&#13;\n        &#13;\n        print(f\"Embedding for {permalink}: {embedding[:5]}...\")&#13;\n        sys.stdout.flush()&#13;\n        &#13;\n        index.upsert(vectors=[&#13;\n            (&#13;\n                permalink,&#13;\n                embedding,&#13;\n                {&#13;\n                    'category': row['Category'],&#13;\n                    'title': row['Title'],&#13;\n                    'publish_date': row['Publish Date'],&#13;\n                    'sort': row['Type'],&#13;\n                    'publish_year': row['Publish Year']&#13;\n                }&#13;\n            )&#13;\n        ])&#13;\n        time.sleep(1)  # Non-obligatory: Sleep to keep away from price limits&#13;\n    besides Exception as e:&#13;\n        print(f\"Error processing article ID {row['ID']}: {e}\")&#13;\n&#13;\nprint(\"All embeddings are saved within the vector database.\")&#13;\n&#13;\n<\/code><\/pre>\n<\/div>\n<p>You will notice under in logs of created embeddings.<\/p>\n<div id=\"attachment_534523\" style=\"width: 616px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/vertex-generate-673.png\" alt=\"Logs\" width=\"606\" height=\"332\" class=\"wp-image-534523\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/vertex-generate-673.png 1376w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/vertex-generate-673-480x263.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/vertex-generate-673-680x372.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/vertex-generate-673-384x210.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/vertex-generate-673-768x420.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2024\/12\/vertex-generate-673-1024x560.png 1024w\" data-sizes=\"auto, (max-width: 606px) 100vw, 606px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Screenshot from Google Cloud Console, December 2024<\/span><\/div>\n<h2 id=\"findinganar\">4. Discovering An Article Match For A Key phrase Utilizing Google Vertex AI<\/h2>\n<p>Now, let\u2019s do the identical key phrase matching with Vertex AI. There&#8217;s a small nuance as it&#8217;s essential to use \u2018RETRIEVAL_QUERY\u2019 vs. \u2018RETRIEVAL_DOCUMENT\u2019 as an argument when producing embeddings of key phrases as we are attempting to carry out a seek for an article (aka doc) that finest matches our phrase.<\/p>\n<p><a href=\"https:\/\/cloud.google.com\/blog\/products\/ai-machine-learning\/improve-gen-ai-search-with-vertex-ai-embeddings-and-task-types#:~:text=New%20%22task%20type%22%20embedding\" target=\"_blank\" rel=\"noopener\">Task types<\/a> are one of many vital benefits that Vertex AI has over OpenAI\u2019s fashions.<\/p>\n<p>It ensures that the embeddings seize the intent of the key phrases which is vital for inner linking, and improves the relevance and accuracy of the matches present in your vector database.<\/p>\n<p>Use this script for matching the key phrases to vectors.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>&#13;\nimport os&#13;\nimport pandas as pd&#13;\nfrom google.cloud import aiplatform&#13;\nfrom google.auth import load_credentials_from_file&#13;\nfrom google.api_core.exceptions import ServiceUnavailable&#13;\nfrom vertexai.language_models import TextEmbeddingModel&#13;\n&#13;\nfrom pinecone import Pinecone&#13;\nfrom tabulate import tabulate  # For desk formatting&#13;\n&#13;\n# Arrange your Google Cloud credentials&#13;\nos.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"] = \"config.json\"  # Substitute along with your JSON key file&#13;\ncredentials, project_id = load_credentials_from_file(os.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"])&#13;\n&#13;\n# Initialize Pinecone consumer&#13;\npinecone = Pinecone(api_key='YOUR_PINECON_API_KEY')  # Add your Pinecone API key&#13;\nindex_name = \"article-index-vertex\"  # Substitute along with your Pinecone index title&#13;\nindex = pinecone.Index(index_name)&#13;\n&#13;\n# Initialize Vertex AI&#13;\naiplatform.init(venture=project_id, credentials=credentials, location=\"us-central1\")&#13;\n&#13;\ndef generate_embeddings(&#13;\n    textual content: str,&#13;\n    model_id: str = \"text-embedding-005\"&#13;\n) -&gt; listing:&#13;\n    \"\"\"&#13;\n    Generates embeddings for the enter textual content utilizing Google Vertex AI's embedding mannequin.&#13;\n    Returns None if textual content is empty or an error happens.&#13;\n    \"\"\"&#13;\n    if not textual content or not textual content.strip():&#13;\n        print(\"Textual content enter is empty. Skipping.\")&#13;\n        return None&#13;\n&#13;\n    strive:&#13;\n        mannequin = TextEmbeddingModel.from_pretrained(model_id)&#13;\n        vector = mannequin.get_embeddings([text])  # Eliminated 'task_type' and 'output_dimensionality'&#13;\n        return vector[0].values&#13;\n    besides ServiceUnavailable as e:&#13;\n        print(f\"Vertex AI service is unavailable: {e}\")&#13;\n        return None&#13;\n    besides Exception as e:&#13;\n        print(f\"Error producing embeddings: {e}\")&#13;\n        return None&#13;\n&#13;\n&#13;\ndef match_keywords_to_index(key phrases):&#13;\n    \"\"\"&#13;\n    Matches an inventory of keyword-category pairs to the closest articles within the Pinecone index,&#13;\n    filtering by metadata if specified.&#13;\n    \"\"\"&#13;\n    outcomes = []&#13;\n&#13;\n    for keyword_pair in key phrases:&#13;\n        key phrase = keyword_pair[0]&#13;\n        class = keyword_pair[1]&#13;\n&#13;\n        strive:&#13;\n            keyword_vector = generate_embeddings(key phrase)&#13;\n&#13;\n            if not keyword_vector:&#13;\n                print(f\"No embedding generated for key phrase '{key phrase}' in class '{class}'.\")&#13;\n                outcomes.append({&#13;\n                    'Key phrase': key phrase,&#13;\n                    'Class': class,&#13;\n                    'Match Rating': 'Error\/Empty',&#13;\n                    'Title': 'No match',&#13;\n                    'URL': 'N\/A'&#13;\n                })&#13;\n                proceed&#13;\n&#13;\n            query_results = index.question(&#13;\n                vector=keyword_vector,&#13;\n                top_k=1,&#13;\n                include_metadata=True,&#13;\n                filter={\"class\": class}&#13;\n            )&#13;\n&#13;\n            if query_results['matches']:&#13;\n                closest_match = query_results['matches'][0]&#13;\n                outcomes.append({&#13;\n                    'Key phrase': key phrase,&#13;\n                    'Class': class,&#13;\n                    'Match Rating': f\"{closest_match['score']:.2f}\",&#13;\n                    'Title': closest_match['metadata'].get('title', 'N\/A'),&#13;\n                    'URL': closest_match['id']&#13;\n                })&#13;\n            else:&#13;\n                outcomes.append({&#13;\n                    'Key phrase': key phrase,&#13;\n                    'Class': class,&#13;\n                    'Match Rating': 'N\/A',&#13;\n                    'Title': 'No match discovered',&#13;\n                    'URL': 'N\/A'&#13;\n                })&#13;\n&#13;\n        besides Exception as e:&#13;\n            print(f\"Error processing key phrase '{key phrase}' with class '{class}': {e}\")&#13;\n            outcomes.append({&#13;\n                'Key phrase': key phrase,&#13;\n                'Class': class,&#13;\n                'Match Rating': 'Error',&#13;\n                'Title': 'Error occurred',&#13;\n                'URL': 'N\/A'&#13;\n            })&#13;\n&#13;\n    return outcomes&#13;\n&#13;\n# Instance utilization: &#13;\nkey phrases = [[\"SEO Tools\", \"Tools\"], [\"TikTok\", \"TikTok\"], [\"SEO Consultant\", \"SEO\"]]&#13;\n&#13;\nmatches = match_keywords_to_index(key phrases)&#13;\n&#13;\n# Show the leads to a desk&#13;\nprint(tabulate(matches, headers=\"keys\", tablefmt=\"fancy_grid\"))&#13;\n&#13;\n<\/code><\/pre>\n<\/div>\n<p>And you will note scores generated:<\/p>\n<div id=\"attachment_536257\" style=\"width: 1549px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" src=\"https:\/\/mailinvest.blog\/wp-content\/themes\/breek\/assets\/images\/transparent.gif\" data-lazy=\"true\" data-src=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/google-vertex-scores-783.png\" alt=\"Keyword Matche Scores produced by Vertex AI text embedding model\" width=\"1539\" height=\"530\" class=\"size-full wp-image-536257\" data-srcset=\"https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/google-vertex-scores-783.png 1539w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/google-vertex-scores-783-480x165.png 480w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/google-vertex-scores-783-680x234.png 680w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/google-vertex-scores-783-384x132.png 384w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/google-vertex-scores-783-768x264.png 768w, https:\/\/www.searchenginejournal.com\/wp-content\/uploads\/2025\/01\/google-vertex-scores-783-1024x353.png 1024w\" data-sizes=\"auto, (max-width: 1539px) 100vw, 1539px\" loading=\"lazy\"\/><span class=\"wp-caption-text\">Key phrase Matche Scores produced by Vertex AI textual content embedding mannequin<\/span><\/div>\n<h2 id=\"trytestingt\">Attempt Testing The Relevance Of Your Article Writing<\/h2>\n<p>Consider this as a simplified (broad) solution to test how semantically related your writing is to the top key phrase. Create a vector embedding of your <a href=\"https:\/\/www.searchenginejournal.com\/ranking-for-head-term-keywords\/417133\/\">head keyword<\/a> and full article content material by way of Google\u2019s Vertex AI and calculate a cosine similarity.<\/p>\n<p>In case your textual content is just too lengthy you might want to think about implementing <a href=\"https:\/\/www.pinecone.io\/learn\/chunking-strategies\/\" target=\"_blank\" rel=\"noopener\">chunking strategies<\/a>.<\/p>\n<ol\/>\n<p>An in depth rating (cosine similarity) to 1.0 (like 0.8 or 0.7) <a href=\"https:\/\/www.searchenginejournal.com\/study-google-ai-overviews-appear-in-47-of-search-results\/535096\/#:~:text=Content%20Quality%20%26%20Relevance\">means you\u2019re pretty close<\/a> on that topic. In case your rating is decrease you might discover that an excessively lengthy intro which has a number of fluff could also be inflicting dilution of the relevance and reducing it helps to extend it.<\/p>\n<p>However bear in mind, any edits made ought to make sense from an editorial and person expertise perspective as properly.<\/p>\n<p>You possibly can even do a fast comparability by embedding a competitor\u2019s high-ranking content material and seeing the way you stack up.<\/p>\n<p>Doing this lets you extra precisely align your content material with the goal topic, which can assist you rank higher.<\/p>\n<p>There are already instruments that <a href=\"https:\/\/bsky.app\/profile\/ryanjones.bsky.social\/post\/3lcdzqv2sks2p\" target=\"_blank\" rel=\"noopener\">perform such tasks<\/a>, however studying these abilities means you possibly can take a personalized method tailor-made to your wants\u2014and, after all, to do it at no cost.<\/p>\n<p>Experimenting for your self and studying these abilities will assist you to maintain forward with AI search engine marketing and to\u00a0make knowledgeable choices.<\/p>\n<p>As further readings, I like to recommend you dive into these nice articles:<\/p>\n<p><strong>Extra assets:\u00a0<\/strong><\/p>\n<hr\/>\n<p><em>Featured Picture: <span class=\"MuiBox-root mui-16qd35q-centeredContent-avatarContainer\"><span class=\"MuiTypography-root MuiTypography-body1 mui-r4n38m-contributorLabel-linkAvatarLabel\">Aozorastock<\/span><\/span>\/Shutterstock<\/em><\/p>\n<\/div>\n<iframe data-lazy=\"true\" data-src=\"https:\/\/www.fiverr.com\/gig_widgets?id=U2FsdGVkX18x7XQvttUTrv1oEqmGNGTgvvCUiUoJ\/AP4z\/UyMz8lXGOLpu15jIMxBbTR0gmD5uBoFvhC4KWeALQRp3h\/X\/AwcVD0K8Wj9H\/ZzYKzcCNHosB9oS4SCJJFWiN85P9ICAc4OgCoE\/wHKIY7CDkf2\/DQ1vqGvk4smVe5cRDEmrLPCWi4FC8p40VUhSmWQ5udCm0zoJtorgWv3vbDQw0kKYkwn39ozAnQXDe+YvWMxkLFWA+O3TFwkJvdkIK+\/AUSnRssPKt5WHY0FhNOxnSPcLslEL4G4\/RfP95ve99U+kRnDy3X+KtzdQLY+u935ghON\/o3UE4IMv9oN6JX9RnxzL\/LRcOgnHigxStSGPKsZYtnz8RWNVT\/rOLAibqiWJadC5MYHRbekF3eg6FOGrQGkXYbsn0+a5aovnlLCbLwIqY9fcS17UX8J235iQ6cdmHNbrPeS84CMm34RA==&affiliate_id=1052423&strip_google_tagmanager=true\" loading=\"lazy\" data-with-title=\"true\" class=\"fiverr_nga_frame\" frameborder=\"0\" height=\"350\" width=\"100%\" referrerpolicy=\"no-referrer-when-downgrade\" data-mode=\"random_gigs\" onload=\" var frame = this; var script = document.createElement('script'); script.addEventListener('load', function() { window.FW_SDK.register(frame); }); script.setAttribute('src', 'https:\/\/www.fiverr.com\/gig_widgets\/sdk'); document.body.appendChild(script); \" ><\/iframe>\n<br \/><a href=\"https:\/\/www.searchenginejournal.com\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/533993\/\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A vector database is a set of knowledge the place every bit of knowledge is saved as a (numerical) vector. A vector represents an object&#8230;<\/p>\n","protected":false},"author":1,"featured_media":63236,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-63235","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-universe"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Introduction To Vector Databases And How To Use AI For SEO - mailinvest.blog<\/title>\n<meta name=\"description\" content=\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction To Vector Databases And How To Use AI For SEO - mailinvest.blog\" \/>\n<meta property=\"og:description\" content=\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/\" \/>\n<meta property=\"og:site_name\" content=\"mailinvest.blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/freelanceracademic\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-02T13:37:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-02T13:38:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mailinvest.blog\/wp-content\/uploads\/2025\/01\/vector-databases-ai-seo-777.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"840\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin@mailinvest.blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin@mailinvest.blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/\"},\"author\":{\"name\":\"admin@mailinvest.blog\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/person\\\/012701c4c204d4e4ebd34f926cfd31a4\"},\"headline\":\"Introduction To Vector Databases And How To Use AI For SEO\",\"datePublished\":\"2025-01-02T13:37:39+00:00\",\"dateModified\":\"2025-01-02T13:38:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/\"},\"wordCount\":1932,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/vector-databases-ai-seo-777.png\",\"articleSection\":[\"Tech Universe\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/\",\"name\":\"Introduction To Vector Databases And How To Use AI For SEO - mailinvest.blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/vector-databases-ai-seo-777.png\",\"datePublished\":\"2025-01-02T13:37:39+00:00\",\"dateModified\":\"2025-01-02T13:38:44+00:00\",\"description\":\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/#primaryimage\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/vector-databases-ai-seo-777.png\",\"contentUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/vector-databases-ai-seo-777.png\",\"width\":1600,\"height\":840},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2025\\\/01\\\/02\\\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mailinvest.blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction To Vector Databases And How To Use AI For SEO\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#website\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/\",\"name\":\"mailinvest.blog\",\"description\":\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis. mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\",\"publisher\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mailinvest.blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\",\"name\":\"mailinvest\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/default.png\",\"contentUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/default.png\",\"width\":1000,\"height\":1000,\"caption\":\"mailinvest\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/freelanceracademic\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/person\\\/012701c4c204d4e4ebd34f926cfd31a4\",\"name\":\"admin@mailinvest.blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"caption\":\"admin@mailinvest.blog\"},\"sameAs\":[\"https:\\\/\\\/mailinvest.blog\",\"admin@mailinvest.blog\"],\"url\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/author\\\/adminmailinvest-blog\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introduction To Vector Databases And How To Use AI For SEO - mailinvest.blog","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","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:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/","og_locale":"en_US","og_type":"article","og_title":"Introduction To Vector Databases And How To Use AI For SEO - mailinvest.blog","og_description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","og_url":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/","og_site_name":"mailinvest.blog","article_publisher":"https:\/\/www.facebook.com\/freelanceracademic\/","article_published_time":"2025-01-02T13:37:39+00:00","article_modified_time":"2025-01-02T13:38:44+00:00","og_image":[{"width":1600,"height":840,"url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2025\/01\/vector-databases-ai-seo-777.png","type":"image\/png"}],"author":"admin@mailinvest.blog","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin@mailinvest.blog","Est. reading time":"17 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/#article","isPartOf":{"@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/"},"author":{"name":"admin@mailinvest.blog","@id":"https:\/\/mailinvest.blog\/#\/schema\/person\/012701c4c204d4e4ebd34f926cfd31a4"},"headline":"Introduction To Vector Databases And How To Use AI For SEO","datePublished":"2025-01-02T13:37:39+00:00","dateModified":"2025-01-02T13:38:44+00:00","mainEntityOfPage":{"@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/"},"wordCount":1932,"commentCount":0,"publisher":{"@id":"https:\/\/mailinvest.blog\/#organization"},"image":{"@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/#primaryimage"},"thumbnailUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2025\/01\/vector-databases-ai-seo-777.png","articleSection":["Tech Universe"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/","url":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/","name":"Introduction To Vector Databases And How To Use AI For SEO - mailinvest.blog","isPartOf":{"@id":"https:\/\/mailinvest.blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/#primaryimage"},"image":{"@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/#primaryimage"},"thumbnailUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2025\/01\/vector-databases-ai-seo-777.png","datePublished":"2025-01-02T13:37:39+00:00","dateModified":"2025-01-02T13:38:44+00:00","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","breadcrumb":{"@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/#primaryimage","url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2025\/01\/vector-databases-ai-seo-777.png","contentUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2025\/01\/vector-databases-ai-seo-777.png","width":1600,"height":840},{"@type":"BreadcrumbList","@id":"https:\/\/mailinvest.blog\/index.php\/2025\/01\/02\/introduction-to-vector-databases-and-how-to-use-ai-for-seo\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mailinvest.blog\/"},{"@type":"ListItem","position":2,"name":"Introduction To Vector Databases And How To Use AI For SEO"}]},{"@type":"WebSite","@id":"https:\/\/mailinvest.blog\/#website","url":"https:\/\/mailinvest.blog\/","name":"mailinvest.blog","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis. mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","publisher":{"@id":"https:\/\/mailinvest.blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mailinvest.blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/mailinvest.blog\/#organization","name":"mailinvest","url":"https:\/\/mailinvest.blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mailinvest.blog\/#\/schema\/logo\/image\/","url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/01\/default.png","contentUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/01\/default.png","width":1000,"height":1000,"caption":"mailinvest"},"image":{"@id":"https:\/\/mailinvest.blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/freelanceracademic\/"]},{"@type":"Person","@id":"https:\/\/mailinvest.blog\/#\/schema\/person\/012701c4c204d4e4ebd34f926cfd31a4","name":"admin@mailinvest.blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","caption":"admin@mailinvest.blog"},"sameAs":["https:\/\/mailinvest.blog","admin@mailinvest.blog"],"url":"https:\/\/mailinvest.blog\/index.php\/author\/adminmailinvest-blog\/"}]}},"_links":{"self":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts\/63235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/comments?post=63235"}],"version-history":[{"count":1,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts\/63235\/revisions"}],"predecessor-version":[{"id":63237,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts\/63235\/revisions\/63237"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/media\/63236"}],"wp:attachment":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/media?parent=63235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/categories?post=63235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/tags?post=63235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}