What are Agents?
Agents are the core concept in BioAgents. Each agent is a self-contained, independent function that performs a specific task in the research workflow. Agents are designed to be modular and reusable across different routes and contexts.Agent Design Philosophy
Single Responsibility
Single Responsibility
Each agent focuses on one specific task. For example, the Literature Agent only searches literature - it doesn’t analyze data or generate hypotheses.
Composability
Composability
Agents can be combined in different sequences to achieve different workflows. Chat mode uses a subset of agents, while Deep Research uses all agents.
Isolation
Isolation
Agents receive state as input and return results. They don’t directly mutate global state (except through designated state update mechanisms).
Testability
Testability
Pure functions make agents easy to test in isolation with mock inputs.
Complete Agent Reference
File Upload Agent
Location:src/agents/fileUpload/
Purpose: Handles file parsing, storage, and automatic description generation
Supported Formats:
- Excel (XLSX, XLS)
- CSV
- Markdown (MD)
- JSON
- TXT
- Generates AI-powered descriptions for each dataset
- Stores files in cloud storage with metadata
- Extracts text content from PDFs
- Parses structured data from spreadsheets
conversationState.values.uploadedDatasets[]
Planning Agent
Location:src/agents/planning/index.ts:71
Purpose: Creates research plans based on user questions and current state
Modes:
- initial: Creates tasks for the current iteration (used at start)
- next: Plans next iteration after reflection (used after hypothesis generation)
conversationState.values.plan)
Literature Agent
Location:src/agents/literature/
Purpose: Searches and synthesizes scientific literature
Supported Types:
- OPENSCHOLAR: General scientific literature with citations
- EDISON: Edison AI literature search (deep research only)
- BIO / BIOLIT / BIOLITDEEP: BioAgents Literature API
- KNOWLEDGE: Custom knowledge base
(claim)[DOI or URL]
Example:
onPollUpdate callback receives reasoning traces during execution
Analysis Agent
Location:src/agents/analysis/
Purpose: Performs data analysis on uploaded datasets
Supported Types:
- EDISON: Deep analysis via Edison AI
- BIO: BioAgents Data Analysis Agent (state-of-the-art)
Hypothesis Agent
Location:src/agents/hypothesis/
Purpose: Generates research hypotheses from completed tasks
Input:
- create: First hypothesis for conversation
- update: Major revision based on new findings
- refine: Minor refinement of existing hypothesis
conversationState.values.currentHypothesis
Reflection Agent
Location:src/agents/reflection/
Purpose: Extracts insights and evolves research objectives
Input:
conversationTitleevolvingObjectivecurrentObjectivekeyInsights[]methodology
Discovery Agent
Location:src/agents/discovery/
Purpose: Identifies novel claims with evidence links
Input:
conversationState.values.discoveries[]
Reply Agent
Location:src/agents/reply/
Purpose: Generates user-facing responses
Modes:
- Deep Research Mode: Includes objective, next steps, feedback request
- Chat Mode: Concise answer without next steps
Agent Execution Patterns
Sequential Execution
Parallel Execution
Real-time Updates
Best Practices
Use Type Safety
Leverage TypeScript types from
src/types/core.ts for all agent inputs and outputsHandle Errors Gracefully
External services may fail - always handle errors and provide fallback behavior
Log Extensively
Use structured logging to track agent execution and debug issues
Preserve Citations
Maintain inline citation format
(claim)[DOI] throughout agent pipelineNext Steps
Architecture
Multi-agent architecture overview
Deep Research
Deep research workflow details
State Management
Understanding state types
Custom Agents
Build your own agents