Building a Modern RAG Pipeline in 2026: Qwen3 Embeddings and Vector Database in Qdrant.
From the publisher’s feed, collected in the ZeroLabs newsroom.
The ArXiv RAG Project, a scalable RAG Agent for ArXiv CS papers.Imagine chatting with an agent that has full access to all the scientific articles ever published on arxiv.com, and that can answer any question you ask with scientific rigor and validated references.This post belongs to The ArXiv RAG Project Series, in which I’m building a scalable RAG Agent for ArXiv Computer Science papers. You can check the project’s source code on GitHub.This very first post contains the technical implementation details and tools I’ve used to build an ETL pipeline that lays the foundations for the RAG Agent. The pipeline extracts the ArXiv metadata for over 500.000 papers from the ArXiv Dataset, computes its embeddings using the latest Qwen3-embedding-8b model (one of the strongest models available for RAG today), and finally loads everything into a Qdrant Vector DB that will serve as the query engine for the RAG Agent.ContentsIntroduction What is RAG (Retrieval Augmented Generation)? Text Embeddings and Document Embeddings Modern RAG techniques in 2026Overall Project StructureBuilding a CLI App PackageExtracting and Cleaning the DataComputing the Embeddings Preliminaries The OpenAI Batch API Managing Batch Requests with a Local SQLite Database Downloading the EmbeddingsStoring Embeddings in a Vector DB Docker Setup Creating Collections Ingesting 500k Vectors At ScaleWrap Up Next StepsIntroductionThe science field, and especially Computer Science, is evolving faster than ever. Every day new advancements are published and previous paradigms that were considered SOTA become quickly obsolete. AI newsletters are a good way to keep up to date with all this buzz, but they lack something vital to learning: Interactivity. ArXiv RAG not only aims to be a practical personal project, but also to provide a tool I can use on a daily basis to explore new topics and study concepts from the scientific literature, using trustworthy sources and updated information from the cutting edge of research.Note. If you are already familiar with RAG, text embeddings, and their concepts, skip to the next section where I start talking about the juicy implementation details.What is RAG (Retrieval Augmented Generation)?Retrieval Augmented Generation is a technique used in Large Language Models (LLM) that allows them to consult and extract useful information from documents or any other sources (Knowledge base) so that they can respond in an accurate and informed way.In a nutshell, RAG matches a Query q (input text) with every possible document or source from the Knowledge Base D and finds the top K most relevant ones. Finally, it includes the documents’ contents in the LLM context window alongside the original query, so the LLM has all the necessary information to elaborate a response. Research shows that using RAG improves performance by up to 30% or more on open-domain questions. However, where RAG systems excel is in closed domains, where private and specific data like the user’s history, the product description and current price or the company’s legal documents are needed to elaborate a proper response.RAG Diagram. Image by the author.Text Embeddings and Document EmbeddingsTo be able to match a query with a document, RAG needs to convert both into a numerical representation (computers work with numbers, not text). This is where the family of Embedding Models comes into the scene. Embedding Models are AI models trained to generate a vector representation from a chunk of text, aiming at capturing as much of the semantic meaning as possible from it.Vectors are a great representation for texts because we can compute distance metrics between them (Euclidean distance, Manhattan, Cosine similarity, …), getting a measure of how similar two vectors are. Embedding Models try to capture the text’s semantics by assigning closer vector representations to similar texts and vice versa.Text Embeddings. In the diagram, only single-word texts are represented, but in practice, larger sentences and paragraphs are used. Image by the author.Note. It is important to note that very large texts or documents can’t be converted into a single vector because of the limits of the Embedding Models (they can only convert up to a certain text length). In those cases text chunking techniques are applied to divide the large text/document into smaller meaningful pieces.Modern RAG techniques in 2026Since the term RAG was first coined by Lewis et al., 2020, a large number of advancements and techniques have emerged from the scientific literature.Note to myself, this is an excellent use case for ArXiv RAG. Repeat this experiment when the agent is finished and display the response below.According to Gemini 3:As of February 8, 2026, Retrieval-Augmented Generation (RAG) has moved far beyond simple "vector search + prompt." In the current landscape, the focus has shifted from static pipelines to agentic reasoning and structured knowledge. 1. The Three Modern ArchitecturesThe "standard" RAG pipeline has diverged into three specialized paths depending on the complexity of the data:- Agentic RAG (The "Researcher"): Instead of a fixed workflow, an LLM agent uses reasoning to plan its retrieval. It can decide to search multiple times, self-correct if the first results are poor, and use tools to browse the web or query specific databases.- GraphRAG (The "Connected" Approach): Combines vector search with Knowledge Graphs. It extracts entities and relationships from text, allowing the AI to answer "multi-hop" questions (e.g., "How is the CEO's recent strategy influenced by the 2024 acquisition?") that standard vector search usually misses.- Modular RAG (The "Toolkit"): A highly flexible architecture where modules (Reranker, Router, Search, Refiner) can be swapped or rearranged dynamically based on the query type.2. Advanced Retrieval & Processing TechniquesIf you are building or optimizing a system today, these are the "must-have" techniques:Hybrid Search & Reranking- Hybrid Search: Merging Semantic (Vector) search with Lexical (BM25/Keyword) search is now the baseline. This ensures you catch both "vibes" and exact technical terms/IDs.- Cross-Encoder Reranking: After retrieving the top 50-100 chunks, a smaller, high-precision model (like a BGE-Reranker) re-scores them to ensure the top 5 sent to the LLM are the absolute best.Context Optimization- Parent-Child Chunking: Storing small "child" chunks for high-precision retrieval but passing the larger "parent" context to the LLM to provide better background.- RAPTOR (Recursive Abstractive Processing): Recursively clustering and summarizing chunks at different levels, allowing the model to answer both granular and high-level thematic questions.- Contextual Retrieval: Pre-pending a short summary of the whole document to every individual chunk so that the "meaning" isn't lost when chunks are retrieved in isolation.3. Emerging "State-of-the-Art" (Early 2026)- State-Aware Retrieval: Systems that maintain a "retrieval plan" based on the user's conversation history and intent, rather than treating every query as a fresh start.- Multimodal RAG: Directly retrieving and reasoning over images, PDFs with complex tables, and video clips using unified embedding spaces (like CLIP or more modern 2025/26 vision-language models).- Long-Context RAG: With 2026 models supporting millions of tokens in context, RAG is no longer just for "finding" information but for filtering it. Modern RAG acts as a "curator" that stuffs the most relevant 100k tokens into the window to minimize cost and latency while maximizing accuracy.4. The 2026 ToolkitThe ecosystem has matured into several heavy-hitting frameworks:- Orchestration: LangChain (still dominant), LlamaIndex (data-centric), and Dify (visual/enterprise).- Evaluation: Ragas and Arize Phoenix are the standard for measuring "faithfulness" and "relevance" to prevent hallucinations.- Memory: Mem0, which provides a persistent, evolving memory layer for RAG agents to remember user preferences across sessions.In this project, I aim to combine some of these techniques, exploring Agentic RAG workflows with Hybrid Search and Reranking strategies.Overall Project StructureFirst things first, I want to clarify how I’m organizing this project as a multi-package repository, meaning that the GitHub repo is going to contain two or more code packages. For the moment, I’m only thinking of two packages: one for the pipeline and another for the agent, but in the future I might add new packages like a RESTful API or a frontend layer..├── LICENSE├── README.md├── pipeline # package 1│ ├── README.md│ ├── pyproject.toml│ ├── src/│ └── uv.lock└── agent # package 2 (yet to be published in the repo) ├── README.md ├── pyproject.toml ├── src/ └── uv.lockWhy multiple packages? I want to make a clear separation of concerns: The pipeline package will handle all the logic and resources necessary to build up the Knowledge Base, while the agent package will contain all the agent workflow, including the RAG mechanisms and LLM API calls. Each package has its own set of dependencies and execution profiles, with varying resource needs: pipeline will run most of the time (if not all) offline, scheduled to be executed every certain time to update the Knowledge Base, and will likely demand more memory to process the data; whereas agent will be running online every time the user is connected, waiting for an input and consuming less memory (though it will require from the resources of other services like the Vector DB and the LLM API). These arguments make up a good statement to build separate packages.Why use a single repo?Well, there is no need. And technically, if this were a final product or if I were working with other people, I wouldn’t do it. But I want to keep all the code centralized in a single place where I can share it and show it. One repo is easier to maintain than two.Note. This post focuses only on the building of the pipeline package. Future posts will deal with the agent.Building a CLI App Package"GitHub Repo files reference:"# /pipeline/src/pipeline/cli.pyEven though the pipeline package will run in offline mode, i.e. a scheduled cron job will spawn a new process and execute the scripts from the package. I want to give it a clean and intuitive interface to test and call the pipeline steps.For this project, I’m using the Typer library, a very convenient and easy-to-use Python library for building Command-Line Interface applications.CLI Pipeline App. Typer´s help guide. Image by the author.Extracting and Cleaning the Data"GitHub Repo files reference:"# /pipeline/src/pipeline/etl/extract.py# /pipeline/src/pipeline/etl/transform.pyThe Kaggle’s ArXiv Dataset contains metadata information about all the published papers in ArXiv since 25–04–1986. It is updated on a weekly basis and as of today’s date, it contains 2.938.427 articles from different science domains.First Dataset Rows from the Kaglle´s ArXiv Dataset. Image by the author.To narrow down the scope of the project, I’ve decided to only filter down some categories related to Computer Science, which left me with a bit over 560.000 articles.CATEGORIES = [ "cs.AI", # "Artificial Intelligence", "cs.CG", # "Computational Geometry", "cs.CL", # "Computational Language", "cs.CV", # "Computer Vision and Pattern Recognition", "cs.IR", # "Information Retrieval", "cs.LG", # "Machine Learning", "cs.MA", # "Multiagent Systems", "cs.NE", # "Neural and Evolutionary Computing", "cs.RO", # "Robotics"]The Extraction and Cleaning pipeline works in two stages, creating intermediate files to store the temporal results:Download metadata → data/kaggle/arxiv-metadata-oai-snapshot.jsonFilter categories and clean columns → data/interim/clean-arxiv-metadata-oai.parquetNote. To download the Kaggle dataset, you must use the Kaggle API for Python and identify yourself with a secret key that you have to generate in your Kaggle account.Because the original metadata file is really big (over 5GB), I’m using polars lazy scan to stream the file and process it using lazy evaluation. This is a crucial step to ensure the pipeline can run in lighter hardware settings and delegates the optimization process to polars.# /pipeline/src/pipeline/etl/transform.pylf = pl.scan_ndjson(source=self.file, schema=JSON_SCHEMA)Note that to make the process more efficient I even specify the file’s schema to save polars the overhead.Finally, I apply some basic preprocessing operations to the texts, like removing unnecessary new line characters \n and extra spaces, and formatting dates and authors so that the data is more suited for queries.# /pipeline/src/pipeline/etl/transform.py.with_columns( pl.col("title") .str.replace_all("\n", " ") .str.replace_all(r"\s+", " ") .str.strip_chars(), pl.col("abstract") .str.replace_all("\n", " ") .str.replace_all(r"\s+", " ") .str.strip_chars(), pl.col("authors_parsed").list.eval( pl.element().list.reverse().list.join(" ").str.strip_chars() ), pl.col("versions") .list.last() .struct.field("created") .str.to_datetime(format="%a, %d %b %Y %H:%M:%S GMT") .alias("last_submitted"),)Computing the Embeddings"GitHub Repo files reference:"# /pipeline/src/pipeline/embeddings.py# /pipeline/src/pipeline/schemas.py# /pipeline/src/pipeline/utils.py# /pipeline/src/pipeline/db/*With the dataset already downloaded and cleaned, it is time to compute the embeddings. To do so, I use the title and abstract columns from the dataset, concatenating them into a single text chunk:{TITLE}\n\n{ABSTRACT}PreliminariesBefore throwing myself into writing the code to compute the embeddings, I had to clear two important questions:Which Embedding Model to use?At the beginning of the project, I started exploring OpenAI text-embedding-3-small. However, it was later that I headed to the MTEB Leaderboard to see the latest model evaluations, and it turned out that the Qwen3-Embedding-8b is a much stronger model for RAG, supporting advanced RAG techniques such as Matryoshka Representative Learning (more on that in the next post), and with a reasonable price, so I finally opted to go with it.What model provider should I choose?Qwen3-Embedding is an open source model, meaning that I can download it and run it in any environment I want. However, I don’t have a powerful GPU at home, and although I could use a Cloud provider to rent one, the overhead of setting up the environment and optimizing the serving process to get the embeddings in a reasonable amount of time was too much trouble. In the end, I opted to use Nebius.com because of its reasonable price ($0.01 / 1M Tokens In) and compatibility with the OpenAI Python API (which I had already started to use with my previous tests)The OpenAI Batch APICalling the API to compute the embedding for one text is very straightforward. Doing it again for a couple of hundreds or thousands of texts is fine. But computing +500.000 embeddings isn’t that easy.You have to deal with the requests and token limits, which in most cases are insufficient for this amount of texts. And then you have to also set up a well engineered mechanism to parse and store all of the responses on the flow, implementing asynchronous steps nicely, handling errors and retires, and ensuring your memory is not going to overflow on the process. The second is not much a big issue but a technical challenge that can be addressed. However, because of the API limits, getting +500k embeddings require an indecent amount of time, and it is not a solution that is going to scale well (imagine doing so for the entire ArXiv dataset). The alternative, and proper way to calculate embeddings for large bodies of text, is to use the Batch API, which processes all the requests offline and has very large rate limits that aren’t restricted by time.Batch API. Requests are grouped in JSONL files up to a certain file size limit and sent to the API. Responses can take up to 24h. Image by the author.Each line of the Batch file contains a JSON object with all the information for the request, like the API endpoint to reach, the model selected and the input texts.{"custom_id": "batch-0001-0001-request-00001", "method": "POST", "url": "/v1/embeddings", "body": {"model": "Qwen/Qwen3-Embedding-8B", "input": ["Pareto and Boltzmann-Gibbs behaviors in a deterministic multi-agent system\n\nA deterministic system of interacting agents is considered as a model for economic dynamics. The dynamics of the system is described by a coupled map lattice with near neighbor interactions. The evolution of each agent results from the competition between two factors: the agent's own tendency to grow and the environmental influence that moderates this growth. Depending on the values of the parameters that control these factors, the system can display Pareto or Boltzmann-Gibbs statistical behaviors in its asymptotic dynamical regime. The regions where these behaviors appear are calculated on the space of parameters of the system. Other statistical properties, such as the mean wealth, the standard deviation, and the Gini coefficient characterizing the degree of equity in the wealth distribution are also calculated on the space of parameters of the system.", "On the Effects of Idiotypic Interactions for Recommendation Communities in Artificial Immune Systems\n\nIt has previously been shown that a recommender based on immune system idiotypic principles can out perform one based on correlation alone. This paper reports the results of work in progress, where we undertake some investigations into the nature of this beneficial effect. The initial findings are that the immune system recommender tends to produce different neighbourhoods, and that the superior performance of this recommender is due partly to the different neighbourhoods, and partly to the way that the idiotypic effect is used to weight each neighbours recommendations.",...]}}Note that the Batch files have also some constraints. According to Nebius Batch API docs, each file can be up to 10GB size or 5.000.000 requests. The texts to encode cannot exceed the maximum model’s context length, which for Qwen3-Embedding-8b is 41k token context. And a a maximum tokens per request (TPR) is usually enforced (note that multiple texts can be sent in a single request). Although I haven’t been able to find an specific TPR limit in Nebius, I know from other providers like OpenAI that they allow a maximum of 300.000 TPR accross all texts. So far the limits you need to consider when using the Batch API are:Batch API Limits. Image by the author.Note. One interesting thing I’ve found during my tests with the OpenAI API is that they estimate the number of tokens using a 0.25 tokens per utf-8 byte formula. This can led to API limit errors if you measure the tokens using other more accurate libraries like tiktoken, so make sure you use a slightly smaller limit.Using the Batch API requires to store and manage files, IDs, statuses and other important information. In the next subsection I explain how I leverage a Local SQLite Database to deal with all this data and maintain a record of every batch so that later I can consult its status and download the reponses.Managing Batch Requests with a Local SQLite DatabaseAn important aspect when working with the Batch API is to keep track of the batch IDs and statuses. While all the processing and individual requests are handled on the provider’s side, you still have to check the status and download the response files using the provided IDs. Instead of relying in plain files, I’ve decided to set up a simlpe SQLite Database to store this information, so that I can regularly query and update each batch.Relational Diagram for the SQLite Database. Image by the author.This new feature comes at an additional cost, as now, in addition to creating the database models, I also have to manage connections and implement CRUD operations. For this purpose I chose SQLAlchemy as it is the classic industry ORM standard. To have greater control over the data handled by the application, I have also created different schemas with built-in validation using Pydantic. You can check all of this in /pipeline/src/pipeline/db/* and /pipeline/src/pipeline/schemas.py.The Job entity represents a pipeline call that processes multiple texts from a given file. When submitting a new Job, the BatchManager creates the different Batches based on the API limits. Then, the files are uploaded to the providers’ servers via the API, and finally a batch requests pointing to those files is sent.compute-embeddings. Creating and sending Batch API requests for a test with 50.000 texts, console output. Image by the author.After submitting the Batch requests, I’ve created a command check-embeddings-status that displays a summary table that refreshes every minute with all the batch statuses and relevant information. This command also updates the statuses from the SQLite database.check-embeddings-status. Summary table with the status for each Batch Request from Job 9. Because the TPR is very high and the texts are quite short (title + abstract) many texts can fit within a single request. In total, this batch has 59 requests. Image by the author.Downloading the EmbeddingsOnce all the batches from a given Job are completed, it is time to download and parse the results.This is also a very crucial step, since for each text we’ve submitted we are getting a 4.096 float32 vector. Thus, the response files are x8 or even x10 times the size of their respective requests, and memory resources can be exhausted very easily.To address the potential memory issues I’ve implemented streaming pipelines and file batch processing.# /pipeline/src/pipeline/embeddings.py# Line 597. Streaming the response file to a local file.# Stream OAI file to localwith client.files.with_streaming_response.content(fout) as content: with open(fnew, "wb") as f: for chunk in content.iter_bytes(): f.write(chunk)Sorting Request within each Batch: Sorted Maps VS File SortingA quiet annoying downside of working with the Batch API is that the Batch Response files aren’t sorted in the same order as the original requests, i.e. the output line order may not match the input line order. According to the docs: ”Instead of relying on order to process your results, use the custom_id which will be present in each line of your output file and allow you to map requests in your input to results in your output.”.However, because I new I was going to parse the output file line by line to extract the embeddings, I decided to use a sorted map pattern: Instead of sorting the entire file by copying and pasting each line to a new “sorted_file.jsonl”, I create a list of ordered tuples with the values (custom_id, line_position) that later the parsing function will use to parse the results in the correct order. This method not only saves the overhead to create and write to new files (one per Batch) but also is a lot more efficient, since the custom_id appears at the beginning of every line in the batch response, I don’t need to parse an entire 100+ MB line (each one packed with multiple 4019-dimensional arrays) but only read a tiny small fraction of it, more specifically 500 bytes.Sorted Map Diagram. Note that the line positions (offset) are specified in bytes. Image by the authorFrom JSONL to RAW to NPYThe API response files come in JSONL format. However, although this file type is great for HTTP responses, it isn’t the most efficient one to store the vector embeddings. Ideally, I decided to use a single .npy file, which for +500k vectors is fine. But there was a problem with it: .npy files force you to define the dimensions of the data beforehand when creating the file, so I couldn't add more vectors on the fly. For this reason the whole download process looks like:Download. Stream download the JSONL files to local.Sort. Sort requests within each batch.Parse. Parse the JSONL files line by line extracting the embeddings in the correct order and appending them into a single .raw file (during this step I also count the total number of vectors since I have to iterate over them one by one).To NPY. Stream the .raw file to a .npy file in 100MB chunks.get-embeddings. Console output. Image by the author.With the data cleaned and embedded, the next step is building the query engine for the RAG agent. At this stage, performance and efficiency become critical: ingestion pipelines must be optimized to handle +500k datapoints without bottlenecks, and infrastructure choices directly impact scalability. These are the Qdrant setup and methods I’ve built.Storing Embeddings in a Vector DB"GitHub Repo files reference:"# /pipeline/compose.yaml# /pipeline/src/pipeline/etl/load.pyWhat is a Vector DB?A Vector Database is a special type of database built to store and search vectors. Unlike relational databases, which store the data as records (rows), vector databases store data as points, where the coordinates are defined by the vector and a payload with the metadata (fields) is linked to it. Vector databases are optimized to compare vectors efficiently, more specifically compute the distances or similarities between them (Euclidean, Manhattan, Cosine, …) This is useful for tasks like semantic search, recommendation systems, or finding similar images. Because running these operations among hundreds of thousands or even millions and billions of vectors is usually prohibitively expensive, vector databases use specialized indexing algorithms such as Approximate Nearest Neighbors (ANN), which trade a small amount of accuracy for much faster search. It is important to note that although vector databases are powerful for similarity search, they are not meant to replace relational databases. They are not optimized for complex joins, heavy transactions, or traditional reporting queries.Why Qdrant?Qdrant is one of the top Open Source vector databases for AI and semantic search. Written in Rust, it optimizes every byte of memory and performs operations blazingly fast. Qdrant not only offers a managed Cloud service, but because it is OS you can host it and run it on any machine you want without any additional cost.Note. This post hasn’t been sponsored by Qdrant.Docker SetupSetting up a Docker container for Qdrant is very straightforward. The only two things to keep in mind are:Configuring the volumes to store the data (otherwhise the data won’t be persistent and will be lost once the container is restarted or stoped)Enabling API Key Authentication by adding the QDRANT__SERVICE__API_KEY envvar.services: qdrant: image: qdrant/qdrant:latest restart: always container_name: qdrant ports: - 6333:6333 - 6334:6334 volumes: - ./qdrant_data:/qdrant/storage environment: - QDRANT__SERVICE__API_KEY=${QDRANT_API_KEY} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:6333/healthz"] interval: 30s timeout: 10s retries: 3 networks: - qdrant-networknetworks: qdrant-network: driver: bridgevolumes: qdrant_data:Note. Qdrant exposes two ports 6333 and 6334 since it supports two different communication protocols: 6333 is for HTTP/HTTPS and 6334 for gRPC, a high-performance binary protocol developed by Google for high-speed data ingestion. Qdrant client libraries normally use the gRPC port while the 6333 port serves the Web UI and other lighter checks like manual data checks or health checks.Qdrant also has the option to enable TLS certificates so that all requests are redirected through HTTPS. This is very important for production environments in which otherwise the API Key will be exposed. However, note that if you use a reverse proxy like Traefik or Nginx to route all the traffic to the server, you don’t need to worry about this, since you can handle the TLS security check at the proxy level.Finally, Qdrant exposes a Web UI at {URL}:6333/dashboard for the users to visualize and manage the data.Qdrant Web UI. In local development {URL} = http://localhost. Image by the author.Creating CollectionsQdrant stores points (vectors with a payload) in Collections.“A collection is a named set of points among which you can search. The vector of each point within the same collection must have the same dimensionality and be compared by a single metric.”You can create collections directly from the Web UI. However, this isn’t ideal since later you wouldn’t be able to quicly recreate the same setup. Instead I’ve used Qdrant’s Python client library:# /pipeline/src/pipeline/etl/load.pyfrom qdrant_client import QdrantClient, models...class QdrantLoader: def __init__(self): self.client = QdrantClient( url=config("QDRANT_URL"), api_key=config("QDRANT_API_KEY") ) self._embeddings = None self._metadata = None def create_collection(self, name: str, emb_dim: int, recreate: bool = False): if recreate: self.client.delete_collection(collection_name=name) logger.info(f"🧹 Removed '{name}' collection") self.client.create_collection( collection_name=name, vectors_config=models.VectorParams( size=emb_dim, distance=models.Distance.COSINE, on_disk=True ), quantization_config=models.BinaryQuantization( binary=models.BinaryQuantizationConfig(always_ram=True) ), optimizers_config=models.OptimizersConfigDiff( max_segment_size=60_000 # ~1/8 of the total number of vectors ), hnsw_config=models.HnswConfigDiff( m=0, # Disable indexing for for upload. NOTE. Make sure to enable indices after upload on_disk=False, # Keep indices always on RAM ), ) ...Note that in order to create the collection, I need to fix the vector size (in this case 4096 for Qwen3 embeddings) and the distance metric (Cosine Similarity) Because I’ll be performing a bulk upload of a large number of points, I temporarily disable indexing. This significantly speeds up the ingestion process and makes the upload much more efficient.Ingesting 500k Vectors At ScaleThe Qdrant Python library has various methods for large-scale data ingestion. Because I want to make this project as scalable as possible up to millions of points, I use .upload_collection.# /pipeline/src/pipeline/etl/load.py class QdrantLoader: ... def load_vectors( self, job_id: int, collection: str, chunk_size: int = 10_000, recreate: bool = False, ): if not self._check_job_status(job_id): return if recreate: current_collection = self.client.get_collection(collection) emb_dim = current_collection.config.params.vectors.size self.create_collection(collection, emb_dim, recreate=True) total_points = self._init_resources(job_id) logger.info( f"Loading {total_points} vectors into '{collection}' Qdrant collection..." ) for offset in range(0, total_points, chunk_size): end = min(offset + chunk_size, total_points) vectors, metadata = self._download_chunk(job_id, offset, end) self.client.upload_collection( collection_name=collection, vectors=vectors, payload=metadata.collect().to_dicts(), ids=tqdm.tqdm(range(offset, end)), batch_size=256, parallel=os.cpu_count(), ) # Update indices self.client.update_collection( collection, hnsw_config=models.HnswConfigDiff(m=16, on_disk=False), )One important step to bear in mind is that self._download_chunk() returns a tuple of iterators instead of loading into memory the whole chunk of vectors + metadata. This approach ensures that the RAM usage stays low.Finally, I enable the indices after the upload is completed. Note that they might take some time to fully propagate across all points.Qdrant arxiv-rag Collection from the Web UI. The graph displays the top 5 nearest points according to their Cosine Similarity. Image by the author.Wrap UpImplementing the foundational layer of the ArXiv RAG project has been a challenging and funny journey. Not only I have learned the intricacies and functioning of the Batch API, but I have also implemented memory-efficient pipelines to create and read files while keeping track of records in an in-memory SQLite database.The key takeaways from this phase have been:The Power of Batching: Mastering the Batch API has been a game-changer for cost and rate-limit management.Lazy DataFrames and File reading efficiency: Harnessing Polars Lazy DataFrames and using patterns like map-sorted or batch file reading greatly reduced the memory consumption and made the project scalable and resilient.Keeping track with SQLite: Although it brought more complexity to the project, implementing the SQLite storage helped make it more robust and production-ready.Qdrant experience: Working with Qdrant’s client has been a smooth and enjoyable experience. It just simply works, and it is really fast. I will definitely recommend it for future projects.Next StepsA RAG system is only as good as its retrieval accuracy. In the next posts in the series, I’ll be implementing and sharing the techniques and design choices that transform a basic pipeline into a truly capable RAG agent. From evaluating the embedding quality to more refined retrieval and reasoning patterns, I’ll be building a production-grade RAG Agent in 2026 that scales and works. Stay tuned and enjoy life!✅ Phase I: Knowledge Base⬜ Phase II: The Retrieval Engine. Evaluating embedding quality, implementing Hybrid Search, and the first RAG Agent prototype.⬜ Phase III: Agentic RAG. Moving from simple retrieval to autonomous reasoning.⬜ Phase IV: Deployment and Scaling.Hi, I’m Gabriel Furnieles, a Mathematical Engineer specializing in Artificial Intelligence, Data Pipelines, and Software Engineering. If you’ve made it this far, thank you very much for reading the article. I hope you enjoyed it and found it helpful. If so, please consider following me Gabriel Furnieles, and subscribing to my newsletter so stories will be sent directly to you! 👇Gabriel Furnieles - MediumBuilding a Modern RAG Pipeline in 2026: Qwen3 Embeddings and Vector Database in Qdrant. was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.