# 04 Molecule vs Collection

## Quick Answer
Molecule mode focuses on one molecule neighborhood. Collection mode analyzes multiple molecules and enables full multi-tab modules (collective expression, specificity, communication, pathway, disease).

## What this does
Explains mode inference and direction behavior.

## Inputs
- Molecule: one token query
- Collection: multi-line, delimiter-separated, or space-separated list
- Direction: `Both`, `Downstream`, `Upstream`

## Outputs
- Molecule: network + node-level evidence emphasis
- Collection: network + all system-level modules and tab workflows

## How calculated
Mode is inferred from parsed token count. The parser splits on newlines, commas, semicolons, or (when no explicit delimiters exist) spaces. Direction controls which expansion steps are prioritized in pathway graph generation. Collection mode triggers lazy loading for heavy tabs, with balanced defaults to keep first paint responsive.

## What to download
For manuscript workflows, use full-collection exports even if UI is capped.

## Agent reverse-start workflows (Phase 12)

EVd3x chat can now start from disease or cell-communication context before composing a molecule query:

- Disease-first: `GET /api/agent/reverse_disease`
  - input: disease text + `top_k`
  - output: ranked mRNA/miRNA entities with evidence-weighted score and provenance snippets
- Cell-communication-first: `GET /api/agent/reverse_cell_comm`
  - input: source cell + target cell + `top_k`
  - output: ranked signaling genes and linked miRNAs with provenance snippets

The chat planner then composes a graph query from ranked entities and executes normal EVd3x search/lens actions.
Scientific source-of-truth stays in EVd3x APIs; the model only plans actions/explanations.

If you want every natural-language prompt to route through chat (instead of the keyword heuristic), set `AGENT_ALWAYS_ON=true`.

## Known limits
Very dense collection inputs increase graph complexity and can require stricter view caps for interactive responsiveness.
