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 nor a powerful GPU and fast memory for local AI. 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. Using local models with ollama is optional.
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
-
Set your Anthropic API key (for Claude):
export ANTHROPIC_API_KEY="your-api-key-here"
-
Or configure Ollama (for local models):
# Install Ollama: https://ollama.ai ollama pull llama3.2 export OLLAMA_HOST="http://localhost:11434"
-
Optional: Set your email for PubMed (recommended):
export NCBI_EMAIL="your@email.com"
-
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
- Enter your research question in the main text area
- Click "Search" to query PubMed
- Review found articles and adjust filters as needed
- Score documents for relevance (1-5 scale)
- Extract citations from high-scoring documents
- 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
- Switch to the "Document Interrogation" tab
- Load a document (PDF, TXT, or MD file)
- Ask questions about the document content
- 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 codebasegolden_rules.md- Coding standardsdatabase-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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bmlibrarian_lite-0.2.0.tar.gz.
File metadata
- Download URL: bmlibrarian_lite-0.2.0.tar.gz
- Upload date:
- Size: 5.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e66b8b5d0372256a60b270c1ba2e5302dfebabd5ca1764039998e45907235204
|
|
| MD5 |
d90ba63381c6759ad9d9da1407b6f9b6
|
|
| BLAKE2b-256 |
c859e6746dc093e51e4b62fb11fc2efe576366e6a3977b0c62ef678453a8138f
|
File details
Details for the file bmlibrarian_lite-0.2.0-py3-none-any.whl.
File metadata
- Download URL: bmlibrarian_lite-0.2.0-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ada3752fd219babbc66b1c5d1c8073581009a1c73f8be78ae0139e77f57c9b44
|
|
| MD5 |
b7ff39673f388783b4fb16503ea2a4fe
|
|
| BLAKE2b-256 |
f6664db035571bc5a9867d59ea1f4b4f2e753fd03130fcf13b8362a1c1fd3ddf
|