Skip to main content

Design and Governance Engine for high-stakes research.

Project description

coreason-protocol

The Design and Governance Engine for high-stakes research.

Organization License Build Status Code Style: Ruff Documentation

Description

coreason-protocol transforms natural language intent into a Rigorous, Audited, and Executable Search Protocol. It acts as the "Study Director" or Design Plane, ensuring that research protocols are designed with rigor, validated with logic (PRESS guidelines), and approved with authority before execution.

Unlike simple RAG retrieval, this package enforces a scientific workflow:

  1. AI Draft: Generates PICO blocks and expands terms using ontologies (via coreason-codex).
  2. Human Governance: Allows experts to override or inject terms.
  3. Strict Validation: Checks structural integrity and PRESS guidelines.
  4. Immutable Registration: Locks and registers approved protocols (via coreason-veritas).

Installation

pip install coreason-protocol

Or using poetry:

poetry add coreason-protocol

Features

  • PICO Architecture: Structuring of research intent into Population, Intervention, Comparator, and Outcome.
  • Ontology Expansion: Integration with coreason-codex for term hydration (Concept IDs).
  • Strategy Compilation: Translation of PICO models into executable queries for:
    • PubMed/Ovid (Boolean strings with MeSH/TiAb mapping).
    • LanceDB (Vector embeddings + metadata filters).
    • Graph (Cypher queries).
  • HITL Governance: Support for human review with override_term and inject_term capabilities.
  • Audit Fidelity: Soft-deletion of terms to maintain a complete history of design decisions.
  • Multi-Format Rendering: Export to HTML (visual diff), PRISMA-S text, and JSON-LD.

Usage

from coreason_protocol import ProtocolDefinition, PicoBlock, TermOrigin, OntologyTerm

# Initialize a new Protocol Definition
protocol = ProtocolDefinition(
    id="prot-123",
    title="Statins for CVD Prevention",
    research_question="Do statins reduce CVD risk in elderly patients?",
    pico_structure={},
    status="DRAFT"
)

# Example: Adding a PICO block (programmatically or via AI expansion)
term = OntologyTerm(
    id="term-001",
    label="Statins",
    vocab_source="MeSH",
    code="D019821",
    origin=TermOrigin.USER_INPUT
)

protocol.pico_structure["I"] = PicoBlock(
    block_type="I",
    description="Intervention",
    terms=[term]
)

# Render the protocol for review
html_output = protocol.render(format="html")
print(html_output)

Documentation

For detailed product requirements and architectural philosophy, see docs/product_requirements.md.

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

coreason_protocol-0.1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

coreason_protocol-0.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file coreason_protocol-0.1.0.tar.gz.

File metadata

  • Download URL: coreason_protocol-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for coreason_protocol-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20a1d1e68a4092982f8f669025121c9548fe486c74ca1559c3055744a4cdef2e
MD5 a2885b1228cd6efe001cb3d7efa004af
BLAKE2b-256 32d20f325b2caf23a60efabcbb7eb502cbc12ba75eb7a81f69f8aaf60c990c2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for coreason_protocol-0.1.0.tar.gz:

Publisher: publish.yml on CoReason-AI/coreason-protocol

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

File details

Details for the file coreason_protocol-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coreason_protocol-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70739bbba0e6c7cecc1aaa3d6dee2251c2a1c933bb5a15ff64d6ca03d4b6ae45
MD5 03af4609c4566cae64c2c089d8cdb706
BLAKE2b-256 6fe1f9e73956eaf91ead86dda6183452aad15e8d745a229def1b5bf08751b273

See more details on using hashes here.

Provenance

The following attestation bundles were made for coreason_protocol-0.1.0-py3-none-any.whl:

Publisher: publish.yml on CoReason-AI/coreason-protocol

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