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.1.0.tar.gz (21.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_episteme-0.1.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coreason_episteme-0.1.0.tar.gz
  • Upload date:
  • Size: 21.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 31d00c428c898c6681d168509298840da1f58c7a728e5f68a0e3782054e9c6d4
MD5 ca6f1fe3e16110f5ecae897c53e1032c
BLAKE2b-256 8fdf69518cbda24309deec85220d791347febe7a995c5ebd48fac9c48b2f9a22

See more details on using hashes here.

Provenance

The following attestation bundles were made for coreason_episteme-0.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coreason_episteme-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 326b3a5b175b8d62e643a1363e2c7651682653a8c844dcec3e7bcae6c02f4faa
MD5 b860ab2a4a16ac97fa6bff0fa1ee4f80
BLAKE2b-256 0b9b79b7c90da643c636d287a0e75b12e7e603342bda0d385fd7d989098120a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for coreason_episteme-0.1.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