Building a Complex AI Answer Engine with Multi-Step Reasoning
perplexity · Tech · 2024 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.4 (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: Multi-step AI answer search
Perplexity Pro Search needed to answer complex questions that traditional search handles poorly because they require decomposing a nuanced query, researching multiple subquestions, filtering documents, and synthesizing a factual response.
Constraints:
- complex queries require connecting multiple ideas
- speed and accuracy both matter despite added reasoning steps
- different language models interpret prompts differently
- users need visibility into intermediate progress when waiting
- evaluation must cover answer quality, intermediate steps, and UX
Architecture
Perplexity separates planning from execution. The agent creates a step-by-step plan, generates search queries for each step, executes those steps sequentially while passing prior results forward, groups and filters returned documents, and sends highly ranked evidence to an LLM for final answer synthesis. The product also exposes progress and citations in the UI.
Diagram confidence: explicit (topology described by the source).
flowchart LR user-query[User query] --> planning-agent[Planning agent] planning-agent --> search-executor[Search executor] search-executor --> document-filter[Document filter] document-filter --> answer-synthesizer[Answer synthesizer] answer-synthesizer --> progress-ui[Progress UI] progress-ui --> evaluation-loop[Evaluation loop]
Components
| Component | Role | Interacts with |
|---|---|---|
User query |
Complex question submitted to Pro Search. | Planning agent |
Planning agent |
Creates a step-by-step plan for answering the query. | User query, Search executor |
Search executor |
Generates and runs search queries for each plan step. | Planning agent, Document filter |
Document filter |
Groups and filters returned documents to the most relevant set. | Search executor, Answer synthesizer |
Answer synthesizer |
LLM step that writes the final answer from ranked documents. | Document filter, Progress UI |
Progress UI |
Shows plan execution, expandable steps, and citation snippets. | Answer synthesizer, Evaluation loop |
Evaluation loop |
Manual tests, dogfooding, LLM-as-judge rankings, and A/B tests. | Progress UI |
Data flow
A complex user query enters Pro Search. The agent builds a plan, emits search queries for each step, runs them sequentially, groups and filters documents, passes the best-ranked documents to an LLM, and returns an answer with visible intermediate progress and citations.
3 supporting quotes
Why this architecture
Planning separates reasoning about the research path from executing searches, which improves multi-step coverage. Showing intermediate progress makes users more willing to wait for a slower but more capable search mode.
Models used: large language models · LLM-as-judge · Wolfram Alpha · code interpreter
Scale
- Pro Search query volume increased by over 50 percent in the past few months.“###### In fact, query search volume of Perplexity Pro Search has increased by over 50% _in the past few months, as more users discover its ability to answer tricky questions quickly and efficiently.”article, stated
Alternatives considered (roads not taken)
Traditional search
Rejected because: Traditional search struggles with queries that require connecting details across multiple ideas.
One quick-search mode for all questions
Rejected because: Pro Search targets complex, nuanced questions that need a more advanced modality.
Patterns
prompt-chaining (reasoning)
Pro Search executes a plan through sequential search steps before final synthesis.
retrieval-ranking (retrieval)
Search documents are grouped, filtered, and passed to the LLM only after ranking.
llm-as-judge (evaluation)
Perplexity uses LLM-as-a-judge rankings to scale answer evaluation.
Tradeoffs
Search mode
Chose multi-step planning and execution over off-the-cuff quick search.
Rationale: Complex questions need decomposed research to produce precise answers.
Product configuration testing
Chose A/B tests over latency and cost configurations over single hand-picked configuration.
Rationale: Different model choices trade off latency, cost, and user reaction.
Gotchas (what bit them)
Long complex prompts can become hard for models to follow.
Root cause: Prompt rules and examples must be balanced against prompt length.
Resolution: Iterate on few-shot examples, chain-of-thought prompting, and intermediate-step checks.
Users may abandon slower multi-step search if progress is opaque.
Root cause: Advanced search takes longer than quick search.
Resolution: Show the plan executing step by step with expandable details and citation hover states.
Evaluation
Perplexity combines manual side-by-side testing, internal dogfooding, intermediate-step inspection, LLM-as-judge ranking, and A/B tests for latency/cost configurations.
Metrics: answer quality · UX quality · LLM-as-judge rank · A/B test reaction · query search volume
Outcomes
- Pro Search query volume increased by over 50 percent.
- The product delivered multi-step answers while preserving speed and accuracy.
- Intermediate progress and citations improved the user experience for longer tasks.
The source reports query volume growth but not absolute traffic volume.