Skip to content
>_KernelBrief
Software Development

My RAG POC: Answering From Up-to-Date Shared Drive Docs Instead of Outdated Help Files

How I built a RAG proof of concept with Java, FastAPI, Sentence Transformers and ChromaDB so an AI help agent answers from current shared drive documents.

By Published 9 min read

The short version: I proved that an AI help assistant can answer from the documents my team actually keeps up to date (on a shared drive) instead of from old, out-of-date help files. The approach is Retrieval-Augmented Generation (RAG). A Java job reads the shared drive documents. A Python service splits them into chunks, turns each chunk into an embedding with Sentence Transformers and stores them in ChromaDB. A FastAPI /ask endpoint then finds the passages that best match a user's question. I tested it with real questions through FastAPI's Swagger UI, and the answers came from the current documents, not from the old help.

Table of contents

This is a write-up of a proof of concept I built at work. I've left out anything specific to the product or the company, but the problem, the architecture and the lessons are exactly what I ran into. If you've ever seen users trust a help page that stopped being true two releases ago, this is for you.

The problem: the help said one thing, the documents said another

Our application ships its help as CHM files, the compiled HTML help format that opens in the classic Windows help viewer. Over time we noticed a gap:

  • The CHM help content was often outdated.
  • The latest and correct information lived in documents on a shared drive, because that's where the team actually updates things.
  • Users still went to the old help system first, because that's what the product opens.

So the right answer existed. It just wasn't where users were looking. Copying every change into the help files by hand clearly wasn't happening reliably, so I wanted to know whether an AI assistant could close the gap by reading the documents we already maintain.

Why I didn't just switch on the Zendesk AI agent

We use Zendesk, so my first idea was its AI agent. The catch in our setup: the AI agent generated its answers from Help Center articles. If the Help Center wasn't updated, the AI couldn't give accurate answers. It would confidently repeat whatever the articles said. We would only have moved the "outdated content" problem from CHM files to Zendesk.

That led to the real question for the POC:

Can the shared drive documents be the single source of truth, with the AI answering from them directly?

Worth knowing before you copy this: Zendesk now supports more than Help Center articles. According to Zendesk's documentation, AI agents can also draw on external content sources, such as content added through a web crawler, knowledge connectors or the Federated Search API, alongside Help Center content. This depends on your plan and AI agent level. If you're facing the same problem, check that first. A custom pipeline is still useful when your documents live somewhere those options don't reach, or when you want full control over chunking and search.

The architecture

The POC has two paths from the same shared drive: one keeps Zendesk in sync, the other builds a searchable index for the AI service.

                    ┌──────────────────────────────┐
                    │  Shared drive documents      │  ← source of truth
                    └──────────────┬───────────────┘
                 ┌─────────────────┴──────────────────┐
                 ▼                                    ▼
   Java sync job (file processing)       Python indexer
   → Zendesk Help Center articles        → chunk → embed (Sentence Transformers)
     (keeps Zendesk AI compatible)       → store in ChromaDB
                                                      │
                                                      ▼
                                       FastAPI service: POST /ask
                                       → embed question → nearest chunks
                                       → passages + source document

Tech stack:

Layer What I used Why
File processing and Zendesk integration Java Our existing services are Java, and the Zendesk Help Center REST API is easy to call from it
AI service layer Python + FastAPI The embedding and vector-database libraries are Python-first; FastAPI gives Swagger UI for free
Embeddings Sentence Transformers Runs locally, no API keys, good quality for semantic search
Vector database ChromaDB Stores embeddings in a local folder with a simple Python API
Knowledge base Zendesk Help Center Where support content and the Zendesk AI agent already live

Below I walk through each piece. The code is a simplified example of each step, not the project's code, so you can adapt it to your own documents.

Step 1: Read the documents and keep Zendesk in sync (Java)

The Java side walks the shared drive folder, extracts the text of each document and creates or updates the matching Help Center article. Zendesk's Help Center API creates an article with a POST to a section's articles endpoint. Existing articles are updated through their translations.

// Simplified: create one Help Center article from a document's title and HTML body.
HttpClient http = HttpClient.newHttpClient();
ObjectMapper json = new ObjectMapper();

Map<String, Object> article = new LinkedHashMap<>();
article.put("title", title);
article.put("body", htmlBody);
article.put("locale", "en-us");
article.put("permission_group_id", permissionGroupId); // who can edit
article.put("user_segment_id", userSegmentId);         // null = visible to everyone
String body = json.writeValueAsString(Map.of("article", article));

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://" + subdomain
        + ".zendesk.com/api/v2/help_center/sections/" + sectionId + "/articles.json"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Basic " + Base64.getEncoder().encodeToString(
        (email + "/token:" + apiToken).getBytes(StandardCharsets.UTF_8)))
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();

HttpResponse<String> response = http.send(request, HttpResponse.BodyHandlers.ofString());

Two things I'd tell anyone doing this:

  • Store a mapping from file to article ID (and a hash of the file content). Then the next run updates the right article and skips files that haven't changed.
  • Treat the shared drive as read-only. The sync only reads documents. Nobody should ever edit Zendesk and expect it to flow back.

Step 2: Split documents into chunks (Python)

You can't usefully embed a 40-page document as one vector. The meaning gets averaged into mush. So each document is split into overlapping chunks first, keeping the file name with every chunk so an answer can always point back to its source.

def chunk_text(text: str, max_words: int = 250, overlap: int = 40) -> list[str]:
    """Split text into overlapping word windows."""
    words = text.split()
    chunks, start = [], 0
    while start < len(words):
        end = min(start + max_words, len(words))
        chunks.append(" ".join(words[start:end]))
        if end == len(words):
            break
        start = end - overlap
    return chunks

The overlap matters more than it looks. Without it, a sentence that starts at the end of one chunk and finishes in the next is split in half, and neither chunk answers the question. For real documentation, splitting on headings first and only then by length usually gives cleaner results.

Step 3: Create embeddings and store them in ChromaDB

Each chunk becomes a vector with a Sentence Transformers model. all-MiniLM-L6-v2, for example, maps text to a 384-dimensional vector and is small enough to run on a laptop. ChromaDB stores the vectors together with the original text and metadata.

import hashlib

import chromadb
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("all-MiniLM-L6-v2")
client = chromadb.PersistentClient(path="./chroma_db")
docs = client.get_or_create_collection(name="help_docs", metadata={"hnsw:space": "cosine"})


def index_document(path: str, text: str) -> int:
    chunks = chunk_text(text)
    if not chunks:
        return 0
    ids = [hashlib.sha1(f"{path}#{i}".encode()).hexdigest() for i in range(len(chunks))]
    vectors = model.encode(chunks, normalize_embeddings=True).tolist()
    docs.upsert(
        ids=ids,
        documents=chunks,
        embeddings=vectors,
        metadatas=[{"source": path, "chunk": i} for i in range(len(chunks))],
    )
    return len(chunks)

Using upsert with stable IDs (file path plus chunk number) means re-indexing a changed document replaces its old chunks instead of duplicating them. If a document gets shorter, delete its leftover chunks too, for example with docs.delete(where={"source": path}) before re-indexing.

Step 4: Answer questions with a FastAPI /ask endpoint

The question goes through the same embedding model, ChromaDB returns the nearest chunks, and the API returns them with their source document.

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI(title="Help docs search")


class Question(BaseModel):
    question: str
    top_k: int = 3


@app.post("/ask")
def ask(q: Question):
    vector = model.encode([q.question], normalize_embeddings=True).tolist()
    hits = docs.query(
        query_embeddings=vector,
        n_results=q.top_k,
        include=["documents", "metadatas", "distances"],
    )
    return {
        "question": q.question,
        "results": [
            {"source": meta["source"], "text": text, "distance": round(dist, 3)}
            for text, meta, dist in zip(
                hits["documents"][0], hits["metadatas"][0], hits["distances"][0]
            )
        ],
    }

Run it with uvicorn main:app --reload, and FastAPI serves interactive API docs at http://localhost:8000/docs.

How I validated the POC

I kept validation simple and practical:

  1. Indexed a set of shared drive documents into ChromaDB.
  2. Opened the FastAPI Swagger UI at http://localhost:8000/docs.
  3. Called /ask with sample questions of the kind users actually ask.
  4. Checked each response against the source documents to confirm the passages came from the current shared drive content, not the old help.

That confirmed the core idea: semantic search found the relevant passages in the updated documents, even when a question used different words from the document. That's the advantage of embeddings over keyword search.

What the POC proved (and what it didn't)

Proved:

  • Shared drive documents can be the source of truth for an AI help system.
  • Using up-to-date documents instead of outdated help files is feasible with open-source tools.
  • Semantic search reliably surfaces the relevant passage for a natural-language question.

Not yet covered (the next steps I'd take before production):

  • Generating the final answer. Retrieval is the "R" in RAG. The full pattern, described in the original RAG paper by Lewis et al., hands the retrieved passages to a language model, which writes the answer and cites them. It's a small step once retrieval works well.
  • Automatic re-indexing when a file changes (a file watcher or a scheduled job comparing content hashes).
  • Permissions. If some documents are internal-only, the index needs that metadata, and the API must filter on it.
  • A small evaluation set: 20–30 real questions with known correct documents, re-run after every change to chunk size or model.
  • More file formats. Real shared drives hold Word, PDF and Excel files, and text extraction quality has a big effect on answer quality.

The key lesson

AI systems are only as good as the data they can access. If the source content is outdated, the answers will be too. It doesn't matter how good the model is. The most valuable part of this POC wasn't the vector database or the model. It was connecting the AI to the place where the truth is actually maintained.

If you're new to how models handle text, our guide on how large language models work explains tokens and context windows, which is why chunking matters. To set up the Python side cleanly, see our Python virtual environments guide. And for getting better answers once you add the generation step, read our prompt engineering guide for developers.

Frequently asked questions

+What is RAG in simple terms?

Retrieval-Augmented Generation means the AI first searches your own documents for the passages most relevant to a question, then answers using those passages. The knowledge lives in a searchable index you can update, not inside the model, so updating a document updates the answers.

+Do I need to retrain or fine-tune a model to use my company documents?

No. In a RAG setup the model is not retrained. You split documents into chunks, turn each chunk into an embedding, store them in a vector database and search that index at question time. When a document changes you re-index that document, which takes seconds.

+Why use ChromaDB and Sentence Transformers for a POC?

Both run locally with a pip install and no paid API keys. Sentence Transformers models such as all-MiniLM-L6-v2 turn text into 384-dimensional vectors on a normal laptop, and ChromaDB stores and searches those vectors from a local folder. That makes them a quick way to prove the idea before choosing production tools.

+Can a Zendesk AI agent use documents outside the Help Center?

Zendesk now lets AI agents use external content sources, such as content added through a web crawler, knowledge connectors or the Federated Search API, alongside Help Center articles, depending on your plan and AI agent level. Check what your plan includes before building a custom sync.

+How big should chunks be for RAG?

There is no single right size. A few hundred words per chunk with a small overlap is a common starting point for documentation. Test with real user questions: if answers miss context, make chunks larger; if results contain a lot of unrelated text, make them smaller or split on headings.

Sources & references

  1. Lewis et al. — Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (NeurIPS 2020)
  2. Zendesk help — Connecting knowledge sources to power generative replies in AI agents
  3. Zendesk help — About connecting external content to Zendesk for use across knowledge experiences
  4. Zendesk help — Announcing support for multiple knowledge sources in AI agents
  5. Zendesk Developer Docs — Help Center API: Articles
  6. Zendesk help — Publish and sync copies of an article in help center with the API
  7. Hugging Face — sentence-transformers/all-MiniLM-L6-v2 model card
  8. Chroma Cookbook — Collections

Spotted an error? See our Corrections Policy.

  • #rag
  • #chromadb
  • #fastapi
  • #sentence-transformers
  • #zendesk
  • #java
  • #python
Dipak Suryawanshi

Dipak SuryawanshiFounder & Editor

Dipak Suryawanshi is a backend developer who works with Java and Spring Boot, focused on building APIs, clean architectures and developer tools. He founded KernelBrief, an independent technology publication based in India, sets its editorial direction and is responsible for everything published on it. Every KernelBrief article is researched and checked against primary sources such as official documentation, vendor advisories and release notes before it is published.