Skip to main content

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:

  • Modular tool system for document retrieval, validation, and code execution
  • Multi-source knowledge bases (GitHub, OpenALEX, Discourse forums, mailing lists)
  • Extensible architecture for adding new assistants and tools
  • 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.

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


Download files

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

Source Distribution

open_science_assistant-0.3.2a0.tar.gz (466.2 kB view details)

Uploaded Source

Built Distribution

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

open_science_assistant-0.3.2a0-py3-none-any.whl (88.0 kB view details)

Uploaded Python 3

File details

Details for the file open_science_assistant-0.3.2a0.tar.gz.

File metadata

  • Download URL: open_science_assistant-0.3.2a0.tar.gz
  • Upload date:
  • Size: 466.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for open_science_assistant-0.3.2a0.tar.gz
Algorithm Hash digest
SHA256 a3757f051883d24ddb769c3b5f5ce225d72f1e1bb1d9e554c734aeb34a847080
MD5 0a7e381091c64f82e9e37dda9d2cedcf
BLAKE2b-256 a816f14ea822f8f8a060975c70e2b247b71bd665daf6c3b7978d79602166891e

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_science_assistant-0.3.2a0.tar.gz:

Publisher: publish.yml on OpenScience-Collective/osa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file open_science_assistant-0.3.2a0-py3-none-any.whl.

File metadata

File hashes

Hashes for open_science_assistant-0.3.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 bde5dc36d3ad03f13654464d49fb4d1ecfbd33ac85290c4a7c15d6fc3dc6fdf3
MD5 ffd16402879706691cb25ee38441605b
BLAKE2b-256 4fd83b97919c7ce4e69521cf4853c6c96f27e4513e3458dbe2045cef62d43422

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_science_assistant-0.3.2a0-py3-none-any.whl:

Publisher: publish.yml on OpenScience-Collective/osa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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