Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bio-xyz/BioAgents/llms.txt

Use this file to discover all available pages before exploring further.

The Literature Agent searches scientific literature and synthesizes findings with inline citations. It supports multiple backends including OpenScholar, BioLit, Edison, and custom knowledge bases.

Function Signature

// src/agents/literature/index.ts
export async function literatureAgent(input: {
  objective: string;
  type: LiteratureType;
  onPollUpdate?: OnPollUpdate;
}): Promise<LiteratureResult>;

type LiteratureType = "OPENSCHOLAR" | "KNOWLEDGE" | "EDISON" | "BIOLIT" | "BIOLITDEEP";

type LiteratureResult = {
  objective: string;
  output: string;
  count?: number;          // Number of sources found
  jobId?: string;          // External job ID for polling
  reasoning?: string[];    // Real-time reasoning trace
  start: string;
  end: string;
};

Backends

OpenScholar

General scientific literature search with high-quality citations.
const result = await literatureAgent({
  objective: "What are the mechanisms of cellular senescence?",
  type: "OPENSCHOLAR"
});
Configuration:
OPENSCHOLAR_API_URL=https://your-openscholar-api
OPENSCHOLAR_API_KEY=your_key
See OpenScholar deployment for setup.

BioLit

BioAgents Literature API with semantic search and LLM reranking.
Quick literature search for simple queries:
const result = await literatureAgent({
  objective: "Effects of rapamycin on aging",
  type: "BIOLIT"
});
Configuration:
PRIMARY_LITERATURE_AGENT=bio
BIO_LIT_AGENT_API_URL=https://your-biolit-api
BIO_LIT_AGENT_API_KEY=your_key

Knowledge Base

Search your custom knowledge base using vector search with Cohere reranking.
const result = await literatureAgent({
  objective: "Internal research on protein folding",
  type: "KNOWLEDGE"
});
Setup:
1

Add documents

Place PDF, DOCX, or Markdown files in docs/ directory
2

Configure embeddings

Set embedding provider in .env:
EMBEDDING_PROVIDER=openai
TEXT_EMBEDDING_MODEL=text-embedding-3-large
3

Enable reranking

Configure Cohere for better results:
COHERE_API_KEY=your_key
USE_RERANKING=true
RERANK_FINAL_LIMIT=5
See Knowledge Base for details.

Edison

Deep literature search via Edison AI agent (deep research mode only).
const result = await literatureAgent({
  objective: "Recent advances in CRISPR gene editing",
  type: "EDISON"
});
Configuration:
EDISON_API_URL=https://your-edison-api
EDISON_API_KEY=your_key
See Edison deployment.

Output Format

The agent returns synthesized findings with inline citations in the format:
(claim)[DOI or URL]
Example:
(Rapamycin extends lifespan in mice by up to 60%)[10.1038/nature.2009.1234]
(The mechanism involves mTOR pathway inhibition)[https://example.com/paper]

Usage Example

// src/routes/chat.ts
const completedTasks: PlanTask[] = [];

for (const task of literatureTasks) {
  const result = await literatureAgent({
    objective: task.objective,
    type: "OPENSCHOLAR"
  });
  
  task.output = result.output;
  task.start = result.start;
  task.end = result.end;
  
  completedTasks.push(task);
}

Configuration

OPENSCHOLAR_API_URL
string
OpenScholar API base URL (optional)
OPENSCHOLAR_API_KEY
string
OpenScholar API key (optional)
PRIMARY_LITERATURE_AGENT
string
default:"openscholar"
Primary agent: bio, openscholar, or edison
BIO_LIT_AGENT_API_URL
string
BioLit API base URL (when PRIMARY_LITERATURE_AGENT=bio)
BIO_LIT_AGENT_API_KEY
string
BioLit API key (when PRIMARY_LITERATURE_AGENT=bio)
EDISON_API_URL
string
Edison API base URL (optional)
EDISON_API_KEY
string
Edison API key (optional)
KNOWLEDGE_DOCS_PATH
string
default:"docs"
Path to knowledge base documents

Knowledge Base

Set up vector search

Planning Agent

Generates literature tasks

Deep Research

Iterative research cycle