CareFrame is an integrated research and clinical data platform designed to streamline the process of data collection, analysis, and interpretation for healthcare and research professionals.
CareFrame v0.1 is EXPERIMENTAL and by default may use cloud-based LLM providers (Anthropic Claude, Google Gemini) when API keys are configured.
DO NOT use cloud-based LLMs with sensitive healthcare data or PHI.
For production or clinical use:
- Use only local LLM models
- Remove all external API keys
- Configure appropriate security measures
- Follow all applicable data privacy regulations (HIPAA, GDPR, etc.)
See LICENSE for full disclaimer.
- Research Planning & Hypothesis Generation: Design studies and generate hypotheses
- Literature Search & Evidence Collection: Find and organize research literature
- Data Collection & Management: Collect, clean, reshape, and manage clinical data
- Analysis Tools: Statistical analysis, sensitivity analysis, subgroup analysis, and more
- Blockchain Integration: Secure data exchange and validation
- AI Assistant: Built-in agent to help with research tasks
- BioNLP Annotation: Tools for biomedical text annotation
- Secure API Key Management: Encrypted storage of API keys for external services
- Local LLM Support: Use local LLM models instead of cloud-based APIs for privacy
- Python 3.9+
- PyQt6
- FastAPI
- Various scientific and data analysis libraries
-
Clone the repository:
git clone https://github.com/CareFrameAI/careframe-research.git
-
Install dependencies:
pip install -r requirements.txt
-
Configure your API keys (optional, see API Keys Configuration section below)
-
Launch the application:
python app_launcher.py
CareFrame can use either CouchDB or a built-in JSON-based mock database:
-
CouchDB: If CouchDB is installed and running, CareFrame will connect to it automatically.
- Requires CouchDB 3.x+ to be installed separately
- Default credentials: admin/cfpwd
-
JSON Mock Database: If CouchDB is not available, CareFrame will automatically fall back to using a JSON-based mock database that stores data in files.
- Better for development or when CouchDB isn't available
- Data is stored in files for persistence
You can control this behavior with the following options:
# Check database status without starting the app
python init_database.py --status
# Force using the JSON mock database
python app_launcher.py --mock
# Force using CouchDB (will fail if not available)
python app_launcher.py --couchdb
# Generate a default database configuration file
python init_database.py --config
The JSON mock database stores files in ~/.careframe/mock_couchdb/
by default.
CareFrame requires various API keys to access external services for full functionality. There are multiple ways to configure these keys:
On first run, the application will create placeholders for these keys in the database. You can then configure them through the UI:
- Launch CareFrame
- Navigate to the Settings section
- Enter your API keys in the corresponding fields
- Click "Save API Keys"
You can set API keys through environment variables:
- Copy the
.env.example
file to.env
- Edit the
.env
file with your actual API keys - The keys will be automatically loaded and encrypted in the database at startup
The following API keys are supported:
-
Claude API Key (
CLAUDE_API_KEY
): For advanced AI language and vision capabilities- Obtain from: Anthropic Console
-
Gemini API Key (
GEMINI_API_KEY
): For AI-powered language capabilities- Obtain from: Google AI Studio
-
UMLS API Key (
UMLS_API_KEY
): For medical terminology and concepts- Obtain from: UMLS Terminology Services
-
Unpaywall Email (
UNPAYWALL_EMAIL
): For retrieving open access research papers- Register at: Unpaywall
-
Zenodo API Key (
ZENODO_API_KEY
): For accessing research data repositories- Obtain from: Zenodo
-
CORE API Key (
CORE_API_KEY
): For research paper aggregation- Register at: CORE API
-
Entrez API Key/Email (
ENTREZ_API_KEY
/ENTREZ_EMAIL
): For accessing PubMed and other NCBI databases- Register at: NCBI
Security Note: All API keys are securely encrypted using Fernet encryption before being stored in the database.
CareFrame supports using local LLM models instead of cloud-based APIs:
- Install a local LLM server like Ollama or LM Studio
- Start your local LLM server
- In CareFrame, navigate to LLM Manager > Local LLMs tab
- Enable Local LLMs and configure your endpoints and models
- Test the connection
For detailed instructions, see Local LLM Support.
CareFrame automatically initializes several databases and their corresponding views:
- study_designs: Stores study design documents
- user_logs: Tracks user actions and interactions
- users: User management and authentication
- studies: Storage for study data and configurations
- teams: Team management and permissions
- logs: General application logs
- settings: Application settings including encrypted API keys
The database initialization happens automatically when you use app_launcher.py
. This process:
- Creates necessary databases if they don't exist
- Sets up required views for each database
- Initializes empty API key placeholders
- Establishes encryption keys for secure storage
app.py
: Main application entry point with PyQt6 UIserver.py
: WebSocket server for communicationsapp_launcher.py
: Launcher that initializes the database before starting the appinit_database.py
: Database initialization and management utilitiesinit_api_keys.py
: Script to initialize API keys from environment variablesbionlp/
: BioNLP annotation toolsdata/
: Data management and analysis modulesexchange/
: Blockchain data exchange componentsliterature_search/
: Literature search toolsstudy_model/
: Study management modelsqt_sections/
: UI componentsdb_ops/
: Database operations and JSON mock implementationllms/
: Language model integration modules
Contributions are welcome! Please see our Contributing Guidelines for more details.
This project is licensed under the MIT License - see the LICENSE file for details.
- List of contributors and acknowledgments
Detailed documentation is available in the docs
directory:
- API Keys Management: Guide to managing API keys for external services
- Database Guide: Details about database architecture and configuration
- Local LLM Support: Using local LLM models for privacy