AutoBioResearch is an autonomous biological knowledge graph builder. It searches scientific literature, extracts entities and interactions with an LLM, stores evidence in SQLite, detects contradictory claims, and generates follow-up queries to keep the loop moving.
The current project is centered on a working local pipeline:
- literature retrieval from PubMed and Semantic Scholar
- transient PMC full-text fetching when available
- LLM-based extraction of entities, interactions, and evidence snippets
- entity normalization with seeded synonyms plus optional UniProt/ChEBI lookups
- conflict detection, LLM-assisted conflict analysis, and follow-up query generation
- query planning based on prior query yield and graph impact
- graph export and database maintenance scripts
- a perturbation propagation prototype over the built graph
- pulls papers from PubMed and Semantic Scholar
- prefers PMC full text when available, but does not store full text in the database
- extracts entities, interactions, evidence type, direction, effect, and biological context
- stores literal claim records and normalized evidence records separately so older data can be reprocessed
- deduplicates entities with exact synonym lookup, seeded aliases, fuzzy matching, and optional external resolution
- normalizes evidence context fields such as organism, tissue or cell type, condition, and assay
- verifies selected claims and marks them as
verifiedorneeds_review
- detects conflicting interaction claims already present in the graph
- classifies conflicts as
true_conflict,context_dependent, orambiguous - generates follow-up search queries for unresolved conflicts
- scores and prioritizes pending queries using observed yield and graph gaps
- generates targeted gap-filling queries for sparse entities and under-supported seeded interactions
- logs per-cycle graph metrics and score history
- exports the graph to JSON or GraphML
- includes a perturbation propagation prototype for downstream effect analysis
autobioresearch/
main.py Main orchestration loop
config.py Config loading from YAML and environment
database.py SQLite schema, indexes, and additive migrations
metrics.py Score computation
planner.py Query planning and targeted query generation
api/ FastAPI server, routes, schemas, dependencies
crawlers/ PubMed, Semantic Scholar, PMC, external entity resolvers
extractor/ LLM client, extraction, normalization, verification
conflict/ Conflict detection, adjudication, and resolution
perturbation/ Sign mapping and propagation logic
seeders/ UniProt/IntAct, Reactome, and SIGNOR importers
storage/ Repository layer for DB access
models/ Pydantic models
utils/ Logging helpers and text utilities
frontend/ React + Vite + TypeScript + Cytoscape.js source
frontend_dist/ Built frontend (served by the API at /)
scripts/
init_db.py Create schema and indexes
add_indexes.py Add performance indexes (safe to re-run)
seed_interactions.py Import curated interactions
reset_db.py Soft or hard reset for SQLite DBs
inspect_conflicts.py Review conflict queue from the CLI
export_graph.py Export graph to JSON or GraphML
reprocess_existing_data.py Backfill newer reliability fields on older DBs
validate_synonym_overlaps.py Audit duplicate synonym mappings
warm_cache.py Precompute perturbation results for top-N entities
benchmark_queries.py Measure query latency and check migration readiness
perturbation_prototype.py Run propagation from a seed entity
The SQLite database currently includes these core tables:
papers: paper metadata and abstractsentities: canonical entitiesentity_synonyms: lookup table for aliasesinteractions: unique normalized interaction claimsliteral_claims: raw snippet-grounded claims captured before normalizationevidence: normalized evidence rows linked to interactionsconflicts: detected contradictions between interaction claimssearch_queries: pending, running, completed, and failed search workmetrics_log: per-cycle telemetry and score history
Full text from PMC is fetched transiently during extraction and is not stored.
- Python 3.10+
uvrecommended, orpip- one of:
ANTHROPIC_API_KEYfor Anthropic mode- an OpenAI-compatible local or remote endpoint for
openai_compatiblemode
git clone https://github.com/JMGamma/autobioresearch
cd autobioresearch
uv syncIf you want the test dependencies as well:
uv sync --group devCreate a local environment file:
cp .env.example .envConfiguration is split across:
.envfor secrets such asANTHROPIC_API_KEY,NCBI_API_KEY,SEMANTIC_SCHOLAR_API_KEY, andLLM_API_KEYconfig.yamlfor runtime behavior
Important config.yaml settings in the current codebase include:
llm_api_type: "anthropic" # or "openai_compatible"
llm_model: "claude-sonnet-4-6"
llm_base_url: null # required for openai_compatible mode
db_path: "./autobioresearch.db"
cache_db_path: "./explorer_cache.db" # perturbation cache (separate from research DB)
queries_per_cycle: 10
papers_per_cycle: 50
targeted_queries_per_cycle: 10
cycle_sleep_seconds: 300
max_cycles: 0 # 0 = run forever
verification_enabled: true
claims_to_verify_per_cycle: 25
entity_resolution_enabled: true
entity_resolution_requests_per_second: 3.0
semantic_scholar_enabled: true # set false to disable Semantic Scholar API calls
# API server
api_port: 8000
allowed_origins:
- "*" # restrict in production
# Perturbation
perturbation_max_depth: 4 # hard cap enforced by the API
perturbation_combination_exponent: 0.55 # multi-path score blending (lower = first path dominates)For local models, openai_compatible mode expects a server that supports tool or function calling.
Reasoning capture for compatible local models can be enabled in config.yaml:
log_reasoning: true
reasoning_log_file: "./logs/reasoning.log"
reasoning_log_max_bytes: 10485760
reasoning_log_backup_count: 3Initialize the database:
uv run scripts/init_db.pyOptionally seed curated interactions before running the loop:
uv run scripts/seed_interactions.py
uv run scripts/seed_interactions.py --source uniprot
uv run scripts/seed_interactions.py --source reactome
uv run scripts/seed_interactions.py --source signorRun the main loop:
uv run -m autobioresearch.mainUseful options:
--config PATH
--cycles N
--no-conflicts
The FastAPI server serves a React-based knowledge graph explorer at / and
the API at /api/. Run it with:
uv run autobioresearch/api/main.pyThe frontend is pre-built and served from frontend_dist/. For live-reloading
during frontend development:
cd frontend && npm run dev| Endpoint | Method | Description |
|---|---|---|
GET /api/entities/search?q=… |
GET | Search entities by name or synonym |
GET /api/entities/{id} |
GET | Entity detail with interaction summary |
POST /api/subgraph |
POST | Neighborhood subgraph up to 3 hops |
POST /api/perturbation |
POST | Propagate suppress/promote signal through graph |
POST /api/paths |
POST | Shortest paths between two entities |
GET /api/evidence/{interaction_id} |
GET | Evidence records for an interaction |
GET /api/stats |
GET | Graph-level counts and cycle metrics |
Rate limits: 120 req/min global; 30 req/min for /api/perturbation.
Reset a database for testing:
uv run scripts/reset_db.py
uv run scripts/reset_db.py --hard --yes
uv run scripts/reset_db.py --db-path ./test.db --yesInspect conflicts:
uv run scripts/inspect_conflicts.py
uv run scripts/inspect_conflicts.py --status open --type true_conflict --show-evidenceAudit synonym overlaps:
uv run scripts/validate_synonym_overlaps.py
uv run scripts/validate_synonym_overlaps.py --show-rows --limit 20Export the graph:
uv run scripts/export_graph.py --format json --out graph.json
uv run scripts/export_graph.py --format graphml --out graph.graphml
uv run scripts/export_graph.py --format json --min-confidence high --min-evidence 2Backfill newer processing fields onto an existing database:
uv run scripts/reprocess_existing_data.py
uv run scripts/reprocess_existing_data.py --refresh-conflictsRun the perturbation prototype:
uv run scripts/perturbation_prototype.py --entity TP53 --mode suppress --depth 3
uv run scripts/perturbation_prototype.py --entity BRCA2 --mode promote --depth 2 --out results.jsonApply database indexes (one-time setup, safe to re-run):
uv run scripts/add_indexes.pyWarm the perturbation cache after a large ingest or fresh deploy:
uv run scripts/warm_cache.py # top 50 entities, depth 3
uv run scripts/warm_cache.py --top 100 --depth 4Benchmark query latency and check migration readiness:
uv run scripts/benchmark_queries.py
uv run scripts/benchmark_queries.py --iterations 20Prints p50/p95/p99 for all hot paths. Outputs a MIGRATION SIGNAL line if
/api/perturbation depth=3 p99 exceeds 2 s — see CLAUDE.md for the
PostgreSQL migration checklist.
The repository includes pytest coverage for extraction workflows, normalization, crawlers, entity resolution, seeders, and perturbation propagation.
Run the test suite with:
uv run pytest- Two SQLite databases are used intentionally:
autobioresearch.dbfor the research graph (crawler writes, API reads) andexplorer_cache.dbfor the perturbation cache (API writes only). WAL mode on both files allows concurrent reads without blocking. Do not merge them — the split prevents lock contention between the crawler write loop and the API cache writes. - Existing databases are updated with additive migrations when the schema is created.
- Conflict resolution and claim verification both rely on the configured LLM backend.
Project provided under MIT license terms