PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/ML System Design/Mistral AI

Build and design a Mistral RAG agent

Last updated: Apr 8, 2026

Quick Overview

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.

  • hard
  • Mistral AI
  • ML System Design
  • Software Engineer

Build and design a Mistral RAG agent

Company: Mistral AI

Role: Software Engineer

Category: ML System Design

Difficulty: hard

Interview Round: Technical Screen

Build and discuss an LLM-powered retrieval-augmented agent that calls the Mistral API. Implement a minimal Python tool that: ( 1) ingests a small local corpus (e.g., Markdown/PDF), chunks text, generates embeddings, and indexes them; ( 2) retrieves top-k passages for a user query; ( 3) composes a prompt and invokes Mistral chat/completions with streaming; ( 4) keeps short-term conversation memory; ( 5) reads the API token from an environment variable; ( 6) handles errors, retries, and rate limits; and ( 7) 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.

Quick Answer: 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.

Related Interview Questions

  • Design a PDF-to-Markdown Inference API - Mistral AI (hard)
Mistral AI logo
Mistral AI
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
ML System Design
43
0

Design and Implement a Minimal LLM-Powered RAG Agent (Python, Mistral API)

Context

You are asked to build a minimal, but production-minded, retrieval-augmented generation (RAG) agent in Python that uses the Mistral API for embeddings and chat completions. The agent should work over a small local corpus (e.g., Markdown and PDF files), support streaming responses, maintain a short conversation memory, and include basic reliability features.

Assume Python 3.10+ and that external dependencies can be installed. The Mistral API token is provided via an environment variable.

Deliverables

Implement a minimal Python tool that:

  1. Ingests a small local corpus (Markdown/PDF), chunks text, generates embeddings, and builds an index.
  2. Retrieves top-k passages for a user query.
  3. Composes a prompt and invokes Mistral chat/completions with streaming.
  4. Keeps short-term conversation memory.
  5. Reads the API token from an environment variable.
  6. Handles errors, retries, and rate limits.
  7. Includes a brief README and smoke tests.

Then, explain your system design choices, covering:

  • Chunking strategy
  • Embedding model choice
  • Vector index selection
  • Latency and cost budgeting
  • Caching
  • Prompt templating
  • Safety/PII handling
  • Logging/monitoring
  • Offline RAG evaluation
  • Fallbacks when retrieval fails

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More ML System Design•More Mistral AI•More Software Engineer•Mistral AI Software Engineer•Mistral AI ML System Design•Software Engineer ML System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.