Build a RAG agent on the Mistral API, then defend its design
Write a small Python tool that answers questions over a local folder of Markdown and PDF files with retrieval-augmented generation: ingest and chunk the files, embed and index the chunks, retrieve the best passages for a question, and call a Mistral chat model with streaming. Keep a short conversation memory, read the API key from the environment, and handle errors, retries and rate limits. Ship it with a README and a few smoke tests.
Then explain your choices: chunk size, embedding model, which vector index, the latency and cost budget, caching, prompt templates, handling personal data, logging, how you would evaluate retrieval offline, and what the agent does when retrieval finds nothing useful.
No answer yet. Write the first one; the best answer gets endorsed.
