Skip to main content

coreason-chronos

Domain: Temporal Reasoning, Time-Series Forecasting, & Longitudinal Reconstruction

License CI Ruff Docs

Overview

coreason-chronos is the specialized temporal processing unit of the CoReason ecosystem. It enables agents to reason about When, How Long, and What's Next.

Core Philosophy: "Semantic time is fuzzy. Symbolic time is exact. We need both."

It provides three critical capabilities:

  1. Longitudinal Reconstruction: Extracting events from unstructured text (e.g., "Patient started Taxol 3 weeks after surgery") and mapping them to a normalized absolute timeline.
  2. Probabilistic Forecasting: Predicting future events (e.g., "Clinical Trial Enrollment will hit 100% in 4.5 months +/- 2 weeks") using SOTA Time-Series Foundation Models.
  3. Temporal Logic Validation: Ensuring GxP compliance by validating temporal constraints (e.g., "Was the adverse event reported within the 24-hour statutory window?").

Features

  • The Timeline Extractor (The Historian):

    • Converts relative dates ("2 weeks later") to absolute timestamps.
    • Resolves "anchored" events based on semantic proximity to reference events.
    • Outputs structured EventSeries JSON.
  • The Oracle (The Forecaster):

    • Leverages Foundation Time-Series Models (Amazon Chronos-T5).
    • Zero-shot prediction capability for metrics like Patient Enrollment or Drug Inventory.
    • Provides probabilistic forecasts (P90 confidence intervals).
  • The Compliance Clock (The Validator):

    • Symbolic Rule Engine for regulatory checks.
    • Validates constraints like Report_Time <= Event_Time + 24_Hours.
  • The Causality Engine (The Sequencer):

    • Uses Allen's Interval Algebra to determine temporal plausibility of causal relationships.

Installation

pip install coreason-chronos

Usage

1. Initialize the Timekeeper

The ChronosTimekeeper is the main entry point for the library.

from datetime import datetime, timezone
from coreason_chronos.agent import ChronosTimekeeper

# Initialize the agent
agent = ChronosTimekeeper()

2. Longitudinal Reconstruction (Timeline Extraction)

text = "Patient was admitted on 2024-01-01. Symptoms started 2 days later."
reference_date = datetime(2024, 1, 1, tzinfo=timezone.utc)

events = agent.extract_from_text(text, reference_date)

for event in events:
    print(f"{event.timestamp}: {event.description}")
# Output:
# 2024-01-01 00:00:00+00:00: Patient was admitted...
# 2024-01-03 00:00:00+00:00: Derived from anchor...

3. Forecasting

history = [10, 15, 20, 25, 30]  # Weekly enrollment
forecast = agent.forecast_series(history, prediction_length=5)

print(f"Median Forecast: {forecast.median}")
print(f"90% Confidence Interval: {forecast.lower_bound} - {forecast.upper_bound}")

4. Compliance Check

from datetime import timedelta
from coreason_chronos.validator import MaxDelayRule

# Check if reporting was done within 24 hours
rule = MaxDelayRule(max_delay=timedelta(hours=24))

# ... (assuming target_event and ref_event are TemporalEvent objects)
# result = agent.check_compliance(target_event, ref_event, rule)

# if not result.is_compliant:
#     print(f"Compliance Violation! Drift: {result.drift}")

Metadata

Release files for coreason-chronos 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coreason-chronos 0.2.1
File Size Uploaded
coreason_chronos-0.2.1.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coreason-chronos 0.2.1
File Interpreter ABI Platform
coreason_chronos-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 49.8 kB

Release files / coreason_chronos-0.2.1.tar.gz

Download URL coreason_chronos-0.2.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
56e18b60474066db914f2f1eef515676707f9e6f3edcb546aeb2170a6ea8d367
BLAKE2b-256 checksum
How to use checksums
927e541ca9099393d4d3ff5f7e2d52af23d9c0a1e2406ba04cb5e7b4d2bb3d08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.

Transparency log

Release files / coreason_chronos-0.2.1-py3-none-any.whl

Download URL coreason_chronos-0.2.1-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ef2ee27e3425b0323a0b337520a446989f1ae66d6ad4378e60fec405cc52968
BLAKE2b-256 checksum
How to use checksums
b89fbef704805bb4756d96f71b3e520f56d0fc9bab2591d53d9dfff2f39bb009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page