Open Science Assistant - An extensible AI assistant platform for open science projects
Project description
Open Science Assistant (OSA)
An extensible AI assistant platform for open science projects, built with LangGraph/LangChain and FastAPI.
Overview
OSA provides domain-specific AI assistants for open science tools with:
- HED Assistant: Hierarchical Event Descriptors for neuroimaging annotation
- BIDS Assistant: Brain Imaging Data Structure (coming soon)
- EEGLAB Assistant: EEG analysis toolbox (coming soon)
Features:
- YAML-driven community registry - add a new assistant with just a config file
- Modular tool system for document retrieval, validation, and code execution
- Multi-source knowledge bases (GitHub, OpenALEX, Discourse forums, mailing lists)
- Embeddable chat widget for any website
- Production-ready observability via LangFuse
Installation
# From PyPI
pip install open-science-assistant
# Or with uv (recommended)
uv pip install open-science-assistant
Development Setup
# Clone and install in development mode
git clone https://github.com/OpenScience-Collective/osa.git
cd osa
uv sync --extra dev
# Install pre-commit hooks
uv run pre-commit install
Quick Start
CLI Usage
# Show available assistants
osa
# Ask the HED assistant a question
osa hed ask "What is HED?"
# Start an interactive chat session
osa hed chat
# Show all commands
osa --help
osa hed --help
API Server
# Start the API server
osa serve
# Or with uvicorn directly
uv run uvicorn src.api.main:app --reload --port 38528
Configuration
# Show current config
osa config show
# Set API keys for BYOK (Bring Your Own Key)
osa config set --openrouter-key YOUR_KEY
# Connect to remote server (uses BYOK)
osa hed ask "What is HED?" --url https://api.osc.earth/osa-dev
Deployment
OSA can be deployed via Docker:
# Pull and run
docker pull ghcr.io/openscience-collective/osa:latest
docker run -d --name osa -p 38528:38528 \
-e OPENROUTER_API_KEY=your-key \
ghcr.io/openscience-collective/osa:latest
# Check health
curl http://localhost:38528/health
See deploy/DEPLOYMENT_ARCHITECTURE.md for detailed deployment options including Apache reverse proxy and BYOK configuration.
Community Registry
OSA uses a YAML-driven registry to configure community assistants. Each community has a config.yaml that declares its documentation, system prompt, knowledge sources, and specialized tools.
# Directory structure
src/assistants/
hed/config.yaml # HED assistant configuration
bids/config.yaml # BIDS assistant (planned)
Adding a New Community
- Create
src/assistants/my-tool/config.yaml:
id: my-tool
name: My Tool
description: A research tool for neuroscience
status: available
# Required: Per-community OpenRouter API key for cost attribution
# Set the environment variable on your backend server
openrouter_api_key_env_var: "OPENROUTER_API_KEY_MY_TOOL"
system_prompt: |
You are a technical assistant for {name}.
{preloaded_docs_section}
{available_docs_section}
documentation:
- title: Getting Started
url: https://my-tool.org/docs
source_url: https://raw.githubusercontent.com/org/my-tool/main/docs/intro.md
preload: true
github:
repos:
- org/my-tool
- Set the API key environment variable on your backend:
export OPENROUTER_API_KEY_MY_TOOL="your-openrouter-key"
- Validate your configuration:
uv run osa validate src/assistants/my-tool/config.yaml
- Start the server - the
/{community-id}/askendpoint is auto-created.
Documentation:
- Community Onboarding Guide - Step-by-step onboarding process
- Configuration Reference - Complete reference for all config fields
- Troubleshooting Guide - Common issues and solutions
Documentation
For Community Onboarding
- Community Onboarding Guide - Complete walkthrough for adding your community to OSA (target: <15 minutes)
- Configuration Reference - Comprehensive reference for all
config.yamlfields - Troubleshooting Guide - Solutions for common configuration and deployment issues
For Deployment
- Deployment Architecture - Production deployment patterns and infrastructure options
Optional: HED Tag Suggestions
The HED assistant can suggest valid HED tags from natural language using the hed-lsp CLI tool.
Installation
# Clone and build hed-lsp
git clone https://github.com/hed-standard/hed-lsp.git
cd hed-lsp/server
npm install
npm run compile
Configuration
Set the HED_LSP_PATH environment variable:
export HED_LSP_PATH=/path/to/hed-lsp
Or install globally:
cd hed-lsp/server
npm link # Makes hed-suggest available globally
Development
# Run tests with coverage
uv run pytest --cov
# Format code
uv run ruff check --fix . && uv run ruff format .
License
MIT
Project details
Release history Release notifications | RSS feed
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 open_science_assistant-0.5.1.dev0.tar.gz.
File metadata
- Download URL: open_science_assistant-0.5.1.dev0.tar.gz
- Upload date:
- Size: 550.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1bc6fa396d67e859f639e5bcb11612153eee656b49a35d92039be4818aa2f26
|
|
| MD5 |
49a687aa469ff58aa1204c5062c419bf
|
|
| BLAKE2b-256 |
0954319cfc69072a11b5316b3d6e1f230e49dab536a6a68e8d5571725a032384
|
Provenance
The following attestation bundles were made for open_science_assistant-0.5.1.dev0.tar.gz:
Publisher:
publish.yml on OpenScience-Collective/osa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
open_science_assistant-0.5.1.dev0.tar.gz -
Subject digest:
c1bc6fa396d67e859f639e5bcb11612153eee656b49a35d92039be4818aa2f26 - Sigstore transparency entry: 855299731
- Sigstore integration time:
-
Permalink:
OpenScience-Collective/osa@5e63d764e775913395752b1d11b8a83efeb7972a -
Branch / Tag:
refs/tags/v0.5.1.dev0 - Owner: https://github.com/OpenScience-Collective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e63d764e775913395752b1d11b8a83efeb7972a -
Trigger Event:
push
-
Statement type:
File details
Details for the file open_science_assistant-0.5.1.dev0-py3-none-any.whl.
File metadata
- Download URL: open_science_assistant-0.5.1.dev0-py3-none-any.whl
- Upload date:
- Size: 120.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0dc13104812eed7133142a67661e5f0f7346c60833d33e772772a5150dafac2
|
|
| MD5 |
fb2172fa4020447a613ccfa65a2f9eac
|
|
| BLAKE2b-256 |
edf474ceb304d71880767d339184d97a872c745b765b0c9168e0e083ec2a0fe3
|
Provenance
The following attestation bundles were made for open_science_assistant-0.5.1.dev0-py3-none-any.whl:
Publisher:
publish.yml on OpenScience-Collective/osa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
open_science_assistant-0.5.1.dev0-py3-none-any.whl -
Subject digest:
c0dc13104812eed7133142a67661e5f0f7346c60833d33e772772a5150dafac2 - Sigstore transparency entry: 855299736
- Sigstore integration time:
-
Permalink:
OpenScience-Collective/osa@5e63d764e775913395752b1d11b8a83efeb7972a -
Branch / Tag:
refs/tags/v0.5.1.dev0 - Owner: https://github.com/OpenScience-Collective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e63d764e775913395752b1d11b8a83efeb7972a -
Trigger Event:
push
-
Statement type: