Lossless Changelog
component

Competitive Landscape Research & Evaluation System (Initial Implementation)

Two new agents that discover, evaluate, and classify competitors using Perplexity Sonar Pro. The system splits competitive analysis into two phases with opposing cognitive biases: the researcher uses **completion bias** to find as many candidates as possible, while the evaluator…

Changelog - 2026-03-10_02

Competitive Landscape Research & Evaluation System (Initial Implementation)

Two new agents that discover, evaluate, and classify competitors using Perplexity Sonar Pro. The system splits competitive analysis into two phases with opposing cognitive biases: the researcher uses completion bias to find as many candidates as possible, while the evaluator uses skepticism bias to challenge whether each candidate is actually a competitor.

Design spec: context-v/Introducing-a-Competitive-Landscape-Research-and-Evaluation-System.md


Architecture

Two-Agent Design

AgentRoleBiasPerplexity Calls
ResearcherDiscover candidates via multi-query searchCompletion (find more)1 query generation + 5 search queries
EvaluatorChallenge, classify, and identify gapsSkepticism (remove false positives)1 evaluation + 0-2 gap searches

Source Priority

Both agents follow the same hierarchy:

  1. Dataroom — highest trust, pre-seeded into candidates

  2. Deck — competitive context from the pitch deck

  3. User-provided — known_competitors and search_variants from company JSON

  4. Web research — Perplexity Sonar Pro queries

Four-Criteria Evaluation

CriterionQuestion
Same customer segmentDo they sell to the same buyer persona?
SubstitutabilityCould a customer choose one instead of the other?
Same budget lineWould they compete for the same dollar?
Market overlapSame geographic/vertical markets?

Classification Rules

  • direct_competitor: High on 3-4 criteria

  • indirect_competitor: High on 2 criteria

  • adjacent: High on 1 criterion

  • not_a_competitor: High on 0 — removed from results


Changes

New File: src/agents/competitive_landscape_researcher.py

~480 lines. Discovers candidate competitors through multi-query web research.

  • _extract_market_category(): Pulls product/market context from deck analysis and research state

  • _get_deck_competitors(): Extracts competitor mentions from pitch deck competitive_landscape field

  • _get_dataroom_competitors(): Extracts structured competitor data from dataroom analysis

  • _generate_queries(): Uses Perplexity to generate 5 targeted search queries, incorporating user-provided search_variants; falls back to template queries on failure

  • _search_for_competitors(): Executes a single query, extracts structured competitor data (name, description, website, funding, online presence, etc.)

  • _deduplicate_candidates(): Merges candidates from multiple sources by name, combining source queries and URLs

  • _save_research_artifact(): Saves 1-competitive-research.md (human-readable) and 1-competitive-research.json (structured)

  • competitive_landscape_researcher(): Main agent function — orchestrates all phases

New File: src/agents/competitive_landscape_evaluator.py

~560 lines. Evaluates and classifies candidates, runs gap analysis.

  • _evaluate_candidates(): Sends all candidates to Perplexity for skeptical evaluation against four criteria; returns evaluations + identified gaps + gap queries

  • _search_for_gaps(): Runs up to 2 additional queries to find competitors missed in initial research; filters out already-known companies

  • _merge_evaluation_with_candidate(): Combines evaluation results (classification, reasoning, boolean criteria) with original candidate data (funding, website, online presence)

  • _save_evaluation_artifact(): Saves 1-competitive-evaluation.md with tables (direct, indirect, adjacent, removed) and 1-competitive-evaluation.json

  • competitive_landscape_evaluator(): Main agent function — orchestrates evaluation + gap analysis, determines confidence level (high/medium/low based on direct competitor count)

Modified: src/state.py

New TypedDicts for the competitive landscape pipeline:

  • CompetitorCandidate: Raw candidate with name, description, website, funding details, online presence dict, source tracking, and origin flags (from_deck, from_dataroom)

  • CompetitiveLandscapeResearch: Researcher output — candidates list, queries executed, totals

  • EvaluatedCompetitor: Post-evaluation competitor with classification, reasoning, four boolean criteria, and complete investor list

  • CompetitiveLandscapeEvaluation: Evaluator output — evaluated list, direct/indirect name lists, removed list, gap additions, summary, confidence

New MemoState fields:

  • search_variants: Optional[List[str]] — user-provided search terms for competitive research

  • known_competitors: Optional[List[str]] — user-provided known competitor names

  • competitive_candidates: Optional[CompetitiveLandscapeResearch] — researcher output

  • competitive_landscape: Optional[CompetitiveLandscapeEvaluation] — evaluator output

Updated create_initial_state() to accept and initialize all new fields.

Modified: src/workflow.py

  • Imported both competitive agents

  • Added competitive_researcher and competitive_evaluator nodes

  • Updated edge sequence:

    Before: section_research → cite
    After:  section_research → competitive_researcher → competitive_evaluator → cite
  • Updated generate_memo() to accept search_variants and known_competitors parameters

Modified: src/main.py

  • Loads search_variants and known_competitors from company JSON config

  • Prints them during startup if present

  • Passes them through to generate_memo()


Artifacts Produced

Each run creates two new artifact files in the output directory:

FileContent
1-competitive-research.mdHuman-readable report: queries executed, all candidates with details
1-competitive-research.jsonStructured JSON of all candidates and queries
1-competitive-evaluation.mdEvaluation tables: direct, indirect, adjacent, removed, gap additions
1-competitive-evaluation.jsonStructured JSON with evaluations, classifications, and confidence

Company JSON Config

New optional fields in data/{Company}.json:

JSON
{
  "search_variants": ["enzyme supplements", "metabolic health startups"],
  "known_competitors": ["Company A", "Company B"]
}
  • search_variants: Incorporated into Perplexity query generation for more targeted results

  • known_competitors: Pre-seeded into candidate list with source_queries: ["user_provided"]


Pipeline Position

Dataroom → Deck → Research → Section Research → Competitive Researcher →
Competitive Evaluator → [CITE on 1-research/] → [GATE 1] → Writer → ...

Both agents run in the research phase, after section research generates per-section research files, and before citation enrichment. The writer receives the evaluated competitive landscape data in state and can use it directly.


Status

Initial implementation — not yet tested with a live run. All imports verified, workflow builds with 28 nodes. Awaiting end-to-end test before promoting to feat(agent).