Build the first version of a RAG application, from document upload through retrieval to grounded answers and citations.
Let's think about it this way for a second
Don't pack your first RAG app with lots of features — just handle a handful of documents, one query, the top results, and one answer. What really matters is being able to show which source the answer actually came from.

Let's connect this to everyday life
During ingestion, parse, chunk, and embed each file, then load it into the vector store. At query time, find the top chunks, send them as context, and include an instruction not to answer when there's no source. Log the retrieval results and the final answer separately so you can test them.
Let's try it hands-on together
const results = await vectorStore.search(userQuestion, { topK: 4 });
const context = results.map((item) => item.text).join("\n\n");
const response = await client.responses.create({
model: "gpt-5.6",
input: `အောက်ပါ context ကိုသာသုံးပြီး ဖြေပါ။ မတွေ့လျှင် မတွေ့ကြောင်းပြောပါ။\n\n${context}\n\nမေးခွန်း: ${userQuestion}`,
});
console.log(response.output_text);You'll get a grounded answer built from the relevant document chunks.5-minute try-it
Build a mini RAG app using five Markdown FAQ files. Show the source title and link underneath each answer. Test it with five unrelated questions too.
A quick word of caution
Don't treat AI output as the final word. Have a human review anything important — including code and user data — before it's actually used.
OpenAI — Retrieval — OpenAI
OpenAI — Embeddings — OpenAI