coreason-chronos
Project description
coreason-chronos
Domain: Temporal Reasoning, Time-Series Forecasting, & Longitudinal Reconstruction
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:
- Longitudinal Reconstruction: Extracting events from unstructured text (e.g., "Patient started Taxol 3 weeks after surgery") and mapping them to a normalized absolute timeline.
- 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.
- 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
EventSeriesJSON.
-
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}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coreason_chronos-0.2.0.tar.gz.
File metadata
- Download URL: coreason_chronos-0.2.0.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63a2eb0f697fed605648de1b6f752e1fc4660f5e540e40b3ac3479c3690e5200
|
|
| MD5 |
08e734e4415f4015db2f7711c22481f9
|
|
| BLAKE2b-256 |
548c09b0509cbbe532092b99dfa4fb85eb969ba69f00953f8417ab49922065bf
|
Provenance
The following attestation bundles were made for coreason_chronos-0.2.0.tar.gz:
Publisher:
publish.yml on CoReason-AI/coreason-chronos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_chronos-0.2.0.tar.gz -
Subject digest:
63a2eb0f697fed605648de1b6f752e1fc4660f5e540e40b3ac3479c3690e5200 - Sigstore transparency entry: 868315822
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-chronos@635181b323747ecfbd755059d84f9759872320c9 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@635181b323747ecfbd755059d84f9759872320c9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file coreason_chronos-0.2.0-py3-none-any.whl.
File metadata
- Download URL: coreason_chronos-0.2.0-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63631c9cf20773413430920c3d1658efc14b8b5422d12c5519ce36321e7108b3
|
|
| MD5 |
75717cd2e4564a6000bdd37fdf63902f
|
|
| BLAKE2b-256 |
0c1337d19ebea2dd4793e71a6bb14b0924c708b75acfd6cee7bf930ccf6af0f6
|
Provenance
The following attestation bundles were made for coreason_chronos-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on CoReason-AI/coreason-chronos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_chronos-0.2.0-py3-none-any.whl -
Subject digest:
63631c9cf20773413430920c3d1658efc14b8b5422d12c5519ce36321e7108b3 - Sigstore transparency entry: 868315830
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-chronos@635181b323747ecfbd755059d84f9759872320c9 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@635181b323747ecfbd755059d84f9759872320c9 -
Trigger Event:
release
-
Statement type: