Skip to main content

coreason-episteme

Project description

coreason-episteme

Theorist / Hypothesis Engine

License: Prosperity 3.0 CI/Status Ruff Docs

Overview

coreason-episteme is the engine of Scientific Intuition within the CoReason platform. It acts as the "Theorist" that automates the "Eureka" moment by systematically scanning for "White Space" in the Knowledge Graph. It synthesizes weak signals from disparate papers into coherent, testable hypotheses (e.g., identifying a novel genetic target for a disease based on pathway adjacency).

Crucially, it implements a "Null Hypothesis First" architecture. Every generated hypothesis is treated as false until it survives a rigorous adversarial review process involving causal counterfactuals and patent whitespace analysis.

Core Philosophy

"Identify the Void. Bridge the Gap. Propose the Novel."

  1. Gap Scanning (Negative Space Analysis): Identifies disconnected clusters in the Knowledge Graph that share high semantic similarity but lack connections.
  2. Latent Bridging (The Leap): Finds "Latent Bridges"—genes or proteins that are structurally or functionally connected to the conflict but rarely mentioned in the context of the specific disease.
  3. Causal Simulation (The Test): Runs a counterfactual simulation using coreason-inference to validate the hypothesis.
  4. Adversarial Review (The Council): Convenes a virtual "Review Board" (The Toxicologist, The Clinician, The IP Strategist) to attack the hypothesis for safety risks, clinical redundancy, or patent infringement.

Installation

pip install coreason-episteme

Features

  • Gap Scanner: Detects inconsistencies or missing links in the Knowledge Graph and literature.
  • Bridge Builder: Formulates novel hypotheses by exploring the "Neighborhood" of conflicting entities and proposing valid genetic targets.
  • Causal Validator: Validates proposed mechanisms using counterfactual simulations (A -> B -> C).
  • Protocol Designer: Designs the "Killer Experiment" (PICO) to prove or disprove the hypothesis in a wet lab.
  • Adversarial Reviewer: Critiques hypotheses using multi-perspective strategies (Toxicology, IP, Clinical, Scientific Skeptic).

For detailed requirements, see Product Requirements.

Usage

from typing import Any, Dict, List, Optional
from coreason_episteme.main import generate_hypothesis
from coreason_episteme.models import GeneticTarget, KnowledgeGap

# 1. Define Mock Clients (Simulate external services)
class MockClient:
    def find_disconnected_clusters(self, criteria: Dict[str, Any]) -> List[Dict[str, Any]]:
        return [{"cluster_a_id": "C1", "cluster_b_id": "C2", "cluster_a_name": "A", "cluster_b_name": "B"}]

    def find_latent_bridges(self, source: str, target: str) -> List[GeneticTarget]:
        return [GeneticTarget(symbol="GENE_X", ensembl_id="ENSG001", druggability_score=0.9, novelty_score=0.8)]

    def get_semantic_similarity(self, e1: str, e2: str) -> float: return 0.95
    def validate_target(self, symbol: str) -> Optional[GeneticTarget]:
        return GeneticTarget(symbol=symbol, ensembl_id="ENSG001", druggability_score=0.9, novelty_score=0.8)

    def find_literature_inconsistency(self, topic: str) -> List[KnowledgeGap]: return []
    def verify_citation(self, claim: str) -> bool: return True
    def check_patent_infringement(self, target: GeneticTarget, mech: str) -> List[str]: return []
    def find_disconfirming_evidence(self, sub: str, obj: str, act: str) -> List[str]: return []

    def check_druggability(self, target_id: str) -> float: return 0.9

    def run_counterfactual_simulation(self, mech: str, target: str) -> float: return 0.85
    def run_toxicology_screen(self, target: GeneticTarget) -> List[str]: return []
    def check_clinical_redundancy(self, mech: str, target: GeneticTarget) -> List[str]: return []

    def log_trace(self, h_id: str, trace: Dict[str, Any]) -> None: print(f"Logged trace for {h_id}")

# 2. Instantiate Clients
mock_client = MockClient()

# 3. Run the Engine
try:
    hypotheses = generate_hypothesis(
        disease_id="DOID:12345",
        graph_client=mock_client,      # type: ignore
        codex_client=mock_client,      # type: ignore
        search_client=mock_client,     # type: ignore
        prism_client=mock_client,      # type: ignore
        inference_client=mock_client,  # type: ignore
        veritas_client=mock_client     # type: ignore
    )

    for h in hypotheses:
        print(f"Hypothesis: {h.title}")
        print(f"Mechanism: {h.proposed_mechanism}")
        print(f"Confidence: {h.confidence}")

except Exception as e:
    print(f"Error generating hypotheses: {e}")

License

This project is licensed under the Prosperity Public License 3.0.

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_episteme-0.2.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

coreason_episteme-0.2.0-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file coreason_episteme-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for coreason_episteme-0.2.0.tar.gz
Algorithm Hash digest
SHA256 79c5e38f7f8ff34db083f59111d4bbf25354b1aa2357b65e22cf5f73fb33147d
MD5 8e4669bfcb5da9d0cadf3dbfbc771cef
BLAKE2b-256 ebe16cbedf1c3b977ea4c7842744f2d44f082359ce6fd61014ac451a3d7d84c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for coreason_episteme-0.2.0.tar.gz:

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

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_episteme-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coreason_episteme-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98352a8e60ac30d64203fd62acd8414902bbd761e75fe17f736fdcabf3902d87
MD5 b1c0adc7bff5f7d338aeb674bcf0e9e3
BLAKE2b-256 934959ee9a6c8223b3bf31675d5d7c9c12f540a1ed2e65d64a3360e462dae3a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for coreason_episteme-0.2.0-py3-none-any.whl:

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

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