KatInterview

Building a Multi-Model Enterprise AI Research Platform

Machine LearningModel answer
MediumModel answerMachine Learningllm-systemsagent-designfine-tuning

Last updated

Design a production agent system for financial analysts, covering model customization strategies, agent orchestration patterns, structured output enforcement, and multi-tenant serving.

You're architecting an AI-powered research platform for quantitative analysts at an investment firm. The system will help analysts process unstructured market documents, extract financial data, and execute complex research tasks through natural language interaction.

Analysts will use the platform to analyze earnings transcripts, pull metrics from regulatory documents, query proprietary databases, run analytical computations, and chain together multi-step investigations. The output feeds both human decision-making and downstream quantitative pipelines that require precise, validated data.

Scale and Performance Targets

  • User base: Approximately 1,000 analysts
  • Daily volume: 50,000 agent sessions under normal conditions
  • Seasonal peaks: 5× traffic during quarterly earnings periods
  • Latency goals:
    • Simple tool invocations: 95th percentile under 2.5 seconds
    • Multi-step research tasks: 95th percentile under 12 seconds
  • Infrastructure: Fixed GPU cluster (H100/A100 nodes)

Core Capabilities Required

Model Customization: Starting from open foundation models (such as 70B-parameter models), adapt them to understand firm-specific vocabulary, proprietary metric definitions, and specialized output formats.

Tool Integration: Enable the agent to orchestrate actions across internal systems—querying timeseries databases, searching document collections, invoking computation engines—while maintaining safe, bounded execution.

Structured Output: Produce validated JSON conforming to strict schemas for programmatic consumption by downstream systems.

Safety and Auditability: Ensure complete traceability of agent decisions, validate tool executions, detect hallucinated numbers, and guarantee reproducibility for compliance review.

Your Design Should Address

  1. Model customization approach: Evaluate full fine-tuning, parameter-efficient methods (LoRA, QLoRA), and retrieval-augmented generation. Consider training cost, memory requirements, serving overhead, and risk of degrading base capabilities.

  2. Agent execution architecture: Choose an orchestration pattern and explain how you manage state, enforce execution limits, handle tool failures, and prevent runaway loops.

  3. Output validation strategy: Compare prompt engineering, API-based structured generation, and grammar-constrained decoding for guaranteeing valid outputs.

  4. Multi-task serving infrastructure: Design a system that can serve multiple specialized model variants efficiently on shared hardware.

  5. Monitoring and quality assurance: Define metrics for tracking agent reliability, tool selection accuracy, and output correctness.

Discuss trade-offs explicitly. What breaks first under load? Where do you accept risk? What would you build differently at 10× or 0.1× scale?

Hints

Hint 1

Think about where knowledge should live: what belongs in model weights versus external systems?

Hint 2

Agent orchestration isn't just about prompting—consider how you enforce hard limits on execution time and prevent infinite loops.

Hint 3

Structured output validation has a spectrum from soft (prompting) to hard (grammar enforcement)—what does production reliability require?