Architecture

How Beacon's research system is structured.

Beacon's core differentiator is the workflow composition across three engineering layers — context, memory, and harness — running real parallel agents, not one sequential chain.

Search docs, support, and public pages
search
Layers

Three engineering layers

Context

Plans queries, assigns tracks to parallel agents, compresses search results, and guides per-track synthesis. Every decision about what the model sees is made here.

Memory

Loads what a topic already knows first, filters seen URLs, and saves updated state last — across sessions. Run #2 never repeats what run #1 already indexed.

Harness

Step idempotency, self-healing retries on empty results, graceful fallbacks on all failure modes, and structured logging at every checkpoint.

Deep Mode

Multi-agent run flow

Phase A — Fan out (parallel)
  planQueries()  →  12-15 queries split across 3 tracks
  ├─ track: exploration  (landscape, recent news, history)
  ├─ track: competitive  (players, pricing, launches)
  └─ track: signals      (Reddit, HN, expert opinions)

  All SerpAPI queries across all tracks run simultaneously
  via Promise.all — no sequential bottleneck.

Phase B — Parallel synthesis
  synthesizeTrack("exploration")  ←── [Context]
  synthesizeTrack("competitive")  ←── [Context]  all 3 simultaneously
  synthesizeTrack("signals")      ←── [Context]

  Each track agent writes findings independently.
  Only fresh (unseen) URLs are passed to each agent.

Phase C — Cross-validation
  validateAndMerge()  ←── [Context + Harness]
  Receives all 3 track reports. Cross-checks findings,
  flags contradictions or multi-agent confirmation,
  produces one authoritative delta report.

Phase D — Persist
  saveMemory()  ←── [Memory]
  sleep(7 days)  →  tail-recurse as delta run
Quick Mode

Single-agent run flow

1. loadMemory
2. planQueries  →  5-7 queries, no track split
3. runSerpQuery × N  (all parallel via Promise.all)
4. synthesizeReport  (single synthesis pass)
5. saveMemory
6. optional recurring sleep + rerun
Self-Healing

Harness reliability patterns

runSerpQuery — 3 retries

Each search query retries up to 3 times on empty results or thrown errors. Returns an empty block instead of throwing — one bad query never kills the workflow.

synthesizeTrack — retry + fallback

If the LLM returns less than 120 chars, retries once. Falls back to a placeholder section so validateAndMerge always has content from all 3 tracks.

planQueries — safe fallback

If JSON parse fails, emits a hardcoded 8-query fallback covering all 3 tracks. The workflow never stops due to a malformed model response.

saveMemory — never throws

Memory failure is caught, logged, and silently dropped. The final report is always returned even if the persistence layer is unavailable.

Research Frameworks

Structured output overlays

Beacon ships with 20+ research frameworks — JTBD, SWOT, Problem-Solution Fit, RICE, and more. When a framework is selected, planQueries receives a queryHint that shapes what the scout model searches for, and validateAndMerge / synthesizeReport receive a synthesisHint that structures the final report output. The framework layer sits on top of the agent architecture — it does not replace it.

Model Rules

Approved model layer

Beacon uses scoutModel (Groq llama-4-scout) for tool use and planning, and synthModel (llama-3.3-70b-versatile) for writing — both sourced from @/lib/groq. Direct provider imports outside that abstraction are intentionally not part of the repo contract.