Build and design a Mistral RAG agent
Mistral AISoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's skills in building a retrieval-augmented generation (RAG) system, covering document ingestion, chunking, embedding generation, vector indexing, retrieval, LLM API-driven streaming completions, short-term conversation memory, and operational reliability features.
Build and discuss an LLM-powered retrieval-augmented agent that calls the Mistral API. Implement a minimal Python tool that: (
- ingests a small local corpus (e.g., Markdown/PDF), chunks text, generates embeddings, and indexes them; (
- retrieves top-k passages for a user query; (
- composes a prompt and invokes Mistral chat/completions with streaming; (
- keeps short-term conversation memory; (
- reads the API token from an environment variable; (
- handles errors, retries, and rate limits; and (
- includes a brief README and smoke tests. Then, explain your system design choices: chunking strategy, embedding model choice, vector index selection, latency and cost budgeting, caching, prompt templating, safety/PII handling, logging/monitoring, offline RAG evaluation, and fallbacks when retrieval fails.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.