A multi-agent system for biomedical research that transforms academic papers into interactive agents to conduct unbiased meta-analyses through structured discussions.
┌─────────────────────────────────────────────────────────────────────────┐
│ DECENTRALIZED META-ANALYSIS │
└─────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────┐ ┌──────────────┐ ┌──────────────────┐
│ PDF Processing │ │ Structured │ │ Agent Creation │
│ │──OCR───▶│ Extraction │──Data──▶│ │
│ (Mistral OCR) │ │ (LM Studio) │ │ (Paper Agents) │
└─────────────────┘ └──────────────┘ └──────────────────┘
│
▼
┌─────────────────────────┐ ┌─────────────────────┐
│ │ │ │
│ Meta-Analysis Report │◀────Synthesis──────────│ Agent Discussion │
│ │ │ │
└─────────────────────────┘ └─────────────────────┘
│
▼
┌───────────────────┐
│ │
│ Streamlit UI │
│ (WhatsApp UI) │
│ │
└───────────────────┘
This framework implements an innovative approach to meta-analysis in biomedical research by treating academic papers as intelligent agents in a simulated discussion. Each paper becomes a "personified agent" that can express its findings, methodologies, and limitations, leading to a more nuanced and potentially less biased synthesis of research.
- PDF Processing: Batch extraction of text from academic papers using Mistral OCR
- Personified Papers: Transform research papers into interactive agents with distinct perspectives
- Group Discussion: Multi-agent framework where papers engage in structured discussions
- Bias Reduction: Decentralized approach helps mitigate researcher bias in meta-analysis
- WhatsApp-like UI: Intuitive interface to observe and follow agent discussions
- Structured Output: Comprehensive meta-analysis reports synthesized from discussions
-
Clone the repository:
git clone https://github.com/username/decentralized-meta-analysis.git cd decentralized-meta-analysis -
Install the required dependencies:
pip install -r requirements.txt
-
Set up your environment variables:
cp .env.template .env
-
Edit the
.envfile with your API keys:MISTRAL_API_KEY=your_mistral_api_key_here OPENAI_API_KEY=your_openai_api_key_here # Or if using LM Studio locally: LM_STUDIO_URL=http://localhost:1234/v1 LM_STUDIO_MODEL=your_model_name_here
This framework offers two methods for processing PDFs:
- Description: Process multiple PDFs simultaneously in a single batch API call
- Advantages: Faster, more efficient for large numbers of papers
- Disadvantages: Higher API costs, as Mistral batch processing is priced per batch
- Best for: Large meta-analyses, time-sensitive projects, production environments
- Description: Process PDFs one at a time with individual API calls
- Advantages: Lower cost, better for smaller projects, easier to monitor progress
- Disadvantages: Slower, especially for many papers
- Best for: Small meta-analyses, academic projects, testing environments
Launch the application with the Streamlit interface:
streamlit run app.py -- --uiNote: The UI defaults to sequential (budget-friendly) processing. You can toggle this option in the UI before starting the meta-analysis.
The UI allows you to:
- Upload PDFs: Select multiple academic papers for analysis
- Define Research Question: Specify what you want to investigate
- Choose Processing Method: Select batch (faster) or sequential (budget-friendly) processing
- Run Meta-Analysis: Start the agent-based discussion process
- View Discussion: Watch the conversation in a chat-like interface
- Review Results: Examine the synthesized meta-analysis report
- Save/Load Discussions: Store and retrieve previous analyses
For more advanced or automated workflows:
# Process PDFs and run a meta-analysis (using batch processing)
python app.py --pdf_dir path/to/pdfs --output_dir path/to/output --question "What is the effectiveness of treatment X on outcome Y?" --discussion_output results/discussion.json
# Use budget-friendly sequential processing instead
python app.py --pdf_dir path/to/pdfs --output_dir path/to/output --question "What is the effectiveness of treatment X on outcome Y?" --discussion_output results/discussion.json --sequential
# View specific saved discussion
streamlit run app.py -- --ui --load_discussion results/discussion.json- Mistral OCR Integration: Converts PDF documents to text
- Dual Processing Options:
- Batch Processing: Fast processing for multiple papers
- Sequential Processing: Budget-friendly option for processing one file at a time
- Structured Text Extraction: Preserves document structure
- LLM-Powered Extraction: Uses LM Studio/OpenAI to extract structured data
- Paper Model: Standardized representation of academic papers
- Domain-Specific Understanding: Recognizes research components
- Paper Agent: Represents each paper with its own perspective
- Discussion Orchestrator: Manages multi-agent conversations
- Phase-Based Discussion: Structured approach to meta-analysis
- WhatsApp-like Chat: Familiar messaging interface
- Real-time Updates: Follow discussions as they happen
- Interactive Elements: Upload, process, and analyze papers
The agent discussion follows these structured phases:
- Introduction Phase: Agents introduce key methodologies and findings
- Methodology Comparison: Analysis of research methods across papers
- Results Analysis: Discussion of outcomes and effect sizes
- Limitations Discussion: Critical examination of study limitations
- Synthesis: Collaborative development of conclusions
Each paper agent is defined by:
- Methodological Rigor: Assessment of study design quality
- Certainty Level: Confidence in results based on statistical significance
- Key Perspective: Unique contribution to the research question
- Memory: Awareness of the ongoing discussion context
The framework is highly customizable:
- Discussion Phases: Modify or extend the standard discussion phases
- Agent Behavior: Adjust how agents interpret and express their papers
- Meta-Analysis Format: Customize the structure of the final report
- UI Appearance: Modify the Streamlit interface to match your needs
- API Rate Limits: If hitting Mistral API limits, reduce batch size or add delays
- Memory Issues: For large papers, consider text chunking
- Model Responses: If agent responses are low quality, try different LLM models
- OCR Quality: For poor quality PDFs, consider pre-processing with image enhancement
- Use Sequential Processing: For small projects (1-10 papers), use the sequential processing option to minimize costs
- Batch Pricing Structure: Mistral's batch processing is priced per batch, so it's more cost-effective for large numbers of papers
- API Usage Monitoring: Set up monitoring to track API usage and costs
- Caching Results: Enable saving processed files to avoid re-processing the same PDFs
Set the DEBUG environment variable to True to enable detailed logging:
DEBUG=True streamlit run app.py -- --ui- Python 3.8+
- Mistral API key (for OCR)
- OpenAI API key or local LM Studio installation
- 8GB+ RAM recommended for processing multiple papers
- see the LICENSE file for details.
If you use this framework in your research, please cite:
@software{decentralized-meta-analysis,
author = {Your Name},
title = {Decentralized Meta-Analysis: A Multi-Agent Approach to Biomedical Research Synthesis},
year = {2025},
url = {https://github.com/username/decentralized-meta-analysis}
}
- Inspired by advances in multi-agent AI systems for scientific research
- Built with Mistral AI's OCR capabilities and OpenAI's language models
- Streamlit for the interactive user interface