<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tanisha Khakhrani</title>
    <description>The latest articles on DEV Community by Tanisha Khakhrani (@tanisha_050).</description>
    <link>https://dev.to/tanisha_050</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4131606%2F7abbbb20-c4b8-447e-a318-2c011498541d.jpg</url>
      <title>DEV Community: Tanisha Khakhrani</title>
      <link>https://dev.to/tanisha_050</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanisha_050"/>
    <language>en</language>
    <item>
      <title>AI Without Sending Your Data Away: A Guide to Local LLMs</title>
      <dc:creator>Tanisha Khakhrani</dc:creator>
      <pubDate>Thu, 22 Oct 2026 07:19:53 +0000</pubDate>
      <link>https://dev.to/addwebsolutionpvtltd/ai-without-sending-your-data-away-a-guide-to-local-llms-15dl</link>
      <guid>https://dev.to/addwebsolutionpvtltd/ai-without-sending-your-data-away-a-guide-to-local-llms-15dl</guid>
      <description>&lt;p&gt;“Like with all technological revolutions, I expect there to be significant impact on jobs, but exactly what that impact looks like is very difficult to predict…I think it’s important to understand and think about GPT-4 as a tool, not a creature.” - Sam Altman&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Local LLMs run inference on hardware controlled by the user or organization, reducing the need to send prompts and documents to a remote inference service.&lt;/li&gt;
&lt;li&gt;Local deployment can provide greater control over data, infrastructure, customization, and network dependency.&lt;/li&gt;
&lt;li&gt;Model size has a major impact on hardware requirements; smaller models can run on consumer devices while larger models require substantial GPU memory or distributed infrastructure.&lt;/li&gt;
&lt;li&gt;Quantization reduces model memory requirements by representing weights with fewer bits, making larger models practical on constrained hardware.&lt;/li&gt;
&lt;li&gt;Tools such as Ollama, LM Studio, and Hugging Face make local-model experimentation accessible to developers.&lt;/li&gt;
&lt;li&gt;Local AI does not automatically guarantee security. Network exposure, model provenance, access controls, logging, and the applications surrounding the model still need to be secured.&lt;/li&gt;
&lt;li&gt;The best model is not necessarily the largest model; the correct choice depends on the task, latency requirements, available hardware, and quality requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Table of Content
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Introduction &lt;/li&gt;
&lt;li&gt;Understanding Local LLMs 

&lt;ul&gt;
&lt;li&gt;What Is a Local LLM? &lt;/li&gt;
&lt;li&gt;Local LLM vs. Cloud LLM&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Why Run an LLM Locally? 

&lt;ul&gt;
&lt;li&gt;Data Privacy and Control &lt;/li&gt;
&lt;li&gt;Offline Operation &lt;/li&gt;
&lt;li&gt;Customization &lt;/li&gt;
&lt;li&gt;Latency and Infrastructure Control&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Open-Weight Models and the Local AI Ecosystem &lt;/li&gt;
&lt;li&gt;Model Size and Hardware Requirements &lt;/li&gt;
&lt;li&gt;Understanding Quantization &lt;/li&gt;
&lt;li&gt;Popular Tools for Running Local LLMs &lt;/li&gt;
&lt;li&gt;Setting Up a Local LLM with Ollama 

&lt;ul&gt;
&lt;li&gt;Install Ollama &lt;/li&gt;
&lt;li&gt;Download a Model &lt;/li&gt;
&lt;li&gt;Test the Model &lt;/li&gt;
&lt;li&gt;Integrate the Model into an Application&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Security and Practical Considerations &lt;/li&gt;
&lt;li&gt;Statistics &lt;/li&gt;
&lt;li&gt;Interesting Facts &lt;/li&gt;
&lt;li&gt;FAQs &lt;/li&gt;
&lt;li&gt;Conclusion &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Large Language Models (LLMs) have quickly become practical tools for writing, coding, summarization, research, automation, and application development. Cloud-based services make this capability easy to access, but they also introduce an important question: where does the data go when we use an AI model?&lt;/p&gt;

&lt;p&gt;For developers and organizations working with source code, internal documents, customer information, business strategies, or other confidential material, sending every prompt to an external service may not always be appropriate. This is where Local LLMs become valuable.&lt;/p&gt;

&lt;p&gt;A Local LLM runs on hardware controlled by the user or organization rather than requiring every inference request to be processed by a remote AI service. Tools such as Ollama and LM Studio have made this approach significantly easier, allowing developers to download models and interact with them directly from their own machines. LM Studio, for example, states that downloaded models can run completely offline and that messages and documents processed locally do not leave the device. &lt;/p&gt;

&lt;p&gt;However, local deployment is not simply a matter of downloading a model and pressing "run." Hardware, model size, quantization, inference speed, security, model licensing, and application architecture all need to be considered.&lt;/p&gt;

&lt;p&gt;This article explains what Local LLMs are, why organizations may use them, how open-weight models work, how hardware requirements affect model selection, what quantization means, and how to get started with tools such as Ollama and LM Studio.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Understanding Local LLMs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;2.1 What Is a Local LLM?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Local Large Language Model (LLM) is a language model whose inference process runs on hardware controlled by the user or organization.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;strong&gt;Application → Internet → Cloud AI Provider → Response&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a local deployment can look like:&lt;br&gt;
&lt;strong&gt;Application → Local Runtime → Local Model → Response&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The model's weights are downloaded to the machine, and the computation required to generate a response takes place locally.&lt;/p&gt;

&lt;p&gt;This makes Local LLMs particularly interesting for applications where developers want tighter control over the data-processing environment.&lt;/p&gt;

&lt;p&gt;It is important to distinguish local execution from simply using an open-source model. A model can have publicly available or open weights while still being hosted remotely. Conversely, an open-weight model can be downloaded and executed entirely on local infrastructure.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Generative models are changing the way we think about machine intelligence and creativity, and have the potential to transform industries from media to finance to healthcare.” - Oriol Vinyals&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;2.2 Local LLM vs. Cloud LLM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The fundamental difference is where inference takes place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd6ftic58icq1272az230.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd6ftic58icq1272az230.png" alt=" " width="567" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Neither approach is universally better.&lt;/p&gt;

&lt;p&gt;Cloud LLMs are convenient and can provide access to extremely capable models without requiring expensive hardware. Local LLMs become attractive when data control, offline operation, customization, predictable infrastructure, or local processing are important.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Artificial intelligence is the new electricity.” - Andrew Ng&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The comparison is therefore less about replacing cloud AI completely and more about choosing the right deployment model for the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why Run an LLM Locally?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;3.1 Data Privacy and Control&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the strongest reasons for local inference is control over sensitive information.&lt;/p&gt;

&lt;p&gt;Consider an organization developing an internal application. Its employees may need AI assistance while working with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Source code&lt;/li&gt;
&lt;li&gt;Internal documentation&lt;/li&gt;
&lt;li&gt;Product specifications&lt;/li&gt;
&lt;li&gt;Business strategies&lt;/li&gt;
&lt;li&gt;Customer information&lt;/li&gt;
&lt;li&gt;Research documents&lt;/li&gt;
&lt;li&gt;Proprietary processes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With a local model, these inputs can remain within the organization's infrastructure.&lt;/p&gt;

&lt;p&gt;However, local does not automatically mean secure. The application can still expose data through APIs, network services, logs, telemetry, plugins, or poorly configured infrastructure. Security therefore needs to cover the entire system, not just the model.&lt;/p&gt;

&lt;p&gt;Cloud services can also provide strong privacy controls. For example, OpenAI states that data from its business products and API platform is not used to train its models by default, while API abuse-monitoring logs may be retained for a limited period under default settings. &lt;a href="https://openai.com/business-data/" rel="noopener noreferrer"&gt;OpenAI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The important lesson is that organizations should evaluate the actual data policy and deployment architecture rather than assuming that every cloud service handles data in the same way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.2 Offline Operation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the model and required runtime files have been downloaded, local inference can continue without an internet connection.&lt;/p&gt;

&lt;p&gt;LM Studio explicitly supports completely offline operation for downloaded models, including local document processing and running a local server. &lt;/p&gt;

&lt;p&gt;This can be useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Air-gapped environments&lt;/li&gt;
&lt;li&gt;Locations with unreliable connectivity&lt;/li&gt;
&lt;li&gt;Development without API dependencies&lt;/li&gt;
&lt;li&gt;Internal systems where external network access is restricted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is one obvious limitation: a local model still requires electricity and functioning hardware. Offline does not mean independent of physical infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.3 Customization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open-weight models can provide developers with more control over how an AI system is deployed and adapted.&lt;/p&gt;

&lt;p&gt;Depending on the model's license and capabilities, developers may be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fine-tune a model&lt;/li&gt;
&lt;li&gt;Modify inference parameters&lt;/li&gt;
&lt;li&gt;Create custom prompts&lt;/li&gt;
&lt;li&gt;Build retrieval-augmented applications&lt;/li&gt;
&lt;li&gt;Run specialized workflows&lt;/li&gt;
&lt;li&gt;Integrate the model into internal applications&lt;/li&gt;
&lt;li&gt;Keep the inference pipeline under organizational control&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;OpenAI's gpt-oss models, for example, are open-weight models designed to run on infrastructure controlled by the user and are released under Apache 2.0, subject to the applicable usage policy. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.4 Latency and Infrastructure Control&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Local inference can eliminate the network round trip between an application and a remote model server.&lt;/p&gt;

&lt;p&gt;For applications running close to the model, this can reduce network-related latency and make the system less dependent on external service availability.&lt;/p&gt;

&lt;p&gt;However, local does not always mean faster.&lt;/p&gt;

&lt;p&gt;A small cloud model running on powerful infrastructure can be considerably faster than a large model running on a CPU-only laptop. Performance depends on model size, quantization, hardware, context length, batch size, runtime, and workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Open-Weight Models and the Local AI Ecosystem
&lt;/h2&gt;

&lt;p&gt;Modern Local LLM ecosystems depend heavily on open-weight models.&lt;br&gt;
Model weights are the numerical parameters learned during training. They contain much of the information required for the model to perform inference.&lt;/p&gt;

&lt;p&gt;When model weights are made available for download, developers can obtain those weights and run the model using compatible inference software.&lt;/p&gt;

&lt;p&gt;This has helped create an ecosystem involving:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model developers&lt;/li&gt;
&lt;li&gt;Open-weight model releases&lt;/li&gt;
&lt;li&gt;Model repositories&lt;/li&gt;
&lt;li&gt;Inference runtimes&lt;/li&gt;
&lt;li&gt;Quantization formats&lt;/li&gt;
&lt;li&gt;Desktop applications&lt;/li&gt;
&lt;li&gt;Developer APIs&lt;/li&gt;
&lt;li&gt;Community tooling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hugging Face's Model Hub, for example, provides a central repository for discovering, storing, downloading, and sharing model checkpoints.&lt;/p&gt;

&lt;p&gt;Some notable model families available for local experimentation include Qwen3, Gemma 3, Llama-family models, Phi models, and OpenAI's gpt-oss.&lt;/p&gt;

&lt;p&gt;As an example, Ollama currently lists Qwen3 variants ranging from 0.6B to 235B parameters, while Gemma 3 is available in sizes from 270M to 27B parameters. &lt;/p&gt;

&lt;p&gt;OpenAI's gpt-oss family currently includes gpt-oss-20b and gpt-oss-120b, with the models designed for infrastructure controlled by the developer or organization. &lt;a href="https://help.openai.com/en/articles/11870455-openai-open-weight-models-gpt-oss" rel="noopener noreferrer"&gt;OpenAI Help Center&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The availability of many model sizes is important because local AI is not one-size-fits-all.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Generative AI is teaching us that the way you speak is actually code itself.” - Lisa Huang&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  5. Model Size and Hardware Requirements
&lt;/h2&gt;

&lt;p&gt;A model's parameter count is one of the major factors affecting its memory requirements.&lt;br&gt;
A simplified progression looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk8g2urq7zz9ra59mbuqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk8g2urq7zz9ra59mbuqo.png" alt=" " width="573" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*These are rough planning ranges rather than strict hardware requirements. Actual memory consumption depends on precision, quantization, context length, runtime overhead, and whether CPU RAM is also used.&lt;/p&gt;

&lt;p&gt;Real model packages illustrate the difference clearly. Ollama currently lists Qwen3 4B at around 2.5 GB, Qwen3 8B at around 5.2 GB, Qwen3 14B at around 9.3 GB, and Qwen3 32B at around 20 GB for listed variants. &lt;/p&gt;

&lt;p&gt;Gemma 3 similarly ranges from small models to a 27B model, with Ollama listing the 27B variant at around 17 GB for its current package. &lt;/p&gt;

&lt;p&gt;This is why developers should select a model based on the task and available hardware, rather than simply choosing the model with the highest parameter count.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Understanding Quantization
&lt;/h2&gt;

&lt;p&gt;Running a large model at full numerical precision can require significant memory.&lt;/p&gt;

&lt;p&gt;Quantization addresses this problem by representing model weights using fewer bits.&lt;/p&gt;

&lt;p&gt;For example, instead of representing weights using higher-precision numerical formats, a model can be converted to a 4-bit representation.&lt;/p&gt;

&lt;p&gt;The result is a substantially smaller model that can often run on hardware that would not have enough memory for the original version.&lt;br&gt;
A simplified workflow is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full-precision model → Quantization → Smaller model representation → Lower memory requirement → Local inference&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example, Ollama lists Qwen3 4B variants using formats such as Q4_K_M, with the listed 4B model around 2.5 GB. &lt;/p&gt;

&lt;p&gt;Quantization is not magic, however. Lower precision can introduce quality degradation depending on the model, quantization method, task, and configuration.&lt;/p&gt;

&lt;p&gt;Therefore, the right approach is to benchmark the quantized model on the actual workload rather than assuming that every 4-bit model will behave identically to its full-precision counterpart.&lt;/p&gt;

&lt;p&gt;A useful rule is:&lt;br&gt;
&lt;strong&gt;Use the smallest model and lowest precision that still provide acceptable quality for your application.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Aristotle founded or discovered logic by observing the world. ChatGPT thinks logically. Why? Because it notices all the logic in the data in its training set.” - Stephen Wolfram&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7. Popular Tools for Running Local LLMs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;7.1 Ollama&lt;/strong&gt;&lt;br&gt;
Ollama is one of the simplest ways to run local LLMs from the command line.&lt;/p&gt;

&lt;p&gt;A developer can download a supported model and start interacting with it using a command such as:&lt;/p&gt;

&lt;p&gt;ollama run qwen3:4b&lt;/p&gt;

&lt;p&gt;Ollama also exposes APIs that applications can use to communicate with locally running models. Its model library currently includes Qwen3, Gemma 3, and many other model families. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.2 LM Studio&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LM Studio provides a graphical interface for downloading and interacting with local models.&lt;/p&gt;

&lt;p&gt;It can also run a local API server, allowing applications to communicate with models through REST APIs and OpenAI-compatible endpoints. &lt;/p&gt;

&lt;p&gt;One of its useful characteristics is offline operation. After the required model files are available, local chatting, document processing, and local inference can work without an internet connection. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.3 Hugging Face&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hugging Face is not primarily an inference application like Ollama or LM Studio. Instead, it acts as a major ecosystem for discovering and sharing models, datasets, and other machine-learning resources.&lt;/p&gt;

&lt;p&gt;Its Model Hub provides repositories containing model checkpoints and supports downloading models through tools such as huggingface_hub. &lt;br&gt;
&lt;a href="https://huggingface.co/docs/hub/en/models-the-hub" rel="noopener noreferrer"&gt;Hugging Face&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The three tools therefore serve somewhat different purposes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbszmthrqa44r5o1zx3mq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbszmthrqa44r5o1zx3mq.png" alt=" " width="420" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Setting Up a Local LLM with Ollama
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;8.1 Install Ollama&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On Linux, Ollama provides an installation command:&lt;br&gt;
curl -fsSL &lt;a href="https://ollama.com/install.sh" rel="noopener noreferrer"&gt;https://ollama.com/install.sh&lt;/a&gt; | sh&lt;br&gt;
After installation, verify that Ollama is available from the terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.2 Download a Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
ollama run qwen3:4b&lt;br&gt;
or:&lt;br&gt;
ollama run gemma3:8b&lt;/p&gt;

&lt;p&gt;The exact model tags available can change, so developers should check the current model library before using a command in production. Ollama currently lists Qwen3 4B and Gemma 3 variants in its model library. &lt;a href="https://ollama.com/library/qwen3" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a lightweight experiment, a smaller model such as Qwen3 4B can be a reasonable starting point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.3 Test the Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the model starts, provide a simple prompt:&lt;br&gt;
Explain REST APIs in simple terms.&lt;/p&gt;

&lt;p&gt;Then test more application-specific workloads:&lt;br&gt;
Summarize this technical document.&lt;/p&gt;

&lt;p&gt;or:&lt;br&gt;
Extract the action items from this meeting transcript.&lt;/p&gt;

&lt;p&gt;Testing should not only measure whether the model produces an answer. It should also evaluate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accuracy&lt;/li&gt;
&lt;li&gt;Response time&lt;/li&gt;
&lt;li&gt;Memory usage&lt;/li&gt;
&lt;li&gt;Hallucination rate&lt;/li&gt;
&lt;li&gt;Output consistency&lt;/li&gt;
&lt;li&gt;Behavior with long context&lt;/li&gt;
&lt;li&gt;Performance on the actual application workload&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;8.4 Integrate the Model into an Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next step is to connect the local model to an application.&lt;br&gt;
A typical architecture can be represented as:&lt;br&gt;
User&lt;br&gt;
  │&lt;br&gt;
  ▼&lt;br&gt;
Application&lt;br&gt;
  │&lt;br&gt;
  ▼&lt;br&gt;
Local API&lt;br&gt;
  │&lt;br&gt;
  ▼&lt;br&gt;
Inference Runtime&lt;br&gt;
  │&lt;br&gt;
  ▼&lt;br&gt;
Local LLM&lt;br&gt;
  │&lt;br&gt;
  ▼&lt;br&gt;
Response&lt;/p&gt;

&lt;p&gt;The application can therefore treat the local model as an internal AI service.&lt;/p&gt;

&lt;p&gt;LM Studio, for example, provides OpenAI-compatible local endpoints, which can make integration easier for applications already designed around common LLM APIs. &lt;a href="https://lmstudio.ai/docs/developer/core/server" rel="noopener noreferrer"&gt;LM Studio&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“As this technology continues to evolve, it is essential to leverage its power responsibly and ensure its positive impact on society.” - Mohith Agadi&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  9. Security and Practical Considerations
&lt;/h2&gt;

&lt;p&gt;Local deployment solves some privacy problems, but it introduces responsibilities that a developer must not ignore.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.1 Protect the Local API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If an LLM server is bound only to localhost, it is generally accessible only from the same machine.&lt;/p&gt;

&lt;p&gt;If it is exposed to a wider network, authentication and network controls become important. LM Studio specifically warns that binding its server beyond localhost exposes it to other devices and recommends authentication when doing so. &lt;a href="https://lmstudio.ai/docs/developer/core/server/serve-on-network" rel="noopener noreferrer"&gt;LM Studio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.2 Secure Model Files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Model weights should be obtained from trusted sources.&lt;/p&gt;

&lt;p&gt;A downloaded model is software infrastructure, and organizations should consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model provenance&lt;/li&gt;
&lt;li&gt;License&lt;/li&gt;
&lt;li&gt;Hashes or integrity checks&lt;/li&gt;
&lt;li&gt;Repository reputation&lt;/li&gt;
&lt;li&gt;Security policies&lt;/li&gt;
&lt;li&gt;Allowed commercial usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;9.3 Monitor Resource Usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A model that works well on a development machine may behave differently under production workloads.&lt;/p&gt;

&lt;p&gt;Monitor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU usage&lt;/li&gt;
&lt;li&gt;GPU utilization&lt;/li&gt;
&lt;li&gt;RAM/VRAM usage&lt;/li&gt;
&lt;li&gt;Request latency&lt;/li&gt;
&lt;li&gt;Concurrent requests&lt;/li&gt;
&lt;li&gt;Context length&lt;/li&gt;
&lt;li&gt;Disk usage&lt;/li&gt;
&lt;li&gt;Power consumption&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;9.4 Evaluate Before Deployment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A local model should be tested against real application examples before being considered production-ready.&lt;/p&gt;

&lt;p&gt;For example, a summarization model should be evaluated against representative documents rather than a handful of simple prompts.&lt;/p&gt;

&lt;p&gt;The goal is not merely:&lt;br&gt;
&lt;strong&gt;"Does the model answer?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;but:&lt;br&gt;
&lt;strong&gt;"Does the model answer correctly enough for this specific application?"&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Statistics
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;10.1 AI Inference Has Become Dramatically Cheaper&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;According to the Stanford AI Index 2025, the cost of querying an AI model performing at approximately GPT-3.5's level on the MMLU benchmark fell from $20 per million tokens in November 2022 to $0.07 per million tokens by October 2024-a reduction of more than 280× in roughly 18 months. &lt;a href="https://hai.stanford.edu/ai-index/2025-ai-index-report/research-and-development" rel="noopener noreferrer"&gt;Stanford HAI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source: Stanford Institute for Human-Centered Artificial Intelligence&lt;br&gt;
&lt;a href="https://hai.stanford.edu/ai-index/2025-ai-index-report/research-and-development" rel="noopener noreferrer"&gt;Original Stanford AI Index source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10.2 Smaller Models Are Becoming More Capable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The same Stanford AI Index reports that the smallest model exceeding 60% on the MMLU benchmark decreased from 540 billion parameters in 2022 to 3.8 billion parameters in 2024, representing a 142-fold reduction in parameter count for that benchmark threshold. &lt;a href="https://hai.stanford.edu/news/ai-index-2025-state-of-ai-in-10-charts?trk=article-ssr-frontend-pulse_little-text-block" rel="noopener noreferrer"&gt;Stanford HAI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source: Stanford Institute for Human-Centered Artificial Intelligence&lt;br&gt;
&lt;a href="https://hai.stanford.edu/news/ai-index-2025-state-of-ai-in-10-charts" rel="noopener noreferrer"&gt;Original Stanford AI Index source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This trend is particularly relevant to Local LLMs because increasingly capable smaller models make local inference more practical on consumer hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Interesting Facts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A local LLM does not necessarily require a high-end data center. Small models can run on relatively modest hardware.&lt;/li&gt;
&lt;li&gt;Quantization can dramatically reduce model size. For example, Ollama lists Qwen3 4B at roughly 2.5 GB for a Q4 variant. &lt;a href="https://ollama.com/library/qwen3%3A4b-instruct" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Local AI can operate without internet access after setup. LM Studio supports offline inference once the required model files are present. &lt;a href="https://lmstudio.ai/docs/app/offline" rel="noopener noreferrer"&gt;LM Studio&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Local models can expose APIs. A model running on a developer's machine does not have to be used only through a chat interface; it can become part of an application through a local API server. &lt;a href="https://lmstudio.ai/docs/developer/core/server" rel="noopener noreferrer"&gt;LM Studio&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The largest model is not always the best model. A smaller model may provide substantially better latency and lower resource consumption while being sufficient for a specific task.&lt;/li&gt;
&lt;li&gt;Open-weight and open-source are not always synonymous. A model can make its weights available while having licensing terms that differ from traditional open-source software licenses.&lt;/li&gt;
&lt;li&gt;Local deployment shifts responsibility toward the developer. Instead of relying entirely on a cloud provider for infrastructure and security, the organization becomes responsible for its own model-serving environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  12. FAQs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. What is a Local LLM?&lt;/strong&gt;&lt;br&gt;
A Local LLM is a language model whose inference runs on hardware controlled by the user or organization instead of sending every inference request to a remote model provider.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Are Local LLMs completely private?&lt;/strong&gt;&lt;br&gt;
They can provide significantly greater data control, but local deployment does not automatically guarantee privacy. Network configuration, application logs, APIs, plugins, model sources, and system security must also be considered.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Do Local LLMs require a GPU?&lt;/strong&gt;&lt;br&gt;
Not always. Smaller models can run on CPUs, although GPU acceleration can substantially improve inference performance. Larger models generally benefit from significant GPU memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. What is the best model size for a laptop?&lt;/strong&gt;&lt;br&gt;
There is no universal answer. A smaller 3B–8B model is generally easier to run than a 30B or 70B model, but the appropriate choice depends on available RAM/VRAM and the application's quality requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What does 4-bit quantization mean?&lt;/strong&gt;&lt;br&gt;
It means model weights are represented using a lower-bit numerical format, significantly reducing memory requirements. The trade-off is that some quality can be lost depending on the model and quantization method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Is Ollama the same as a Local LLM?&lt;/strong&gt;&lt;br&gt;
No. Ollama is a tool/runtime for running and interacting with local models. The LLM is the actual model, such as Qwen3 or Gemma 3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Can a Local LLM work without internet?&lt;/strong&gt;&lt;br&gt;
Yes, after the required model and runtime have been downloaded. For example, LM Studio documents that downloaded models can operate entirely offline. LM Studio&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Should organizations completely replace cloud LLMs with Local LLMs?&lt;/strong&gt;&lt;br&gt;
Not necessarily. A hybrid strategy can often be more practical. Sensitive workloads may run locally while workloads requiring highly capable cloud models can use appropriately governed cloud services.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“In a world where ChatGPT and other AI apps can do many things humans once needed to do themselves or needed to hire other humans to do, the question of ‘how will I add value?’ becomes more relevant than ever.” - Hendrith Vanlon Smith Jr.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  13. Conclusion
&lt;/h2&gt;

&lt;p&gt;Local LLMs represent an important shift in how developers think about AI infrastructure.&lt;/p&gt;

&lt;p&gt;Instead of treating AI exclusively as a remote service, organizations can increasingly treat language models as software infrastructure that can run under their own control.&lt;/p&gt;

&lt;p&gt;The advantages can include stronger data control, offline capability, customization, reduced dependence on external APIs, and potentially lower network latency. Simultaneously, local deployment introduces new responsibilities around hardware, model selection, security, maintenance, licensing, and evaluation.&lt;/p&gt;

&lt;p&gt;The rapid improvement of smaller models is making this approach increasingly practical. Stanford's AI Index shows that capable AI models have become dramatically smaller and cheaper to run, while tools such as Ollama and LM Studio have lowered the technical barrier to local inference. Stanford HAI&lt;/p&gt;

&lt;p&gt;The most important lesson is therefore not "always use Local LLMs."&lt;br&gt;
It is:&lt;br&gt;
Choose where your AI runs based on the data, task, performance requirements, cost, and level of control your application actually needs.&lt;/p&gt;

&lt;p&gt;Local AI is not a replacement for every cloud AI workload. It is another deployment option-and for privacy-sensitive and infrastructure-controlled applications, it can be a very powerful one.&lt;/p&gt;

&lt;p&gt;About the Author: &lt;em&gt;Tanisha is an AI Engineer at &lt;a href="https://www.addwebsolution.com" rel="noopener noreferrer"&gt;AddWeb Solution&lt;/a&gt;, working on AI/ML solutions, intelligent applications, and emerging AI technologies.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>vertexai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>From PDF to Knowledge Base: Building an AI-Powered Glossary Assistant for Intelligent Q&amp;A</title>
      <dc:creator>Tanisha Khakhrani</dc:creator>
      <pubDate>Wed, 14 Oct 2026 10:44:53 +0000</pubDate>
      <link>https://dev.to/addwebsolutionpvtltd/from-pdf-to-knowledge-base-building-an-ai-powered-glossary-assistant-for-intelligent-qa-3eob</link>
      <guid>https://dev.to/addwebsolutionpvtltd/from-pdf-to-knowledge-base-building-an-ai-powered-glossary-assistant-for-intelligent-qa-3eob</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;“The technology you use impresses no one. The experience you create with it is everything.” - Sean Gerety&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why is a Knowledge Base useful for PDF-based AI applications?&lt;/li&gt;
&lt;li&gt;How are PDFs converted into searchable knowledge?&lt;/li&gt;
&lt;li&gt;How does semantic search improve document Q&amp;amp;A?&lt;/li&gt;
&lt;li&gt;Why is an AI assistant needed on top of the Knowledge Base?&lt;/li&gt;
&lt;li&gt;How does the glossary handle terminology-based questions?&lt;/li&gt;
&lt;li&gt;How do the Knowledge Base, glossary, retrieval system, and LLM work together?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Table of Content(Index)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Introduction

&lt;ul&gt;
&lt;li&gt;From PDF to Knowledge&lt;/li&gt;
&lt;li&gt;Problems with Traditional PDF Search&lt;/li&gt;
&lt;li&gt;Intelligent Document Interaction&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Knowledge Base for PDFs

&lt;ul&gt;
&lt;li&gt;What is a Knowledge Base?&lt;/li&gt;
&lt;li&gt;Building a Knowledge Base&lt;/li&gt;
&lt;li&gt;Benefits of a Document-Based Knowledge Base&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;AI-Powered Q&amp;amp;A Assistant

&lt;ul&gt;
&lt;li&gt;Why an AI Assistant is Needed&lt;/li&gt;
&lt;li&gt;Natural Language Q&amp;amp;A&lt;/li&gt;
&lt;li&gt;Conversation and Ambiguity Handling&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Building the Knowledge Base 

&lt;ul&gt;
&lt;li&gt;Text Extraction and Structure Detection&lt;/li&gt;
&lt;li&gt;Chunking&lt;/li&gt;
&lt;li&gt;Embeddings and FAISS&lt;/li&gt;
&lt;li&gt;Semantic Retrieval and Sources&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Role of the Glossary

&lt;ul&gt;
&lt;li&gt;What is a Glossary?&lt;/li&gt;
&lt;li&gt;Automatic Glossary Extraction&lt;/li&gt;
&lt;li&gt;Glossary vs Knowledge Base&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Putting Everything Together

&lt;ul&gt;
&lt;li&gt;LLM and Context&lt;/li&gt;
&lt;li&gt;End-to-End Workflow&lt;/li&gt;
&lt;li&gt;User Interface&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;FAQs&lt;/li&gt;
&lt;li&gt;Interesting Facts&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1.1 From PDF to Knowledge&lt;/strong&gt;&lt;br&gt;
PDFs are mainly designed for storing and displaying documents. They are convenient for humans, but their content is not automatically organized in a form that an AI system can efficiently search.&lt;/p&gt;

&lt;p&gt;A Knowledge Base (KB) transforms document content into a structured and searchable representation that an AI application can retrieve when answering questions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F03rbrz5xg0l517tamp0y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F03rbrz5xg0l517tamp0y.png" alt=" " width="430" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The goal is therefore not simply to store PDFs, but to transform their content into usable knowledge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.2 Problems with Traditional PDF Search&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional PDF search has several limitations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keyword Mismatch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keyword-based search mainly looks for matching words. A search for:&lt;br&gt;
"repair ruptured plumbing"&lt;/p&gt;

&lt;p&gt;may not return content describing:&lt;br&gt;
"fixing a leaking pipe"&lt;/p&gt;

&lt;p&gt;even though the two expressions have a similar meaning.&lt;/p&gt;

&lt;p&gt;Semantic search addresses this by representing text as embeddings and comparing their meaning. Sentence Transformers, for example, supports embeddings and semantic search across text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Poor Machine Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PDFs are designed around visual layouts. During extraction, issues can occur with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multicolumn text&lt;/li&gt;
&lt;li&gt;Headers and footers&lt;/li&gt;
&lt;li&gt;Reading order&lt;/li&gt;
&lt;li&gt;Tables&lt;/li&gt;
&lt;li&gt;Text inside images&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PDF extraction tools such as pdfplumber provide text and layout-related extraction capabilities, but the quality still depends on how the original PDF was created.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Information Spread Across Multiple Files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Important information may be distributed across several PDFs. Users have to search each document separately and combine the results themselves.&lt;/p&gt;

&lt;p&gt;A Knowledge Base brings these documents into a single searchable layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scanned Documents&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scanned PDFs may contain images instead of machine-readable text. Such documents require OCR before their content can be processed as text. pdfplumber's documentation also notes that it works best with machine-generated PDFs rather than scanned documents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.3 Intelligent Document Interaction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of manually searching through hundreds of pages, users can ask questions directly.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What are the termination liabilities in Section 4?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The system retrieves relevant information and provides it to an LLM for answer generation.&lt;/p&gt;

&lt;p&gt;A typical RAG-style document workflow is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDF → Extract → Chunk → Embeddings → Vector Search → Context → LLM → Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The key idea is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instead of searching only for exact words, search for meaning and context.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Knowledge Base for PDFs
&lt;/h2&gt;

&lt;p&gt;The Knowledge Base is the foundation of the assistant. Before the AI can answer questions, information from PDFs must be extracted, organized, indexed, and made searchable.&lt;/p&gt;

&lt;p&gt;Instead of treating a PDF as one large file, the system divides its content into smaller meaningful units called chunks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.1 What is a Knowledge Base?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Knowledge Base&lt;/strong&gt; is a centralized collection of information that an application can retrieve and use to answer questions.&lt;/p&gt;

&lt;p&gt;In this project:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDF → Text → Chunks → Embeddings → FAISS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each chunk represents a small piece of document knowledge. Its embedding allows the system to find it when a user's question is semantically related.&lt;/p&gt;

&lt;p&gt;In simple terms:&lt;br&gt;
&lt;strong&gt;A PDF is the source of information.&lt;br&gt;
A Knowledge Base is the searchable representation of that information.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.2 Building a Knowledge Base&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose the system receives several PDFs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning.pdf&lt;/li&gt;
&lt;li&gt;Constructors.pdf&lt;/li&gt;
&lt;li&gt;Encapsulation.pdf&lt;/li&gt;
&lt;li&gt;Inheritance.pdf&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of searching each document independently, the project processes them through the same pipeline:&lt;br&gt;
&lt;strong&gt;PDFs → Text Extraction → Structure Detection → Chunking → Embeddings → FAISS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The chunks and their metadata are combined:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;all_chunks.extend(get_chunks)&lt;br&gt;
all_metadata.extend(get_metadata)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Embeddings are then generated for the combined collection:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;chunk_embeddings = embedding_chunks(all_chunks)&lt;br&gt;
stored_chunk_embeddings = store_embeddings(chunk_embeddings)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The result is a single searchable knowledge layer containing information from multiple PDFs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.3 Benefits of a Document-Based Knowledge Base&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Centralized Knowledge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Multiple PDFs can be processed into one searchable system.&lt;br&gt;
Multiple PDFs → Processing → Unified Knowledge Base&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Faster Retrieval&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of processing an entire document for every question, the system searches indexed chunks and retrieves only the most relevant content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Semantic Understanding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Embeddings allow the system to retrieve related content even when the question and document use different wording. Semantic search works by embedding the query and corpus into a shared vector space and finding nearby representations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Context Preservation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each chunk can retain metadata such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PDF filename&lt;/li&gt;
&lt;li&gt;Page number&lt;/li&gt;
&lt;li&gt;Heading&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;strong&gt;Inheritance.pdf → Page 4 → Types of Inheritance → Relevant Chunk&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Reusable AI Foundation&lt;/strong&gt;&lt;br&gt;
Once created, the Knowledge Base can support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Question answering&lt;/li&gt;
&lt;li&gt;Document assistants&lt;/li&gt;
&lt;li&gt;Summarization&lt;/li&gt;
&lt;li&gt;Information extraction&lt;/li&gt;
&lt;li&gt;Intelligent search&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. AI-Powered Q&amp;amp;A Assistant
&lt;/h2&gt;

&lt;p&gt;The Knowledge Base solves the problem of storing and retrieving information, but users still need a simple way to interact with it.&lt;br&gt;
Users should not need to understand embeddings, vector indexes, or similarity calculations. They should simply be able to ask a question.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.1 Why an AI Assistant is Needed&lt;/strong&gt;&lt;br&gt;
Manual document search requires users to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find the correct document.&lt;/li&gt;
&lt;li&gt;Open it.&lt;/li&gt;
&lt;li&gt;Search for keywords.&lt;/li&gt;
&lt;li&gt;Read surrounding content.&lt;/li&gt;
&lt;li&gt;Compare information across documents.&lt;/li&gt;
&lt;li&gt;Form the answer themselves.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This becomes inefficient as documents become larger or more numerous.&lt;br&gt;
Instead of manually searching:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What is encapsulation and why is it useful?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;the user can ask the assistant directly. The assistant handles the retrieval process in the background.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Any sufficiently advanced technology is indistinguishable from magic.” - Arthur C. Clarke&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;3.2 Natural Language Q&amp;amp;A&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The user can ask questions in normal language.&lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User:&lt;/strong&gt; What is inheritance in Python?&lt;/p&gt;

&lt;p&gt;The question is converted into an embedding and used to retrieve relevant document chunks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question → Relevant Context → LLM → Natural-Language Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The retrieved context is then passed to the LLM.&lt;/p&gt;

&lt;p&gt;This creates an important separation:&lt;br&gt;
&lt;strong&gt;Retrieval finds the knowledge.&lt;br&gt;
Generation explains the knowledge.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sentence Transformers supports embedding generation and semantic search, making this type of retrieval possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.3 Conversation and Ambiguity Handling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A useful assistant should understand follow-up questions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User:&lt;/strong&gt; What is inheritance?&lt;br&gt;
&lt;strong&gt;Assistant:&lt;/strong&gt; Inheritance allows one class to derive properties and behavior from another.&lt;br&gt;
&lt;strong&gt;User:&lt;/strong&gt; Explain it with an example.&lt;/p&gt;

&lt;p&gt;The second question depends on the first. The assistant therefore uses conversation history:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Current Question + Previous Conversation → LLM → Context-Aware Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The assistant should also avoid guessing when a question is ambiguous.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;strong&gt;What is inheritance?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If multiple contexts are available:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Python inheritance&lt;/li&gt;
&lt;li&gt;Java inheritance&lt;/li&gt;
&lt;li&gt;C++ inheritance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;the assistant can ask the user to clarify instead of selecting one without sufficient evidence.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Knowledge is power. Information is liberating.” - Kofi Annan&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4. Building the Knowledge Base
&lt;/h2&gt;

&lt;p&gt;The Knowledge Base converts raw PDF content into searchable vector representations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDF → Text Extraction → Structure Detection → Chunking → Embeddings → FAISS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.1 Text Extraction and Structure Detection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first step is to extract text from each PDF page.&lt;br&gt;
The project uses &lt;strong&gt;pdfplumber:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;with pdfplumber.open(pdf_path) as pdf:&lt;/strong&gt;&lt;br&gt;
for page in pdf.pages:&lt;br&gt;
page_text = page.extract_text()&lt;/p&gt;

&lt;p&gt;The extracted text is stored along with page information:&lt;br&gt;
&lt;strong&gt;page_text_list.append(page_text)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;pdfplumber supports page-level text extraction and can also work with layout-related information such as character positions and font attributes.&lt;/p&gt;

&lt;p&gt;The basic transformation is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDF → Machine-Readable Text&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure Detection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Extracted text alone may lose useful document structure. Headings provide additional context.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chapter 2&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Inheritance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inheritance allows one class to...&lt;br&gt;
The project uses font-size information to identify headings.&lt;/p&gt;

&lt;p&gt;It calculates the median body font size:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;body_font_size = np.median(all_sizes)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and defines a threshold:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;heading_threshold = body_font_size + 1&lt;/strong&gt;.5&lt;/p&gt;

&lt;p&gt;A sufficiently large and relatively short line can then be treated as a heading.&lt;/p&gt;

&lt;p&gt;The resulting chunk can retain:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heading: Inheritance&lt;br&gt;
Text: Inheritance allows one class...&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This makes the retrieved information more meaningful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.2 Chunking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Large documents should not be treated as one giant block of text. The content is divided into smaller &lt;strong&gt;chunks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project uses:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;max_chunk_size = 1000&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;overlap = 200&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The overlap helps preserve context between neighboring chunks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chunk 1 → 1000 characters&lt;br&gt;
200-character overlap&lt;br&gt;
Chunk 2 → 1000 characters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project also associates headings and metadata with chunks, providing additional context during retrieval.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.3 Embeddings and FAISS&lt;/strong&gt;&lt;br&gt;
After chunking, each chunk is converted into a numerical representation called an embedding.&lt;/p&gt;

&lt;p&gt;The project uses:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SentenceTransformer("all-MiniLM-L6-v2")&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;embeddings = model.encode(chunks)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sentence Transformers creates fixed-size vector representations that can be used for semantic search and similarity comparison.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Python inheritance" → [0.12, -0.34, 0.81, ...]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The exact numbers are not meaningful to humans. They allow text to be compared mathematically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question Embedding → Compare Similarity → Document Chunk Embeddings → Relevant Chunks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FAISS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once embeddings are generated, they need to be stored for efficient search.&lt;br&gt;
The project uses FAISS:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;dimension = embeddings.shape[1]&lt;br&gt;
index = faiss.IndexFlatL2(dimension)&lt;br&gt;
index.add(&lt;/strong&gt;&lt;br&gt;
np.array(embeddings).astype("float32")&lt;br&gt;
&lt;strong&gt;)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;IndexFlatL2 performs nearest-neighbor search using L2 distance.&lt;br&gt;
The simplified flow is:&lt;br&gt;
&lt;strong&gt;Document Chunks → Embeddings → FAISS → Vector Search&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FAISS provides indexing and efficient similarity-search functionality for vector data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.4 Semantic Retrieval and Sources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a user asks a question, the question is converted into an embedding using the same model.&lt;/p&gt;

&lt;p&gt;The system then searches FAISS:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User Question → Question Embedding → FAISS Search → Relevant Chunks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project retrieves the top &lt;strong&gt;3 relevant chunks:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;distances, indices = index.search(&lt;/strong&gt;&lt;br&gt;
question_embedding,&lt;br&gt;
k=3&lt;br&gt;
&lt;strong&gt;)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These chunks become the context for the LLM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Metadata&lt;/strong&gt;&lt;br&gt;
Each chunk also retains information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File name&lt;/li&gt;
&lt;li&gt;Page number&lt;/li&gt;
&lt;li&gt;Heading&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inheritance.pdf&lt;br&gt;
Page 4&lt;br&gt;
Heading: Types of Inheritance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This allows users to verify the answer and return to the original document.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Role of the Glossary
&lt;/h2&gt;

&lt;p&gt;Technical documents often contain specialized terminology. Even when the system retrieves the correct information, users may not understand the terms being used. This is where the glossary becomes important.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Our industry does not respect tradition. It only respects innovation.” - Satya Nadella&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;5.1 What is a Glossary?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;glossary&lt;/strong&gt; is a collection of important terms and their definitions.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encapsulation&lt;/strong&gt;&lt;br&gt;
→ The practice of bundling data and methods within a class.&lt;br&gt;
&lt;strong&gt;Inheritance&lt;/strong&gt;&lt;br&gt;
→ A mechanism through which one class derives properties and behavior from another.&lt;br&gt;
&lt;strong&gt;Polymorphism&lt;/strong&gt;&lt;br&gt;
→ The ability of different objects to respond to the same interface in different ways.&lt;/p&gt;

&lt;p&gt;The glossary provides quick access to definitions without requiring users to search through the complete document.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.2 Automatic Glossary Extraction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of manually creating the glossary, the project uses an LLM to identify important terminology from the extracted document content.&lt;/p&gt;

&lt;p&gt;The system can identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Key terms&lt;/li&gt;
&lt;li&gt;Abbreviations&lt;/li&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Concepts&lt;/li&gt;
&lt;li&gt;Tools&lt;/li&gt;
&lt;li&gt;Definitions
The expected structure is a dictionary:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br&gt;
"inheritance": "A mechanism through which one class derives properties and behavior from another.",&lt;br&gt;
"encapsulation": "A technique of bundling data and methods within a class."&lt;br&gt;
&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The terms are normalized:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;return {&lt;/strong&gt;&lt;br&gt;
str(k).lower().strip(): str(v).strip()&lt;br&gt;
for k, v in glossary_dict.items()&lt;br&gt;
&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This makes lookup more consistent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.3 Glossary vs Knowledge Base&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The glossary and Knowledge Base have different responsibilities.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1genlmn9v53740uf6qua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1genlmn9v53740uf6qua.png" alt=" " width="439" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Glossary Question&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"What is inheritance?"&lt;/p&gt;

&lt;p&gt;Question → Glossary Lookup → Definition&lt;/p&gt;

&lt;p&gt;Knowledge Base Question&lt;/p&gt;

&lt;p&gt;"How is inheritance used in this application?"&lt;/p&gt;

&lt;p&gt;Question → Embedding → FAISS Search → Relevant Chunks → LLM → Answer**&lt;/p&gt;

&lt;p&gt;The glossary is therefore &lt;strong&gt;not a replacement for the Knowledge Base.&lt;/strong&gt; It is an additional layer designed to make terminology-focused questions faster and clearer.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Putting Everything Together
&lt;/h2&gt;

&lt;p&gt;The final assistant combines the Knowledge Base, glossary, retrieval system, conversation history, and LLM into one workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.1 LLM and Context&lt;/strong&gt;&lt;br&gt;
The LLM is responsible for generating the final natural-language response.&lt;/p&gt;

&lt;p&gt;The basic process is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question → Relevant Context → LLM → Natural-Language Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The important distinction is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The vector index retrieves.&lt;br&gt;
The LLM explains.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The retrieved context helps ground the generated answer in information from the uploaded documents.&lt;/p&gt;

&lt;p&gt;For follow-up questions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Current Question + Previous Conversation → LLM → Context-Aware Answer&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The advance of technology is based on making it fit in so that you don't really even think about it.” - Bill Gates&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;6.2 End-to-End Workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The complete system can be divided into two stages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 1: Knowledge Base Creation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDF → Text Extraction → Structure Detection → Chunking → Embeddings → FAISS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The glossary is generated alongside the Knowledge Base:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDF Text → Important Terms → Glossary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stage 2: Question Answering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For a definition-based question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question → Glossary Lookup → Definition&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For a broader question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question → Embedding → FAISS Search → Relevant Chunks → LLM → Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For a follow-up question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Current Question + Previous Conversation → LLM → Context-Aware Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The overall experience is simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upload PDF → Ask Question → Get Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.3 User Interface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project uses Streamlit to provide the user interface.&lt;br&gt;
The user can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload PDF documents.&lt;/li&gt;
&lt;li&gt;Process the documents.&lt;/li&gt;
&lt;li&gt;Ask questions.&lt;/li&gt;
&lt;li&gt;View generated answers.&lt;/li&gt;
&lt;li&gt;Continue the conversation.&lt;/li&gt;
&lt;li&gt;View relevant sources.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From the user's perspective:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upload PDF → Ask Question → Get Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Behind the scenes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDF → Extraction → Chunking → Embeddings → FAISS → Retrieval → LLM → Answer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The complexity remains in the backend while the user experience remains simple.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. What is a PDF Knowledge Base?&lt;/strong&gt;&lt;br&gt;
A PDF Knowledge Base converts information from PDFs into searchable chunks. These chunks are represented as embeddings and stored in a vector index such as FAISS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Why not simply search the PDF?&lt;/strong&gt;&lt;br&gt;
Traditional search relies heavily on matching words. Semantic search can retrieve related information even when different wording is used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. What is the role of FAISS?&lt;/strong&gt;&lt;br&gt;
FAISS stores vector representations and performs similarity search to retrieve relevant chunks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Why is a glossary needed?&lt;/strong&gt;&lt;br&gt;
The Knowledge Base handles broader questions, while the glossary provides quick answers to terminology-based questions such as "What is encapsulation?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Can the assistant answer follow-up questions?&lt;/strong&gt;&lt;br&gt;
Yes. Conversation history allows the assistant to interpret questions based on previous messages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. What happens when a question is ambiguous?&lt;/strong&gt;&lt;br&gt;
The assistant can identify multiple relevant contexts and ask the user to clarify instead of making an unsupported assumption.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interesting Facts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Semantic search focuses on meaning rather than only exact keywords -&lt;a href="https://www.sbert.net/examples/sentence_transformer/applications/semantic-search/README.html" rel="noopener noreferrer"&gt;Semantic Search Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The entire PDF does not need to be sent to the LLM. Relevant chunks are retrieved first - &lt;a href="https://www.sbert.net/" rel="noopener noreferrer"&gt;Sentence Transformers Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;This project uses 1,000-character chunks with 200-character overlap - &lt;a href="https://faiss.ai/" rel="noopener noreferrer"&gt;FAISS Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The glossary and Knowledge Base serve different purposes.&lt;/li&gt;
&lt;li&gt;Source metadata can connect retrieved content back to its original PDF, page, and heading - &lt;a href="https://github.com/jsvine/pdfplumber/blob/stable/README.md" rel="noopener noreferrer"&gt;pdfplumber Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The same Knowledge Base can support multiple AI applications beyond Q&amp;amp;A.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“We are stuck with technology when what we really want is just stuff that works.” - Douglas Adams&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The project demonstrates how static PDF documents can be transformed into an interactive source of knowledge.&lt;/p&gt;

&lt;p&gt;By combining PDF extraction, structure detection, chunking, embeddings, FAISS-based retrieval, glossary lookup, conversation history, source tracking, and an LLM, users can interact with documents using natural language instead of manually searching through files.&lt;/p&gt;

&lt;p&gt;The key idea is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Knowledge Base retrieves the right information, the glossary explains important terminology, and the AI assistant turns that information into a conversational answer.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The result is a document assistant that combines semantic search, contextual understanding, and glossary-based definitions into one simple question-answering experience.sea&lt;/p&gt;

&lt;p&gt;About the Author: &lt;em&gt;Tanisha is an AI Engineer at &lt;a href="https://www.addwebsolution.com/" rel="noopener noreferrer"&gt;AddWeb Solution&lt;/a&gt;, working on AI/ML solutions, intelligent document processing, and AI-powered applications.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>vertexai</category>
      <category>rag</category>
      <category>knowledgebase</category>
    </item>
  </channel>
</rss>
