Skip to main content

Lightweight biomedical literature research tool - no PostgreSQL required

Project description

BMLibrarian Lite

A lightweight biomedical literature research tool - no PostgreSQL required.

BMLibrarian Lite is a simplified version of BMLibrarian that provides AI-powered literature search and analysis capabilities without requiring a PostgreSQL database. It uses only the PubMed E-utilities API for searching and fetching article metadata instead of a local database. It uses ChromaDB for vector storage and SQLite for metadata, making it easy to install and use on any machine. Also, in order to allow it to run on computers with limited resources, it uses FastEmbed for local embeddings and allows to use cloud LLM providers like Anthropic Claude instead of relying exclusively on local inference.

Features

  • Systematic Literature Review: Search PubMed, score documents, extract citations, and generate reports
  • Document Interrogation: Interactive Q&A with loaded documents
  • PDF Discovery & Download: Automatic PDF retrieval from PubMed Central, Unpaywall, and DOI resolution
  • Quality Assessment: Automated study quality evaluation with evidence grading
  • Audit Trail: Real-time visibility into the review workflow with LLM reasoning transparency
  • Multiple LLM Providers: Support for both Anthropic Claude (online) and Ollama (local)
  • Embedded Storage: ChromaDB + SQLite - no external database needed
  • Cross-Platform GUI: PySide6-based desktop application

Quick Start

Installation

From PyPI (recommended):

pip install bmlibrarian-lite

From source:

# Clone the repository
git clone https://github.com/hherb/bmlibrarian-lite.git
cd bmlibrarian-lite

# Create virtual environment and install
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .

Configuration

  1. Set your Anthropic API key (for Claude):

    export ANTHROPIC_API_KEY="your-api-key-here"
    
  2. Or configure Ollama (for local models):

    # Install Ollama: https://ollama.ai
    ollama pull llama3.2
    export OLLAMA_HOST="http://localhost:11434"
    
  3. Optional: Set your email for PubMed (recommended):

    export NCBI_EMAIL="your@email.com"
    
  4. Optional: Configure PDF Discovery (for Unpaywall API):

    • Go to Settings in the GUI
    • Enter your email address for Unpaywall API access
    • Configure OpenAthens if you have institutional access

Running the Application

# Launch the GUI (short command)
bmll

# Or using the full name
bmlibrarian-lite

# Or using Python module
python -m bmlibrarian_lite

CLI Commands

# Show storage statistics
bmll stats

# Validate configuration
bmll validate --verbose

# Show current configuration
bmll config

# Clear all data
bmll clear

# Show version
bmll --version

Usage

Systematic Review Workflow

  1. Enter your research question in the main text area
  2. Click "Search" to query PubMed
  3. Review found articles and adjust filters as needed
  4. Score documents for relevance (1-5 scale)
  5. Extract citations from high-scoring documents
  6. Generate a report synthesizing the evidence

Audit Trail

The Audit Trail tab provides real-time visibility into the systematic review workflow:

  • Queries Tab: View generated PubMed queries and search statistics
  • Literature Tab: Browse document cards with relevance scores and quality badges
    • Click cards to expand and view abstracts
    • See LLM rationales for scoring and quality decisions
    • Quality badges show study design (RCT, Systematic Review, etc.)
  • Citations Tab: View extracted citation passages with highlighting

Right-click any document card to send it to the Document Interrogator for deeper analysis.

Document Interrogation

  1. Switch to the "Document Interrogation" tab
  2. Load a document (PDF, TXT, or MD file)
  3. Ask questions about the document content
  4. Get AI-powered answers with source references

Configuration

Configuration is stored in ~/.bmlibrarian_lite/config.json:

{
  "llm": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-20250514",
    "temperature": 0.7,
    "max_tokens": 4096
  },
  "embeddings": {
    "model": "BAAI/bge-small-en-v1.5"
  },
  "pubmed": {
    "email": "your@email.com"
  },
  "search": {
    "chunk_size": 512,
    "chunk_overlap": 50,
    "similarity_threshold": 0.7,
    "max_results": 100
  }
}

LLM Providers

Anthropic Claude (default):

{
  "llm": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-20250514"
  }
}

Ollama (local):

{
  "llm": {
    "provider": "ollama",
    "model": "llama3.2"
  }
}

You can also use the model string format: anthropic:claude-sonnet-4-20250514 or ollama:llama3.2

Requirements

  • Python 3.12+
  • Internet connection (for PubMed search and Claude API)
  • ~500MB disk space for embeddings cache

Dependencies

  • chromadb: Vector storage
  • fastembed: CPU-optimized embeddings
  • anthropic: Claude API client
  • ollama: Ollama API client
  • PySide6: GUI framework
  • PyMuPDF: PDF processing

Differences from Full BMLibrarian

BMLibrarian Lite is designed for ease of use and portability:

Feature BMLibrarian BMLibrarian Lite
Database PostgreSQL + pgvector ChromaDB + SQLite
Embeddings Ollama (local) FastEmbed (CPU)
PDF Discovery Full (Unpaywall, PMC, OpenAthens) Included (PMC, Unpaywall, DOI)
Multi-Agent Workflow Full orchestration Simplified workflow
Audit Trail N/A Real-time workflow visibility
Installation Complex Simple pip install

Documentation

Documentation is organized into three categories:

  • User Documentation (doc/user/): End-user guides and tutorials
  • Developer Documentation (doc/developer/): Architecture, API, and contribution guides
  • LLM Context (doc/llm/): Context for AI assistants working with the codebase
    • golden_rules.md - Coding standards
    • database-schema.md - Database schema reference

Development

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linting
ruff check .

# Run type checking
mypy src/

License

GPL-3.0 License - see LICENSE file for details.

Acknowledgments

BMLibrarian Lite is derived from BMLibrarian, a comprehensive biomedical literature research platform.

Support

  • Issues: GitHub Issues
  • Documentation: See the doc/ directory for detailed guides

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bmlibrarian_lite-0.1.1.tar.gz (5.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bmlibrarian_lite-0.1.1-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file bmlibrarian_lite-0.1.1.tar.gz.

File metadata

  • Download URL: bmlibrarian_lite-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for bmlibrarian_lite-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5520f4dc983b050a509cc430ba0f09416fa33719d9a917d71f24fe198d3f5683
MD5 ec39acb6d4b2bd5a33b1590da9993613
BLAKE2b-256 6ee3613fb0546aa3f6f6ca556d5f1aabc4570826d48ade2e3c3929f3a36e2783

See more details on using hashes here.

File details

Details for the file bmlibrarian_lite-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bmlibrarian_lite-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06977ecabe21b47871c1e8192515f79f571675ae7faa53743ad8848ccc145c2f
MD5 744ab6c56f7c10975987d76c2524cc46
BLAKE2b-256 c2d2d14f004fc89e10ec2ab88683c4ad41241bcd08fb8a539eb319b207c1396b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page