Skip to content

Repository files navigation

HypoForge: Your AI Co-Scientist

Stop searching papers. Start discovering new science.

HypoForge is an open-source multi-agent AI system that takes a research question and your data, then generates ranked, testable hypotheses with experiment designs. It is like having a team of AI research assistants working together to help you find new ideas.

What Can You Do With It?

  • Upload a climate dataset and ask: "How does green space affect temperature?" -- get back a causal graph, ranked hypotheses, and an experiment protocol
  • Upload a health dataset and ask: "Does air pollution affect sleep quality?" -- get back counterfactual simulations with confidence intervals
  • No data? Just ask a question and get literature-grounded hypotheses

How It Works (Simple Version)

You give HypoForge a research goal and optional data. Eight AI agents run in sequence:

  1. Literature Scout -- Searches arXiv for relevant papers
  2. Data Analyst -- Analyzes your data and discovers cause-effect relationships
  3. Hypothesis Generator -- Creates candidate hypotheses
  4. Critic -- Tests each hypothesis for flaws
  5. Evolver -- Ranks and combines the best ones
  6. Simulator -- Predicts outcomes using ML
  7. Experiment Designer -- Creates a step-by-step protocol
  8. Meta-Reviewer -- Writes a final report

Each agent passes its work to the next. The result is a ranked list of hypotheses with evidence, simulations, and experiment designs.

Quick Start

# Install dependencies
pip install -r requirements.txt

# Generate sample data and run pipeline
python examples/urban_climate.py

# Or launch the interactive dashboard
streamlit run src/ui/app.py

Then in the dashboard:

  1. Upload data/urban_climate_sample.csv (generated by the example script)
  2. Enter a research goal like "How does green space affect temperature?"
  3. Click "Run Pipeline"
  4. Explore results in the tabs: ranked hypotheses, causal graph, simulations, report

Project Structure

src/
  agents/            8 AI agents (one per job)
  causal/            Causal discovery (PC algorithm)
  simulation/        ML surrogate models and counterfactual engine
  ui/                Streamlit dashboard with 5 tabs
  rag_index.py       Semantic search index for papers
  orchestrator.py    Pipeline that runs all agents in order
  state.py           Shared data object passed between agents
docs/                Guides and documentation
examples/            Ready-to-run domain examples
data/                Sample data and file uploads

Technical Overview

Tech Stack

Component Technology
Agent pipeline Python functions with shared Pydantic state
Literature search arXiv API + Chroma vector DB
Causal discovery PC algorithm (partial correlation, conditional independence tests, v-structure orientation, Meek rules)
ML simulation scikit-learn RandomForest + bootstrap confidence intervals
Frontend Streamlit + PyVis interactive graphs
State management Pydantic v2

The Eight Agents in Detail

Literature Scout turns your question into search queries, fetches papers from the arXiv API, and embeds them into a vector database (Chroma with sentence-transformers). When you search again, it returns semantically ranked results.

Data Analyst loads your CSV or Parquet, runs automated EDA (summary statistics, missing values, correlations), and discovers a causal graph using the PC algorithm. It identifies confounders (hidden common causes) and mediators (intermediate variables).

Hypothesis Generator creates 5-10 candidates by combining three sources: anomalies found in your data, causal paths from the discovered graph, and gaps in the literature.

Critic stress-tests each hypothesis for plausibility (is there evidence?), causal fallacies (do the variables actually connect in the graph?), and feasibility (can this be tested?).

Evolver scores hypotheses by novelty, causal rigor, testability, and impact. It applies genetic crossover (combining two good hypotheses) and mutation (randomly boosting scores) to create stronger candidates.

Simulator trains a RandomForest model on your data. For each top hypothesis, it runs a counterfactual prediction (what if we change X to value Y?) with bootstrap confidence intervals.

Experiment Designer converts hypotheses into formal protocols with independent/dependent variables, confounders to control, recommended statistical test, sample size estimate, and step-by-step procedure.

Meta-Reviewer compiles everything into a synthesis report with all scores, evidence, simulation results, and safety flags.

Dashboard Tabs

Tab What You See
Research Setup Goal input, file upload, run button, pipeline summary
Agent Debate Chat log showing agent discussions
Ranked Hypotheses Expandable cards with scores and evidence
Causal Graph & Simulator Interactive graph + live counterfactual slider
Report & Export Full report with Markdown download

Pre-Built Examples

python examples/urban_climate.py      # Green space, temperature, air quality
python examples/biodiversity_climate.py  # Species, temperature, rainfall
python examples/health_environment.py    # Sleep, air quality, noise

Each generates sample data, runs the pipeline, and saves a report to disk.

Requirements

  • Python 3.10+
  • Dependencies in requirements.txt
  • Internet connection (for arXiv lookups)
  • Optional: sentence-transformers (auto-downloads model for semantic search)

License

MIT

About

This is a hackathon project...

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages