📡 Why Live Research
An LLM on its own responds with what it learned during training — and training has a cutoff date. Ask it about the client's company and it makes up data or uses outdated data. Live research solves this: Perplexity searches the internet for the company when you run the Factory.
✗ LLM only (static)
- ✗Knowledge frozen as of the cutoff date
- ✗Makes up plausible numbers and facts (hallucinates)
- ✗Doesn’t see yesterday’s news or yesterday’s funding round
- ✗Recommends a tool that has already been replaced
✓ With live research
- ✓Ran in June/2026 → pulls data through June/2026
- ✓Facts with citable sources, not guesses
- ✓If n8n is replaced, it knows
- ✓Recommendations update automatically
💡 The phrase that defines Phase 1
"That’s what keeps everything up to date instead of static." Live research is what separates a generic package from a diagnosis that speaks to present of that company. Without it, you deliver a template; with it, you deliver consulting.
today's facts
citable
less hallucination
keeps up with the market
⚖️ Quick vs Deep and cost
The Factory has two research modes, and you choose between them in real time to control costs. The mode quick runs a quick assessment with the essential queries; the comprehensive investigates deeply, using more expensive models.
| Mode | Queries | Models | Cost | When to use |
|---|---|---|---|---|
| Quick | ~9 | sonar | ~US$0.05 | quick assessment, lead, demo |
| Comprehensive | ~18 | sonar, sonar-pro, deep-research | ~US$0,50 | complete strategy, paying client |
sonar — the workhorse
Cheap and fast. Runs the high-priority queries in quick mode. That’s enough to understand the essentials of the company.
sonar-pro — more in-depth
Richer, more expensive responses (US$0,015/1K output). Use comprehensive for categories that need detail.
deep-research — the investigation
For topics worth a deep dive — competition and AI initiatives. Only in comprehensive mode, where the cost is justified.
💡 Cost rule of thumb
Always start with quick to qualify the lead. Move up to comprehensive only once the client is committed—the 10× cost difference (US$0,05 → US$0,50) is still just cents compared with what you charge for the package.
9 queries · sonar
18 queries · pro/deep
in real time
cost < US$1
🗓️ Temporal context in queries
A query without a date returns results from any time. The Factory injects the current date into each template through the TemporalContext — and defines a recency filter (day, week, month, or year) by category.
// template before and after temporal injection
# template cru (placeholders)
"{company_name} latest news announcements {current_month_year}"
# renderizado para junho de 2026
"Stripe latest news announcements June 2026"
recency_filter = "month" # só notícias do último mês
✓ With temporal context
- ✓
{current_year}e{current_month_year}become the actual date - ✓News filtered by
month; industry peryear - ✓"this month" means this month, literally
✗ No temporal context
- ✗Mixing a 2022 article with yesterday’s
- ✗"latest news" becomes a pile of undated information
- ✗The diagnosis starts out of date
💡 Recency by category
AI news and initiatives require month (change quickly). Company profile, industry, and regulations hold up year. Matching recency to the topic's volatility is what prevents noise.
date in the queries
day/week/month/year
{current_year}
in the present
🗂️ The 9 query categories
The research covers the company through nine lenses. Each template includes a category, a priority (1 = highest) and a flag required_for_quick_mode — it decides whether the query goes straight into quick mode.
🏢 Company
Business model, products, size, headquarters. The foundation of the profile.
📈 Industry
Market size, trends, challenges, and opportunities.
⚔️ Competition
Who the rivals are and how they adopt AI.
🧰 Technology
The company’s stack, platforms, and infrastructure.
🤖 AI initiatives
Company AI projects, adoption, and industry use cases.
⚖️ Regulatory
Industry rules, AI compliance, and data privacy.
📰 News
Recent announcements and developments (recency month).
👔 Leadership
CEO, executives, and management team.
💵 Investment
Rounds, valuation, and investors.
📊 Who enters quick mode
- •Always (quick): company, industry, competition, AI, and news — the lenses that answer "the essentials".
- •Only in comprehensive: leadership, investment, detailed tech stack, and regulatory — the deep dive.
- •A priority orders the execution: priority 1 runs first.
company→news
1 = first
does it make the quick cut?
the whole company
🛟 Aggregate and handle (graceful degradation)
APIs fail. One query times out, another hits the rate limit. The Factory doesn’t get stuck because of that: the Perplexity client has exponential backoff retry and if the search still fails, the pipeline continues with partial data.
// client resilience policy
max_retries = 3 initial_delay = 1.0 # segundos max_delay = 30.0 backoff_multiplier = 2.0 # 1s → 2s → 4s ... rate_limit = 2.0 # pausa entre chamadas Perplexity
✓ Graceful degradation
- ✓Query fails → continues with partial data
- ✓Deliverable fails → flag it and continue with the others
- ✓Diagram fails → skip the image, keep the markdown
✗ No degradation
- ✗One failure brings down the entire session
- ✗Redo everything (and pay again) because of one error
- ✗Rate limit becomes a wall instead of a pause
💡 Partial > nothing
A package with 8 of the 9 categories is still a deliverable package — you note the gap and move on. Resilience isn’t about never failing; it’s about failing without falling apart.
3× with backoff
2s pause
continues anyway
doesn't fall apart
📥 Assemble the ResearchOutput
The end of Phase 1 is a structured object: the ResearchOutput. It brings together everything the research found and turns it into the contract that Synthesis consumes — besides being saved in research_cache.json so you don't research (or pay) twice.
// the object that closes Phase 1
class ResearchOutput:
company_name: str # "Stripe"
raw_research: dict # categoria → achados
sources: list # URLs citáveis
cost: float # quanto custou a pesquisa
Aggregate by category
Each Perplexity response is saved under its category in raw_research. Synthesis knows where to find "competitors" or "pain points".
Keep the sources
The URLs go to sources. It’s what makes citations possible and gives the final package credibility.
Caches to disk
Everything goes to research_cache.json. Running Synthesis again doesn’t trigger new research—direct savings.
💡 Structured output is a contract
When Phase 1 delivers a predictable object, Phase 2 becomes reliable. The ResearchOutput is the clean boundary between research and writing—and caching turns cents into zero on the second run.
predictable object
citable
doesn't pay 2×
feeds Phase 2
✅ Module summary
🎯 Mission 4.1 — Quick research on 1 company
Run Phase 1 in quick mode for a company you know and review the results for the 9 categories.
- Ask Claude Code: "run the research quick from the Factory to company X".
- Check that the queries came out with a current date injected.
- Open the
research_cache.jsonand see the 9 categories and the sources. - Note which category scored lowest — that’s where deep mode would help.
Success: one ResearchOutput structured, with sources, for ~$0.05. What you gained: the factual raw material that feeds the 15 prompts in the next module.
Next module:
4.2 — The 15 deliverable prompts (Phase 2: Assessment, Planning, Implementation, Governance, and Resources)