Skip to main content

oracle-core

Personal prediction engine. Detects patterns, anomalies, trends, and correlations in your data. Recommends what to read, watch, or do next based on where you're going, not where you've been.

Local. Private. Yours.

from oracle_core import Oracle, Event
from datetime import datetime

oracle = Oracle()

# Feed it events from any source
oracle.ingest("me", [
    Event(timestamp=datetime.now(), source="search", event_type="search",
          content="distributed systems consensus algorithms"),
    Event(timestamp=datetime.now(), source="journal", event_type="entry",
          content="feeling productive, deep focus today"),
])

# Train (runs all analysis modules)
oracle.train("me")

# Get predictions
for p in oracle.anticipate("me"):
    print(f"[{p.confidence:.0%}] {p.text}")

What It Does

Module What it detects Example
Patterns Recurring cycles, trends "Your activity has a weekly cycle (r=0.85)"
Anomalies Unusual spikes, drops, gaps "No activity in 72 hours (your average gap is 18h)"
Forecasting Future values with confidence "Activity forecast: declining over next 14 periods"
Topics Emerging, growing, declining themes "Emerging topic: 'kubernetes' — appeared recently"
Correlations Connections between signals "Email volume leads stress by 2 days (r=0.65)"
Sequences Repeated action patterns "After 'search', you usually 'code' (78% of the time)"
Recommendations What to read/watch/do next "Recommended book: 'Designing Data-Intensive Applications'"
Anticipation Compound insights from all modules "Multiple signals converging on 'kubernetes': 4 indicators"

Install

Python (reference implementation)

pip install oracle-core

# With Chronos foundation model forecasting (optional, ~250MB)
pip install 'oracle-core[forecast]'

# With semantic embeddings for better recommendations (optional, ~22MB)
pip install 'oracle-core[embeddings]'

# Everything
pip install 'oracle-core[full]'

Or from a source checkout — git clone the repository, then pip install . with the same extras (pip install '.[full]').

Development

git clone https://github.com/Wyrdsekai/oracle-core.git
cd oracle-core
uv sync --extra dev
uv run pytest tests/

Usage

As a library

from oracle_core import Oracle, Event, RecommendableItem
from datetime import datetime, timedelta

oracle = Oracle(data_dir="~/.my-oracle")

# Ingest events from any source
events = [
    Event(timestamp=datetime.now() - timedelta(hours=i),
          source="app", event_type="search",
          content=f"topic {i % 3}")
    for i in range(100)
]
oracle.ingest("user1", events)

# Run full analysis
result = oracle.train("user1")
print(result)  # {"status": "ok", "events": 100, "models_updated": [...]}

# Get predictions
predictions = oracle.anticipate("user1", min_confidence=0.6)
for p in predictions:
    print(f"[{p.category.value}] {p.text} ({p.confidence:.0%})")

# Get recommendations
books = [
    RecommendableItem(id="b1", title="DDIA", description="distributed systems guide",
                      item_type="book", source="library"),
]
recs = oracle.recommend("user1", books)

# Record feedback (Oracle calibrates itself)
from oracle_core import Feedback, FeedbackOutcome
oracle.feedback("user1", Feedback(
    prediction_id=predictions[0].id,
    outcome=FeedbackOutcome.CORRECT,
    user_engaged=True,
), category=predictions[0].category.value)

As an HTTP server

oracle-server --port 7073

# Or with Docker
docker run -p 7073:7073 wyrdsekai/oracle-core
# Ingest events
curl -X POST http://localhost:7073/v1/ingest \
  -H "Content-Type: application/json" \
  -d '{"user_id":"me","events":[{"timestamp":"2026-03-28T10:00:00","source":"search","event_type":"search","content":"kubernetes"}]}'

# Train
curl -X POST http://localhost:7073/v1/train \
  -H "Content-Type: application/json" \
  -d '{"user_id":"me"}'

# Get predictions
curl -X POST http://localhost:7073/v1/analyze/anticipate \
  -H "Content-Type: application/json" \
  -d '{"user_id":"me","min_confidence":0.5}'

Every data route is under /v1; /health is the one exception, unversioned so a supervisor can check liveness without caring which API generation is running. The JSON Content-Type is required, not decorative — Flask refuses the body without it. The other analyses swap the last path segment: patterns, anomalies, forecast, topics, correlations, sequences.

CLI

# Ingest from JSONL file
oracle-cli ingest me events.jsonl

# Run analysis
oracle-cli train me

# Get predictions
oracle-cli anticipate me

# Interactive mode
oracle-cli shell me

Mobile

Kotlin (KMP — Android/iOS/Desktop)

import oraclecore.Oracle
import oraclecore.Event

val oracle = Oracle()
oracle.ingest("me", listOf(
    Event(timestamp = System.currentTimeMillis(), source = "search",
          eventType = "search", content = "kubernetes deployment")
))
oracle.train("me")
val predictions = oracle.anticipate("me", minConfidence = 0.6)

TypeScript (React Native)

import { Oracle } from 'oracle-core-ts';

const oracle = new Oracle();
oracle.ingest('me', [{
  timestamp: Date.now(), source: 'search',
  eventType: 'search', content: 'kubernetes deployment',
}]);
oracle.train('me');
const predictions = oracle.anticipate('me', 0.6);

i18n

All user-facing text uses i18n keys. Ships with English, Japanese, and Spanish.

from oracle_core.i18n import load_locale
load_locale("ja")  # Switch to Japanese

Every Prediction includes text_key and text_params for downstream re-translation:

p.text        # "Activity has a weekly cycle (r=0.85)"  (resolved)
p.text_key    # "oracle.pattern.periodic"                (key)
p.text_params # {"label": "Activity", "period": "weekly", "r": "0.85"}

Forecasting Tiers

Tier Model Size Needs
Classical Fourier + trend (built-in) 0 nothing — ships with the package
Chronos-Bolt-Tiny 8M params, zero-shot ~20MB the forecast extra
Chronos-2 120M params, zero-shot ~250MB the forecast extra
TimesFM 500M params, strongest ~1GB Separate install

Phone (Kotlin/TS): Classical built-in. Chronos-Bolt-Tiny via ONNX Runtime (20MB).

Architecture

Events (any source) → Ingest → Feature Pipeline → Analysis Modules → Anticipation → Predictions
                                                                          ↑
                                                                    Feedback Loop
                                                                   (calibration)

All data stays local. Per-user isolation. Models are KB-scale (scikit-learn) to MB-scale (Chronos). No cloud. No telemetry.

License

Apache 2.0. See LICENSE.

Release files for oracle-core 0.1.0

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

Source distribution (sdist)

Source distribution for oracle-core 0.1.0
File Size Uploaded
oracle_core-0.1.0.tar.gz 59.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oracle-core 0.1.0
File Interpreter ABI Platform
oracle_core-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 111.7 kB

Release files / oracle_core-0.1.0.tar.gz

Download URL oracle_core-0.1.0.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f30bac0b3eaaa1c0f41a491fc1fe421d883f52ed83af467372d2b0c4896d70ee
BLAKE2b-256 checksum
How to use checksums
fbad3e4e0b89b012f1d2def97d15c1eece90e99f7dfeeff96a194321447ac546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / oracle_core-0.1.0-py3-none-any.whl

Download URL oracle_core-0.1.0-py3-none-any.whl
Size 51.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
145c73e4ff1f688c6c48c83aa65bbbd572cf3ccb713fe1ad82f5d38366543ca8
BLAKE2b-256 checksum
How to use checksums
7855a5ff109b9100b7a73e93e557765ae16e757b8b794c6e8ebf1fa9244ba051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

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