diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/_index.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/_index.md new file mode 100644 index 0000000000..32445847a5 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/_index.md @@ -0,0 +1,69 @@ +--- +title: Build Semantic Search and Chatbot Retrieval Systems with Qdrant on Google Cloud C4A Axion processors + +minutes_to_complete: 30 + +who_is_this_for: This is an introductory topic for developers, data engineers, and platform engineers who want to build semantic search systems and chatbot retrieval pipelines on Arm64-based Google Cloud C4A Axion processors using the Qdrant vector database. + +learning_objectives: + - Deploy and run the Qdrant vector database on Google Cloud C4A Axion processors + - Generate vector embeddings using transformer models + - Store and index embeddings efficiently using Qdrant + - Perform semantic similarity search using vector queries + - Build a simple chatbot retrieval system powered by vector search + +prerequisites: + - A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled + - Basic familiarity with Python + - Basic understanding of machine learning embeddings + - Familiarity with Linux command-line operations + +author: Pareena Verma + +##### Tags +skilllevels: Introductory +subjects: Databases +cloud_service_providers: +- Google Cloud + +armips: +- Neoverse + +tools_software_languages: +- Qdrant +- Python +- Sentence Transformers +- Docker + +operatingsystems: +- Linux + +# ================================================================================ +# FIXED, DO NOT MODIFY +# ================================================================================ + +further_reading: + - resource: + title: Google Cloud documentation + link: https://cloud.google.com/docs + type: documentation + + - resource: + title: Qdrant documentation + link: https://qdrant.tech/documentation/ + type: documentation + + - resource: + title: Sentence Transformers documentation + link: https://www.sbert.net/ + type: documentation + + - resource: + title: Vector Databases Explained + link: https://qdrant.tech/articles/what-is-a-vector-database/ + type: documentation + +weight: 1 +layout: "learningpathall" +learning_path_main_page: yes +--- diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/_next-steps.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/_next-steps.md new file mode 100644 index 0000000000..c3db0de5a2 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/_next-steps.md @@ -0,0 +1,8 @@ +--- +# ================================================================================ +# FIXED, DO NOT MODIFY THIS FILE +# ================================================================================ +weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation. +title: "Next Steps" # Always the same, html page title. +layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing. +--- diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/architecture.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/architecture.md new file mode 100644 index 0000000000..9239601d28 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/architecture.md @@ -0,0 +1,120 @@ +--- +title: Architecture +weight: 8 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +# Chatbot Architecture Using Qdrant + +In this section, you explore the architecture behind the chatbot retrieval system built using Qdrant on Google Axion Arm-based infrastructure. + +This architecture demonstrates how modern AI systems perform **semantic similarity search** to retrieve relevant information from stored knowledge. + +Unlike traditional keyword search systems, vector databases allow applications to retrieve information based on **semantic meaning and contextual similarity**. + + +## System architecture + +The chatbot system retrieves relevant information through vector embeddings and similarity search. + +```text +User Question + │ + ▼ +Embedding Model +(Sentence Transformer) + │ + ▼ +Vector Representation + │ + ▼ +Qdrant Vector Database +(Vector Similarity Search) + │ + ▼ +Top Matching Knowledge + │ + ▼ +Chatbot Response +``` + + + +## Components + +**Embedding Model** + +The embedding model converts text into numerical vectors representing semantic meaning. + +**Example model used:** + +```text +sentence-transformers/all-MiniLM-L6-v2 +``` + +This lightweight transformer model is commonly used for semantic search and AI retrieval workloads. + +## Vector Database (Qdrant) +Qdrant stores and indexes vector embeddings generated from documents and user queries. + +It enables fast **nearest-neighbor similarity search**, which finds the most relevant vectors based on semantic similarity. + +Key capabilities: + +- high performance vector indexing +- semantic similarity search +- scalable vector storage + +## Knowledge Base + +The system stores knowledge documents such as: + +- technical documentation +- support articles +- FAQs +- internal company knowledge + +During ingestion, these documents are converted into embeddings and stored in Qdrant. + +## Chatbot Query Engine + +When the user asks a question: + +1. The query is converted into an embedding +2. Qdrant searches for the closest vectors +3. The chatbot returns relevant information + +This process enables the chatbot to understand intent and meaning, rather than relying solely on keyword matching. + +## Benefits of This Architecture + +This design provides several advantages: + +- semantic search instead of keyword matching +- scalable knowledge retrieval +- faster query responses +- efficient AI workloads on Arm infrastructure + +## Running on Axion + +This example demonstrates that Axion Arm infrastructure can efficiently run vector search workloads. + +- Benefits include: +- energy-efficient compute +- scalable cloud infrastructure +- optimized performance for AI workloads + +## What you've learned + +In this section, you learned how the chatbot retrieval system works using vector search. + +You explored: + +- How embeddings represent semantic meaning +- How Qdrant stores and indexes vectors +- How similarity search retrieves relevant knowledge +- How this architecture supports chatbot and RAG systems + +Together, these components form the foundation for modern AI-powered search and knowledge retrieval systems running on Arm-based cloud infrastructure. diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/background.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/background.md new file mode 100644 index 0000000000..dd0c305dbd --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/background.md @@ -0,0 +1,47 @@ +--- +title: Get started with Qdrant on Google Axion C4A +weight: 2 + +layout: "learningpathall" +--- + +## Explore Axion C4A Arm instances in Google Cloud + +Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance for data-intensive and analytics workloads such as big data processing, in-memory analytics, columnar data processing, and high-throughput data services. + +The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability, SIMD acceleration, and memory bandwidth advantages of the Arm architecture in Google Cloud. + +These characteristics make Axion C4A instances well-suited for modern analytics stacks that rely on columnar data formats and memory-efficient execution engines. + +To learn more, see the Google blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu). + +## Explore Qdrant Vector Search on Google Axion C4A (Arm Neoverse V2) + +Qdrant is an open-source vector database designed for efficient similarity search and high-performance vector indexing. It enables applications to store and retrieve embeddings—numerical representations of data such as text, images, or audio—allowing systems to perform semantic search and AI-powered retrieval. + +Vector databases like Qdrant are commonly used in modern AI systems to support applications such as semantic search, recommendation systems, anomaly detection, and Retrieval-Augmented Generation (RAG) pipelines. By storing embeddings and performing nearest-neighbor search, Qdrant allows applications to retrieve the most relevant information based on semantic meaning rather than simple keyword matching. + +Running Qdrant on Google Axion C4A Arm-based infrastructure enables efficient execution of AI and vector search workloads. Axion processors, based on the Arm Neoverse V2 architecture, provide high performance and improved energy efficiency for modern cloud-native applications and data services. + +Using Qdrant on Axion allows you to achieve: + +- High-performance vector similarity search for AI applications +- Efficient embedding, storage, and indexing for semantic retrieval +- Low-latency data access for chatbots and AI assistants +- Scalable infrastructure for Retrieval-Augmented Generation (RAG) pipelines +- Cost-efficient execution of vector database workloads on Arm-based cloud infrastructure + +Common use cases include AI chatbots, semantic search engines, recommendation systems, enterprise knowledge assistants, document retrieval systems, and machine learning feature stores. + +To learn more, visit the [Qdrant documentation](https://qdrant.tech/documentation/) and explore how vector databases enable modern AI applications. + +## What you've learned and what's next + +In this section, you learned about: + +* Google Axion C4A Arm-based VMs and their performance characteristics +* Qdrant as a vector database for storing and retrieving embeddings +* Semantic similarity search and how it powers AI retrieval systems +* How vector search enables chatbot and RAG-style knowledge retrieval + +Next, you can explore how to extend this setup by integrating large language models (LLMs) to build a full Retrieval-Augmented Generation (RAG) pipeline, enabling AI systems to generate context-aware responses using information retrieved from the Qdrant vector database. diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/chatbot-usecase.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/chatbot-usecase.md new file mode 100644 index 0000000000..12b2fa80e2 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/chatbot-usecase.md @@ -0,0 +1,263 @@ +--- +title: Chatbot Use Case with Qdrant +weight: 7 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +# Chatbot Use Case with Qdrant on Axion (Arm64) + +## Overview + +In this section, you build a simple **chatbot-style knowledge retrieval system** using the Qdrant vector database running on Google Axion Arm-based infrastructure. + +The chatbot retrieves relevant knowledge by performing **semantic similarity search** against stored vector embeddings. + +This architecture represents the **retrieval component of Retrieval-Augmented Generation (RAG) systems**, commonly used in modern AI assistants and enterprise knowledge platforms. + +The chatbot uses: + +- **Sentence Transformers** to generate embeddings +- **Qdrant** to store and retrieve vector data +- **Python** to implement an interactive chatbot interface + +## Architecture overview + +The chatbot workflow retrieves relevant information using vector similarity search. + +```text +User Question + | + v +Sentence Transformer Model + | + v +Query Embedding Vector + | + v +Qdrant Vector Database + | + v +Similarity Search + | + v +Top Matching Knowledge + | + v +Chatbot Response +``` + + +## Navigate to Project Directory + +You can move to the project directory created earlier. + +```bash +cd ~/qdrant-rag-demo +``` + +**Verify files:** + +```bash +ls +``` + +The output is similar to: +```output +ingest.py +search.py +``` + +These scripts were created in earlier sections to generate embeddings and perform vector searches. + +## Load knowledge into Qdrant + +The ingestion script converts documents into embeddings and stores them in Qdrant. + +**Run the ingestion script:** + +```bash +python3.11 ingest.py +``` + +The output is similar to: +```output +Documents indexed successfully in Qdrant! +``` + +**Verify the collection:** + +curl http://localhost:6333/collections + +The output is similar to: +```output + + "result": { + "collections":[{"name":"axion_demo"}] + } +} +``` + +This confirms the vector collection has been created successfully. + +## Create Chatbot Script + +Create a Python file that allows users to interactively query the vector database. + +```bash +vi chatbot.py +``` + +**Add the following code:** + +```bash +vi chatbot.py +``` + +Paste the following code. + +```python +from qdrant_client import QdrantClient +from sentence_transformers import SentenceTransformer + +client = QdrantClient(url="http://localhost:6333") + +model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2") + +print("Chatbot ready! Type a question or 'exit' to quit.") + +while True: + + query = input("\nUser: ") + + if query.lower() == "exit": + break + + query_vector = model.encode(query).tolist() + + results = client.query_points( + collection_name="axion_demo", + query=query_vector, + limit=2 + ) + + print("\nChatbot Response:\n") + + for point in results.points: + print("-", point.payload["text"]) +``` + +## Run the chatbot + +Start the chatbot application. + +```bash +python3.11 chatbot.py +``` + +The output is similar to: +```output +Chatbot ready! Ask a question (type 'exit' to quit) + +User: +``` + +## Test the Chatbot + +Example interaction: + +```bash +User: What is Qdrant? +``` + +The output is similar to: +```output +Chatbot Response: + +- Qdrant is optimized for vector similarity search. +- Vector databases enable semantic search. +``` + + +**Another example:** + +```bash +User: what are rag pipelines? +``` + +The output is similar to: +```output +Chatbot Response: + +- RAG pipelines combine retrieval with LLMs. +- Axion processors provide Arm based cloud compute. +``` + +**Exit the chatbot:** + +```bash +exit +``` +## Example Chatbot Interaction + +The following image shows the chatbot running on the Axion VM and retrieving relevant results from the Qdrant vector database. + +![Qdrant chatbot semantic search example running on Axion ARM alt-txt#center](images/chatbot.png "Qdrant chatbot semantic search demo on Axion") + +## How the Chatbot Works + +1. The user asks a question. +2. The system converts the question into a vector embedding. +3. Qdrant performs a similarity search. +4. The chatbot returns the most relevant knowledge documents. +5. This enables semantic search instead of simple keyword matching. + + +## Retrieval-Augmented Generation (RAG) + +In modern AI systems, this retrieval step is typically combined with a large language model. + +The full RAG workflow looks like: + +```text +User Question + | + v +Embedding Model + | + v +Qdrant Vector Database + | + v +Relevant Context Retrieved + | + v +Large Language Model (LLM) + | + v +Generated Answer +``` + +Qdrant provides the **high-performance retrieval layer** for this architecture. + +## Real-World Applications + +This architecture is widely used in: + +- Customer support chatbots +- Enterprise knowledge assistants +- AI documentation search tools +- Technical support bots +- RAG-based AI assistants + +## What you've learned and what's next + +In this section, you learned how to: + +- Build a chatbot-style knowledge retrieval system +- Convert user queries into vector embeddings +- Perform semantic similarity search with Qdrant +- Retrieve relevant information using vector search + +In the next section, you will explore the system architecture behind vector search workloads on Axion infrastructure, including how Qdrant enables scalable AI retrieval pipelines. diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/chatbot.png b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/chatbot.png new file mode 100644 index 0000000000..e6ecbf3505 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/chatbot.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-pubip-ssh.png b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-pubip-ssh.png new file mode 100644 index 0000000000..558745de3e Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-pubip-ssh.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-shell.png b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-shell.png new file mode 100644 index 0000000000..7e2fc3d1b5 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-shell.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-vm.png b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-vm.png new file mode 100644 index 0000000000..0d1072e20d Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/images/gcp-vm.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/ingest-vectors.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/ingest-vectors.md new file mode 100644 index 0000000000..25aa3dfea5 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/ingest-vectors.md @@ -0,0 +1,153 @@ +--- +title: Generate and Index Vectors +weight: 5 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +# Generate and Index Vectors + +In this section, you generate vector embeddings from sample text data and store them in the **Qdrant vector database**. + +Embeddings are numerical vector representations of data such as text, images, or audio. These vectors capture semantic meaning, allowing applications to perform similarity search and retrieve the most relevant results. + +Using **Sentence Transformers**, you convert text into embeddings and store them in Qdrant for efficient vector indexing and retrieval. + +## Architecture overview + +This stage of the workflow focuses on embedding generation and vector storage. + +```text +Text Documents + | + v +Sentence Transformer Model + | + v +Vector Embeddings + | + v +Qdrant Vector Database + | + v +Indexed Vectors Ready for Search +``` + +## Install Python Libraries + +Install the Python libraries required for embedding generation and communication with the Qdrant API. + +```bash +python3.11 -m pip install qdrant-client sentence-transformers +``` + +These libraries provide: + +- **qdrant-client** — Python interface for interacting with Qdrant +- **sentence-transformers** — pretrained transformer models for generating embeddings + +## Create Project Directory + +Create a working directory for the vector ingestion scripts. +```bash +mkdir qdrant-rag-demo +cd qdrant-rag-demo +``` + +This directory will contain the Python scripts used to generate embeddings and query the vector database. + +## Create the Ingestion Script + +**Create the Python file:** + +```bash +vi ingest.py +``` + +**Add the following code:** + +```python +ingest.py +from qdrant_client import QdrantClient +from qdrant_client.models import VectorParams, Distance, PointStruct +from sentence_transformers import SentenceTransformer + +client = QdrantClient(url="http://localhost:6333") + +collection_name = "axion_demo" + +client.recreate_collection( + collection_name=collection_name, + vectors_config=VectorParams(size=384, distance=Distance.COSINE), +) + +model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2") + +documents = [ + "Axion processors provide Arm based cloud compute.", + "Vector databases enable semantic search.", + "Qdrant is optimized for vector similarity search.", + "RAG pipelines combine retrieval with LLMs." +] + +vectors = model.encode(documents) + +points = [ + PointStruct(id=i, vector=vectors[i].tolist(), payload={"text": documents[i]}) + for i in range(len(documents)) +] + +client.upsert(collection_name=collection_name, points=points) + +print("Documents indexed successfully in Qdrant") +``` + +### What this script does + +This script performs several important operations: + +- Connects to the Qdrant API +- Creates a vector collection +- Loads a transformer model for embeddings +- Converts text documents into vector embeddings +- Stores the vectors inside the Qdrant database + +## Run the ingestion script + +Execute the script to generate embeddings and store them in Qdrant. + +```bash +python3.11 ingest.py +``` +The output is similar to: +```output +Documents indexed successfully in Qdrant! +``` + +This confirms that the vectors have been successfully inserted into the database. + +## Verify the vector collection + +Check that the vector collection exists in Qdrant. + +```bash +curl http://localhost:6333/collections +``` + +The output is similar to: +```output +{"result":{"collections":[{"name":"axion_demo"}]},"status":"ok","time":4.01e-6} +``` + +## What you've learned and what's next + +In this section, you learned how to: + +- Install Python libraries for vector search workloads +- Generate embeddings using a transformer model +- Create a vector collection in Qdrant +- Store embeddings as indexed vectors +- Verify the stored vector collection + +In the next section, you will query the vector database and perform semantic similarity search, enabling AI-powered retrieval and chatbot-style knowledge queries. diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/install-qdrant.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/install-qdrant.md new file mode 100644 index 0000000000..0ded136d99 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/install-qdrant.md @@ -0,0 +1,170 @@ +--- +title: Install and Run Qdrant +weight: 4 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +# Install and Run Qdrant + +In this section, you prepare a SUSE Linux Enterprise Server (SLES) arm64 virtual machine and deploy **Qdrant**, an open-source vector database designed for efficient similarity search and vector indexing. + +Qdrant enables applications to store and retrieve embeddings — numerical vector representations of data such as text, images, and audio. These embeddings allow applications to perform **semantic search and AI-powered retrieval**. + +Running Qdrant on **Google Axion Arm-based infrastructure** enables efficient execution of modern AI workloads including semantic search, recommendation systems, and chatbot retrieval pipelines. + +## Architecture overview + +This architecture represents a simple vector search system where embeddings are generated and stored in Qdrant, enabling fast semantic similarity queries. + +```text +SUSE Linux Enterprise Server (arm64) + | + v +Docker Container Runtime + | + v +Qdrant Vector Database + | + v +Vector Embeddings Storage + | + v +Semantic Similarity Search +``` + +## Update the System + +Update package repositories and installed packages. + +```bash +sudo zypper refresh +sudo zypper update -y +``` + +## Install Required Packages + +Install Docker and Python dependencies. + +```bash +sudo zypper install -y docker python3 python3-pip git +sudo zypper install -y python311 python311-pip +python3.11 -m pip install --upgrade pip +``` + +**Verify Python installation:** + +```bash +python3.11 --version +``` + +The output is similar to: +```output +Python 3.11.10 +``` + +**Why this matters:** + +- Python 3.11 provides improved performance and memory efficiency. +- It ensures compatibility with modern AI libraries used in vector search pipelines. + +## Enable Docker + +Start and enable the Docker service. + +```bash +sudo systemctl enable docker +sudo systemctl start docker +sudo usermod -aG docker $USER +``` +Log out and log back in so the Docker group permissions take effect. + +## Verify installation: + +```bash +docker --version +``` + +You should see an output similar to: +```output +Docker version 28.5.1-ce, build f8215cc26 +``` + +Docker allows us to run Qdrant in an isolated container environment. + +## Run the Qdrant vector database + +Start the Qdrant container. + +```bash +docker run -d \ +-p 6333:6333 \ +-p 6334:6334 \ +-v $(pwd)/qdrant_storage:/qdrant/storage \ +qdrant/qdrant +``` + +**This command:** + +- Runs Qdrant in detached mode +- Exposes ports 6333 and 6334 +- Creates persistent storage for vector data + +You should see an output similar to: +```output +latest: Pulling from qdrant/qdrant +3ea009573b47: Pull complete +4f4fb700ef54: Pull complete +ea8055cf6833: Pull complete +9d7bb093ff98: Pull complete +13053c6d0c21: Pull complete +c017fa517b2b: Pull complete +3e2c95baf78f: Pull complete +b940a5cd37f5: Pull complete +Digest: sha256:f1c7272cdac52b38c1a0e89313922d940ba50afd90d593a1605dbbc214e66ffb +Status: Downloaded newer image for qdrant/qdrant:latest +1af9f6ac9cef017016837667f68aeed22a74f0f6352effd568dfa188337820c0 +``` + +## Verify Qdrant + +Check running containers. + +```bash +docker ps +``` + +You should see an output similar to: +```output +1af9f6ac9cef qdrant/qdrant "./entrypoint.sh" 13 seconds ago Up 11 seconds 0.0.0.0:6333-6334->6333-6334/tcp, [::]:6333-6334>6333-6334/tcp inspiring_dijkstra +``` + +This confirms the Qdrant container is running successfully. + +## Test the Qdrant API + +Verify the Qdrant service by calling the REST API. + +```bash +curl http://localhost:6333 +``` + +You should see an output similar to: +```output +{"title":"qdrant - vector search engine","version":"1.17.0","commit":"4ab6d2ee0f6c718667e553b1055f3e944fef025f"}gcpuser@qdrant-arm64~> +``` + +This confirms the vector database service is reachable and ready for use. + +## What you've learned and what's next + +In this section, you learned how to: + +- Prepare a SUSE Linux arm64 environment on Axion +- Install Docker and Python dependencies +- Deploy the Qdrant vector database container +- Verify that the vector database is running correctly +- Access the Qdrant API endpoint + +In the next section, you will generate vector embeddings using a transformer model and store them in Qdrant, enabling semantic search and AI-powered retrieval. diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/instance.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/instance.md new file mode 100644 index 0000000000..27387f7580 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/instance.md @@ -0,0 +1,57 @@ +--- +title: Create a Google Axion C4A arm64 virtual machine on GCP +weight: 3 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Provision a Google Axion C4A arm64 virtual machine + +In this section you'll create a Google Axion C4A arm64 virtual machine on Google Cloud Platform. You'll use the `c4a-standard-4` machine type, which provides 4 vCPUs and 16 GB of memory. This virtual machine hosts your Qdrant applications. + +{{% notice Note %}} +For help with GCP setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/). +{{% /notice %}} + +## Provision the virtual machine in Google Cloud Console + +To create a virtual machine based on the C4A instance type: + +* Navigate to the [Google Cloud Console](https://console.cloud.google.com/). +* Go to **Compute Engine > VM Instances** and select **Create Instance**. +* Under **Machine configuration**: + * Populate fields such as **Instance name**, **Region**, and **Zone**. + * Set **Series** to `C4A`. + * Select `c4a-standard-4` for machine type. + +![Screenshot of the Google Cloud Console showing the Machine configuration section. The Series dropdown is set to C4A and the machine type c4a-standard-4 is selected alt-txt#center](images/gcp-vm.png "Configuring machine type to C4A in Google Cloud Console") + + +* Under **OS and storage**, select **Change**, and then choose an arm64 operating system image. + * For this Learning Path, select **SUSE Linux Enterprise Server**. + * For the license type, choose **Pay as you go**. + * Increase **Size (GB)** from **10** to **100** to allocate sufficient disk space. + * Select **Choose** to apply the changes. +* Under **Networking**, enable **Allow HTTP traffic** and **Allow HTTPS traffic** +* Also, add the following tag: `allow-qdrant` so this virtual machine matches the firewall rule you created in the previous section. +* For some organizations not using the **'default'** network interface, you may need to select the network appropriate for your organization. +* Select **Create** to launch the virtual machine. + +After the instance starts, select **SSH** next to the VM in the instance list to open a browser-based terminal session. + +![Google Cloud Console VM instances page displaying running instance with green checkmark and SSH button in the Connect column alt-txt#center](images/gcp-pubip-ssh.png "Connecting to a running C4A VM using SSH") + +A new browser window opens with a terminal connected to your VM. + +![Browser-based SSH terminal window with black background showing Linux command prompt and Google Cloud branding at top alt-txt#center](images/gcp-shell.png "Terminal session connected to the VM") + +## What you've learned and what's next + +In this section: + +* You provisioned a Google Axion C4A arm64 virtual machine with 4 vCPUs and 16 GB of memory +* You configured the VM with SUSE Linux Enterprise Server and 100 GB of storage +* You connected to your VM using SSH through the Google Cloud Console + +Your virtual machine is now ready to host Qdrant. diff --git a/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/semantic-search.md b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/semantic-search.md new file mode 100644 index 0000000000..969508031e --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/qdrant-on-axion/semantic-search.md @@ -0,0 +1,125 @@ +--- +title: Perform Semantic Search +weight: 6 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +# Perform Semantic Search + +In this section, you query the Qdrant vector database using **semantic similarity search**. + +Unlike traditional keyword search, semantic search compares vector embeddings to identify the most relevant results based on **meaning and context** rather than exact keyword matches. + +This capability enables AI applications such as chatbots, recommendation systems, and knowledge retrieval platforms. + + +## Architecture overview + +The semantic search workflow retrieves the most relevant documents using vector similarity. + +```text +User Query + | + v +Sentence Transformer Model + | + v +Query Embedding Vector + | + v +Qdrant Vector Database + | + v +Similarity Search + | + v +Top Matching Documents +``` + + +## Create the search script + +Create the Python script used to query the vector database. + +```bash +vi search.py +``` + +Add the following code: + +```python +from qdrant_client import QdrantClient +from sentence_transformers import SentenceTransformer + +client = QdrantClient(url="http://localhost:6333") + +model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2") + +query = "What is vector search?" + +query_vector = model.encode(query).tolist() + +results = client.query_points( + collection_name="axion_demo", + query=query_vector, + limit=2 +) + +print("\nTop results:\n") + +for point in results.points: + print(point.payload["text"]) +``` + +### What this script does + +This script performs the following steps: + +- Connects to the Qdrant vector database +- Loads a pretrained transformer embedding model +- Converts the query into a vector embedding +- Performs similarity search against stored vectors +- Returns the most relevant documents + +## Run the search script + +Execute the search script. + +```bash +python3.11 search.py +``` + +The output is similar to: +```output +Vector databases enable semantic search. +Qdrant is optimized for vector similarity search. +``` + +This confirms that the system successfully retrieved the most semantically relevant documents. + +## Why semantic search is powerful + +Traditional search engines rely on keyword matching, which often fails when queries are phrased differently. + +Semantic search uses vector embeddings to capture meaning. + +| User Query | Retrieved Result | +| ----------------------- | ------------------------------------------------ | +| What is vector search? | Vector databases enable semantic search | +| Explain Qdrant | Qdrant is optimized for vector similarity search | +| How do embeddings work? | Vector databases enable semantic search | + +This allows applications to understand **intent rather than exact wording**. + +## What you've learned and what's next + +In this section, you learned how to: + +- Convert user queries into vector embeddings +- Query the Qdrant vector database +- Retrieve semantically relevant documents +- Understand how semantic similarity search works + +In the next section, you will extend this workflow to build a **chatbot-style knowledge retrieval system**, allowing users to interactively query the vector database using natural language.