Home

Building a Local AI Research Assistant with RAG

September 14, 2026 ☼ Artificial Intelligence ☼ Digital Archives ☼ Libraries ☼ Technology ☼ RAG ☼ Local AI

From an LLM to a Personal Research Library

I recently began experimenting with local AI, initially with a fairly simple question: how capable of a language model could I run on my own computer?

That question quickly led to much more interesting ones.

I began thinking less about the size of the model and more about what I actually wanted the system to do. In particular, I wanted to be able to take a large collection of documents, books, manuals, interviews, articles, and other reference material and ask questions about them.

For me, an Atari 8-bit computer archive provides a useful example. I could imagine having hundreds or thousands of documents covering Atari hardware, software, programming, history, developers, interviews, magazines, and contemporary reporting.

I don’t necessarily want an AI model to “know” all of that information.

I want the AI to be able to find it, examine it, compare it, and help me understand it.

That led me to RAG, or Retrieval-Augmented Generation.


First, What Is Qwen?

One of the local models I have been experimenting with is Qwen.

Qwen is a family of large language models (LLMs) developed by Alibaba. A language model is the component that processes language, reasons about the information it is given, and generates a response. Qwen is one of many language models that can perform this role. Other models can be used instead, depending on their capabilities and the hardware available.

To run a language model locally, the model needs to be loaded into the computer’s memory. Ideally, the model fits into the VRAM of the GPU, although larger models can also be partially loaded into system RAM, usually with a performance trade-off. The amount of available memory is therefore an important factor in determining which models can be run locally and how quickly they can respond.

If you are considering a Mac, the situation is somewhat different because Macs use unified memory, which is shared between the CPU and GPU. In practical terms, the more unified memory you have, the larger the model you can run comfortably. The model needs to be resident in memory while it is running, so memory capacity places a practical limit on the size of the AI model you can use.

I am using a Windows PC, so I began experimenting with local AI using LM Studio. LM Studio provides a relatively simple interface for finding, installing, loading, and running local language models. Once a model is downloaded, I can load it into memory and start interacting with it. That is the basic first step toward running an AI model locally.

It is important, however, not to confuse the language model with the entire research system described here.

Qwen is not RAG.

Qwen is not the document database.

Qwen is not the Internet search system.

Qwen is the language model that can work with information supplied to it.

RAG is an architecture that can provide a language model such as Qwen with relevant information retrieved from an external collection of documents.

That distinction becomes important when thinking about how a useful research system should be constructed.


1. A Language Model by Itself

A conventional local LLM can be thought of roughly like this:

Question
   ↓
Language Model
   ↓
Answer

The model relies primarily on information encoded into its neural network during training, together with whatever information is currently present in its context.

This can be extremely useful, but it has limitations.

The model may not know about a particular document.

It may not know about a recently published fact.

It may have incomplete knowledge of an obscure historical subject.

It may also produce an answer that sounds convincing but is not actually supported by reliable evidence.

This last problem is commonly referred to as a hallucination.

A larger model can reduce some types of error, but making the model larger does not turn it into a database or an infallible reference source.


2. What RAG Changes

RAG stands for Retrieval-Augmented Generation.

The basic idea is simple.

Instead of asking the language model to answer entirely from what it already knows, a retrieval system first searches an external collection for information relevant to the question.

The resulting passages are then supplied to the language model.

Conceptually:

                    Your Question
                          │
                          ↓
                   Retrieval System
                          │
                          ↓
                 Relevant Documents
                          │
                          ↓
                    Language Model
                          │
                          ↓
                       Answer

The language model is still responsible for understanding and explaining the material.

The retrieval system provides the evidence.

This is a fundamental distinction.


3. RAG Does Not Train the Model

Suppose I have 500 GB of Atari documentation.

I do not need to retrain Qwen on those 500 GB.

Instead, I can keep the documents on my own storage and create an index that allows the relevant material to be found.

For example:

Atari Archive/
├── Technical/
├── Historical/
├── Interviews/
├── Magazines/
├── Books/
└── Software/

When I ask a question, the retrieval system searches the collection, finds relevant material, and passes selected passages to the language model.

The documents remain the source of knowledge.

The LLM remains the language and reasoning engine.

RAG is the mechanism connecting them.


4. This Is Surprisingly Similar to a Traditional Library

This is where the idea became particularly interesting to me.

A traditional library does much more than store books.

A library organizes knowledge.

Books have titles, authors, publishers, publication dates, subjects, editions, classifications, and other metadata. Libraries create catalogs and indexing systems that allow people to find material relevant to a question.

The books contain the knowledge.

The catalog describes and organizes that knowledge.

A librarian can help a researcher locate the appropriate material.

RAG introduces a computational equivalent.

Traditional Library             AI Research System

Books                             Documents
Catalog                           Search / RAG index
Metadata                          Document metadata
Librarian                          Retrieval system
Researcher                         User
Reading and analysis              Language model

The analogy is not exact, but it is useful.

The important point is that organization and metadata are not secondary details.

They are what make a large collection useful.


5. Building an Atari Research Library

An Atari research collection could be divided into several broad areas:

Atari Knowledge Base
│
├── Technical
│   ├── Hardware Manuals
│   ├── Programmer References
│   ├── BASIC Documentation
│   ├── Operating System Documentation
│   └── Developer Documentation
│
├── Historical
│   ├── Company History
│   ├── Corporate Documents
│   ├── Contemporary News
│   └── Magazine Articles
│
├── People
│   ├── Developer Interviews
│   ├── Engineer Interviews
│   └── Executive Interviews
│
└── Software
    ├── Game Documentation
    ├── Source Code
    ├── Technical Notes
    └── Reviews

This organization is useful even before introducing AI.

Once the collection is indexed for retrieval, however, it becomes possible to ask questions across the entire collection.


6. OCR and Original Sources

Much historical material exists as scanned PDFs.

A scanned page may look perfectly readable to a human but contain no actual text that a computer can search.

OCR can turn that material into searchable text:

Original PDF
     ↓
OCR
     ↓
Searchable text
     ↓
RAG indexing

I would still preserve the original PDF.

The OCR text should be treated as another representation of the source rather than a replacement for it.

Metadata can preserve the relationship:

Title:
Atari BASIC Reference Manual

Original source:
Atari_BASIC_Reference_Manual.pdf

Document type:
Technical manual

Publisher:
Atari

Year:
1979

Page:
42

OCR:
Yes

That provenance becomes extremely important for research.

The objective is not merely to produce an answer that sounds correct.

The objective is to be able to determine where the answer came from.


7. What Happens When a Question Is Asked?

Suppose I ask:

How did Atari BASIC handle graphics memory?

The entire Atari archive does not need to be loaded into the language model.

Instead, the retrieval system searches the index.

It might find:

Atari BASIC Reference Manual
Page 42

[relevant passage]


Atari 400/800 Technical Reference
Page 117

[relevant passage]


Contemporary programming article

[relevant passage]

Those passages can then be supplied to Qwen.

The resulting process looks like this:

Question
   ↓
Search index
   ↓
Find relevant passages
   ↓
Select useful sources
   ↓
Send passages + question to LLM
   ↓
Generate answer

The model does not need to have memorized the entire archive.

It needs to be capable of understanding, comparing, reasoning about, and explaining the evidence it has been given.


8. Why “I Don’t Know” Is a Feature

For research, I would rather have a system tell me:

The available sources do not establish this.

than have it confidently invent an answer.

A useful research system should distinguish between:

The sources establish this.
The sources strongly suggest this.
The sources disagree.

and:

The available sources do not establish this.

This becomes particularly important with historical research.

Suppose one document establishes:

John Smith worked at Atari in 1982.

Another establishes:

John Smith designed Game X in 1984.

That does not necessarily establish:

John Smith designed Game X while working at Atari.

A language model may be tempted to connect those facts because the conclusion seems plausible.

A research-oriented system should instead recognize that the evidence does not actually establish the relationship.


9. Local Documents and the Internet

The most useful system may not have to choose between a local archive and the Internet.

It could potentially use both.

                         Question
                            │
                            ↓
                    Research System
                            │
             ┌──────────────┴──────────────┐
             │                             │
       Local Atari Archive            Internet Search
             │                             │
             └──────────────┬──────────────┘
                            ↓
                       Evidence
                            │
                            ↓
                       Language Model
                            │
                            ↓
                    Answer + Sources

The local archive provides material that I have deliberately collected and preserved.

Internet search provides access to additional sources, contemporary information, newly discovered material, and information that is not present in my archive.

The two can then be compared.

This makes the system considerably more interesting than simply asking a chatbot questions.


10. RAG Does Not Require Multiple Agents

Another concept that appears frequently in discussions of modern AI is the “agent.”

An agent can be given tools and objectives and allowed to perform multiple steps, perhaps searching for information, analyzing it, calling another tool, checking the results, and eventually producing an answer.

That can be useful.

But it isn’t necessary for every problem.

For my purposes, I don’t currently see a need to have several autonomous agents passing work between one another.

A much simpler architecture may be sufficient:

Question
   ↓
Search local archive
   ↓
Search Internet if necessary
   ↓
Collect evidence
   ↓
Give evidence to language model
   ↓
Answer

The important question is not whether a system uses agents.

It is whether the architecture actually improves the research task.


11. The Biggest Model Is Not Necessarily the Best Model

This is one of the conclusions that surprised me most while thinking about this.

It is tempting to assume:

Bigger model = better research system.

That is not necessarily true.

For a research system built around a well-maintained document collection, the quality of retrieval and the quality of the evidence can be extremely important.

A relatively modest language model combined with excellent retrieval may be more useful than a much larger model operating without reliable source material.

For example:

Good language model
        +
Excellent retrieval
        +
Good metadata
        +
Reliable citations
        +
Internet access

may be more useful for research than:

Huge language model
        +
Poor retrieval
        +
No source discipline

The second system may be considerably more expensive while still producing answers that are difficult to verify.


12. The Role of the GPU

This also changes how I think about the hardware required.

My 16 GB GPU primarily determines what language models I can run and how quickly they can run.

It does not determine how large my document archive can be.

I could potentially have hundreds of gigabytes of documents while continuing to use the same GPU.

Conceptually:

16 GB GPU
    │
    └── Runs the language model


64 GB System RAM
    │
    └── Supports the operating system,
        applications, indexing and retrieval


Large SSD / HDD storage
    │
    └── Stores the research archive

The entire document collection does not need to be loaded into GPU memory.

Only the relevant material retrieved for a particular question needs to enter the model’s active context.

This means that for a research-oriented system, investing in storage, organization, metadata, indexing, and backups may ultimately be more valuable than immediately buying a much larger GPU.


13. Context Is Not the Same as Storage

This distinction is important.

Suppose the archive contains:

500 GB of documents

That does not mean the language model has a 500 GB context window.

The retrieval system might find:

10 relevant passages

and supply those passages to the model.

The model’s active context might therefore contain:

System instructions
+
Question
+
Retrieved passages
+
Relevant conversation history

The rest of the archive remains outside the context.

This is one of the fundamental advantages of RAG.


14. Long Conversations Are a Different Problem

A language model has a finite context window.

As a conversation becomes very long, earlier material may eventually have to be truncated, summarized, or otherwise managed by the application.

If an important statement disappears from the active context, the model may no longer have access to it.

However, context loss is not the only source of hallucination.

A language model can produce an incorrect statement even when the relevant conversation is still completely available.

RAG helps by introducing external evidence that can be retrieved when needed.

The architecture therefore becomes:

Conversation
      +
Retrieved evidence
      +
Language model
      ↓
    Answer

rather than relying entirely on conversational memory.


15. The Language Model Is Only One Component

This may be the most important conceptual shift.

A useful AI research system consists of several distinct components:

                ┌──────────────────┐
                │   Your Documents │
                └────────┬─────────┘
                         ↓
                ┌──────────────────┐
                │ OCR / Extraction │
                └────────┬─────────┘
                         ↓
                ┌──────────────────┐
                │     Indexing     │
                └────────┬─────────┘
                         ↓
Question ─────→ ┌──────────────────┐
                │    Retrieval     │
                └────────┬─────────┘
                         ↓
                ┌──────────────────┐
                │ Relevant Sources │
                └────────┬─────────┘
                         ↓
                ┌──────────────────┐
                │  Language Model  │
                │     (Qwen)       │
                └────────┬─────────┘
                         ↓
                ┌──────────────────┐
                │ Answer + Sources │
                └──────────────────┘

Qwen is one component in this diagram.

The documents are another.

The retrieval system is another.

The indexing system is another.

The language model should therefore not be confused with the research system as a whole.


16. A More Useful Way to Think About the Hardware

This leads to a broader idea.

Instead of beginning with:

What is the newest GPU?

I could begin with:

What do I want this computer to accomplish?

For example:

Task:
Atari archival research

Language model:
14B–27B class

Context:
16K–32K+

Document collection:
Hundreds of GB

Internet:
Yes

Citations:
Required

Priority:
Accuracy over speed

Usage:
Several hours per day

Only after defining those requirements does it make sense to select the hardware.

The optimal machine might contain:

Current-generation GPU
+
Older CPU
+
Older motherboard
+
Used memory
+
Modern SSD

There is no requirement that every component belong to the same hardware generation.

The best computer is the one that satisfies the workload at an acceptable cost, power consumption, and level of performance.


17. From Chatbot to Research Environment

The eventual system I have in mind therefore looks something like this:

                    ┌─────────────────────┐
                    │    Atari Archive    │
                    │                     │
                    │ PDFs / OCR / Text   │
                    │ Manuals / Magazines │
                    │ Interviews / Books  │
                    └──────────┬──────────┘
                               │
                               ↓
                         RAG Index
                               │
                               ↓
Question ───────────────→ Retrieval
                               │
                     ┌─────────┴─────────┐
                     │                   │
                     ↓                   ↓
              Local Evidence       Internet Search
                     │                   │
                     └─────────┬─────────┘
                               ↓
                         Evidence Set
                               │
                               ↓
                       Language Model
                            (Qwen)
                               │
                               ↓
                 ┌─────────────────────────┐
                 │ Answer                  │
                 │                         │
                 │ Explanation             │
                 │ Source references       │
                 │ Page/document metadata  │
                 │ Limitations             │
                 └─────────────────────────┘

At this point, I am no longer simply running an LLM locally.

I am building a personal research environment.

The goal is not to build the biggest possible AI machine.

The goal is to build a system that can take a question, find the best available evidence, reason about that evidence, explain the result, and allow me to trace the answer back to its sources.

For archival research, that may be considerably more valuable than simply running the largest model available.

And perhaps the most interesting part is that this brings the concept surprisingly close to what libraries have been doing for centuries: preserving knowledge, organizing it, describing it, making it discoverable, and helping people use it.

The difference is that the catalog and the research assistant can now become computational.

Instead of merely searching a collection, I can ask the collection a question.