Evolution from Task-Specific Models to Multi-Agent Orchestration Platform

ai21 · Tech · 2023 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: enterprise RAG and multi-agent orchestration

AI21 needed enterprise LLM systems that could reliably answer grounded business questions, locate the right context across large corpora, and solve multi-step tasks that simple task-specific models or RAG chains could not handle.

Constraints:

Architecture

AI21 evolved from fine-tuned task-specific small language models into mini AI systems with preprocessing and hallucination filtering, then into a RAG-as-a-service product for organizational search, and finally into Maestro, a planning and orchestration layer that decomposes complex questions into executable subtasks and routes them to specialized agents, tools, and LLMs.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  task-specific-slms["Task-specific SLMs"] --> pre-and-postprocessing-wrapper["Pre and postprocessing wrapper"]
  pre-and-postprocessing-wrapper --> rag-service["RAG service"]
  rag-service --> metadata-index["Metadata index"]
  rag-service --> maestro-planner["Maestro planner"]
  maestro-planner --> specialized-agents-and-tools["Specialized agents and tools"]
  specialized-agents-and-tools --> trace-and-evaluation-layer["Trace and evaluation layer"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Task-specific SLMs Fine-tuned models optimized for enterprise tasks such as contextual answers and summarization. Pre and postprocessing wrapper
Pre and postprocessing wrapper Adds operations such as hallucination filtering around the model output. RAG service
RAG service Indexes customer documents and retrieves context for grounded answers and downstream use cases. Metadata index, Maestro planner
Metadata index Stores extracted document metadata for filtering similar corpora before semantic search. RAG service
Maestro planner Generates executable plans, decomposes complex tasks, and decides parallel versus chained execution. Specialized agents and tools
Specialized agents and tools First-party RAG, instruction-following, LLM, and customer tools used to execute subtasks. Trace and evaluation layer
Trace and evaluation layer Exposes decisions and evaluates against benchmarks, metrics, goals, and real-world data. —

Data flow

A customer query enters Maestro, the planner decomposes it into subtasks, retrieval or task-specific agents execute the relevant pieces, metadata and semantic search narrow the corpus, executable steps can run in parallel, and the system combines intermediate answers into a grounded final response with traces for enterprise visibility.

“we would take for example a very complex query or a very complex task and start to break it down into multiple subtasks.”transcript, stated
“we would extract this uh information from the user query and we do you know some sort of filtering before we actually apply the semantic search”transcript, stated

Why this architecture

AI21 kept decomposing the system because customers needed more than a single grounded answer. Task-specific models improved quality, RAG solved context selection, metadata filtering handled similar financial corpora, and Maestro added planning for complex multi-hop tasks.

“we saw that we can achieve a much higher quality on those use cases that businesses care about.”transcript, stated
“customers want you know other use cases as well. They don't just want to answer questions.”transcript, stated

Models used: Fine-tuned small language models · Contextual Answers · Semantic segmentation model · Embedding models · RAG agent · Instruction-following agent · AI21 Maestro

Scale

Alternatives considered (roads not taken)

Generic LLM answers without task-specific optimization.

Rejected because: Enterprise customers needed higher-quality answers for specific use cases such as contextual QA and summarization.

“we want to really focus on those use cases that businesses care about >> such as such as contextual answering”transcript, stated

Contextual answers alone.

Rejected because: Customers struggled to identify and supply the right context from large corpora.

“where businesses actually struggle is to identifying the right context to the model. Um it's not very trivial.”transcript, stated

One retrieval method for all customers.

Rejected because: Different corpora and use cases required different chunking, parsing, overlap, and context retrieval parameters.

“we couldn't really find one indexing and retrieval method that will work for all of our customers.”transcript, stated

Patterns

rag-retrieval (context grounding)

AI21 built a RAG service to identify and retrieve relevant organizational context for grounded answers.

“help our customers to also identify this this context and basically create one of the first I think uh rug as a service”transcript, stated

multi-agent-orchestration (Maestro planning)

Maestro decomposes complex tasks and orchestrates first-party agents, tools, and LLMs across chained or parallel subtasks.

“the heart of the system is really the the planning and orchestration.”transcript, stated

retrieval-ranking (metadata filtering)

AI21 used extracted metadata to filter similar documents before semantic retrieval.

“semantic material wasn't really helpful and we started using kind of metadata indexing”transcript, stated

eval-driven-development (product evaluation)

AI21 treated evaluations, benchmarks, metrics, goals, and real-world data as central to product direction.

“Evaluations. So, benchmarks, metrics, and goals.”transcript, stated

Tradeoffs

Launch RAG with plain text first.

Chose TXT-only MVP over Productizing PDF, DOCX, and spreadsheet ingestion immediately.

Rationale: The team focused on the core retrieval differentiator instead of spending the first release on document-conversion complexity.

“So we started with txt files. We started with uh quite a large support of of documents.”transcript, stated

Expose retrieval as a building block.

Chose Separate semantic and hybrid search endpoints over Only a combined contextual-answering product.

Rationale: Customers needed summarization, document generation, and other use cases beyond question answering.

“we kind of opened the retrieval part as you know a separate endpoint just a semantic search endpoint or a hybrid search endpoint”transcript, stated

Support sensitive deployments.

Chose SaaS plus VPC and on-prem options over SaaS-only document indexing.

Rationale: Sensitive customers did not want to send or store their document corpus in a shared SaaS environment.

“others that had more sensitive documents that didn't want to just you know send [clears throat] it over the internet”transcript, stated

Gotchas (what bit them)

Fine-tuned task-specific models still hallucinated.

Root cause: Smaller language models inherited LLM failure modes even when optimized for specific tasks.

Resolution: Wrap the model as a mini AI system with hallucination filtering and grounding checks.

“We also saw that in in smaller language models obviously that are fine-tuned for specific tasks.”transcript, stated
“we added an hallucination filter for the model.”transcript, stated

Document conversion distracted from the differentiated retrieval product.

Root cause: PDF, DOCX, and spreadsheet extraction introduced separate parsing problems before RAG quality was proven.

Resolution: Start with TXT files and rely on manual conversion or solution architects until richer formats were worth productizing.

“we started kind of playing around with PDF and and Docix files and and Excel spreadsheets. Uh but there were a lot of challenges”transcript, stated

Semantic retrieval failed on very similar financial documents.

Root cause: Similar corpora such as SEC filings lacked enough semantic separation for plain semantic retrieval to identify the right document.

Resolution: Extract and index metadata such as company and reporting period, then filter before semantic search.

“certain corpuses have uh very similar documents to one another and really the the like the method of [snorts] semantic retrieval isn't really useful”transcript, stated

Evaluation

AI21 evaluated retrieval and orchestration against benchmarks, goals, customer datasets, retrieval sufficiency, quality guarantees, and real-world data rather than relying only on academic benchmarks.

Metrics: Grounded-answer quality · Hallucination filtering · Retrieval relevance · Customer-specific evaluation results · Latency from parallelized plans · Real-world data coverage

“what would be kind of the the metrics that we need to uh start to evaluate in order to make sure that the context that we retrieve would be actually sufficient”transcript, stated
“Basically incorporating real world data into your evaluations.”transcript, stated

Outcomes

The product journey spans late 2022/early 2023 RAG work, roughly 1 GB text storage per customer in the MVP, and enterprise corpora containing thousands or millions of documents.

“when we took that approach, we saw that quality just improves dramatically.”transcript, stated
“the latency is much lower than what would happen if you would just chain all these steps together.”transcript, stated