A retrieval prototype in a folder of text files
A small collection of notes is enough to try retrieval. You do not need a vector database, a document pipeline, or a framework to find out whether an assistant can answer useful questions from your material. A folder of text files, a simple search step, and one model call can make the idea concrete.
The first goal is modest: ask a question, find a few relevant passages, and have the model answer from those passages. This pattern is often called retrieval-augmented generation, or RAG. Retrieval supplies the reference material; generation turns that material into an answer.
§ Start with a folder you can inspect
Choose a small, non-sensitive collection that you understand well. Product notes, public documentation, or a personal guide to a software project all work. Begin with perhaps ten files rather than importing everything you have.
Use ordinary UTF-8 text files with descriptive names. Keep each file focused on one subject, such as account settings or export formats. Clear headings and short paragraphs make the material easier for both your search routine and the model to use.
For this first version, leave out PDFs, scanned pages, and complex tables. Extracting their contents is a separate problem. Plain text lets you concentrate on whether the right information reaches the answer.
§ Give each passage an address
A long file may contain several unrelated answers. Instead of sending the whole file, divide it into passages. Paragraphs are a reasonable starting point. If a paragraph depends on the preceding heading, keep that heading with it.
Store three things for each passage: its text, its filename, and a stable label. A label such as exports.txt:section-3 gives the answer something specific to cite. This does not require a database; a list held in memory is enough for a small prototype.
Avoid splitting by character count alone when it cuts sentences or separates instructions from their conditions. The important property is readable context, not perfectly uniform passage size.
§ Retrieve with a simple score
Start with keyword matching. Convert the question and passages to lowercase, separate them into words, and count how many distinct question words appear in each passage. Ignore common words such as “the” and “is.” Return the three highest-scoring passages that have a positive score.
This approach has obvious limits. “Price” may not match “cost,” and repeated vocabulary can bring back an irrelevant passage. Those limits are useful to see early. You can add a small synonym list or improve the scoring after observing actual failures.
If nothing matches, report that no supporting passage was found. Do not quietly ask the model to fill the gap from memory while presenting the result as an answer from your files.
§ Make one grounded model call
Send the question and selected passages to the model, preserving each passage label. Ask it to answer only from the supplied material, cite the supporting labels, and say when the material is insufficient. Treat retrieved text as reference data, not as instructions that can change the assistant’s rules.
Vana API fits at this step. Its OpenAI-compatible endpoint lets an application use an OpenAI SDK with Vana API’s base URL and an account API key. A model such as Gemini 2.5 Flash can be a starting choice for short answers. Keep the key on the server or in a local environment variable, not in browser code or your notes folder.
Create a Vana API account when you are ready to connect the prototype. Billing is per actual token used, with no monthly fee, so keeping retrieved context short also helps control usage.
§ Check the retrieval before polishing the answer
Write a small set of questions with answers you already know. Include a question whose answer is absent and one whose wording differs from the source. For each test, inspect the retrieved passages before judging the final response.
- Did search find the passage containing the answer?
- Did the answer stay within the supplied evidence?
- Do its citations point to passages that support its claims?
Keep this version until its limitations are clear. Better ranking, embeddings, or a database can come later. The folder prototype gives you a readable baseline: you can see what was searched, what was sent, and where an answer came from.