Skip to main content

A library for creating, maintaining, and utilizing Universal Histories across multiple domains

Project description

Universal History

A library for creating, maintaining, and utilizing Universal Histories across multiple domains.

Overview

The Universal History library provides a standardized framework for recording, analyzing, and retrieving historical information about any subject across various domains. Whether you're tracking educational progress, medical history, employment records, or any other domain-specific information, this library offers a unified approach to managing that data.

Key Features

  • Multi-domain support: Track histories across education, health, work, finance, and other domains
  • Event recording: Capture individual events with rich context and metadata
  • Trajectory synthesis: Generate summaries and analyses from sequences of events
  • State document: Maintain an up-to-date representation of the subject's current state
  • Domain catalogs: Define and standardize domain-specific terminology and metrics
  • LLM integration: Optimize historical data for use as context with language models
  • Multiple storage backends: Store data in memory, files, or MongoDB

Installation

pip install universal-history

For MongoDB support:

pip install universal-history[mongodb]

For LLM integration:

pip install universal-history[llm]

Quick Start

from universal_history import UniversalHistoryClient

# Initialize a client with file storage
client = UniversalHistoryClient(storage_dir="./data")

# Create an event
event = client.create_event(
    subject_id="student123",
    domain_type="education",
    event_type="exam",
    content="Student scored 92/100 on Algebra final exam.",
    source_type="institution",
    source_id="school001",
    source_name="Springfield High School",
    metrics={"score": 92, "max_score": 100},
    tags=["math", "algebra", "exam"]
)

# Update the state document with information from events
client.update_state_from_events(
    subject_id="student123",
    domain_type="education"
)

# Get LLM-optimized context
context = client.get_llm_context("student123")
print(context)

Architecture

The Universal History system consists of several key components:

  • Event Record (RE): The basic unit of information, capturing specific events or observations
  • Trajectory Synthesis (ST): Analysis and summary of multiple events over a period of time
  • State Document (DE): Real-time representation of the current state of a subject
  • Domain Catalog (CDD): Semantic framework for interpreting information in a specific domain
  • Universal History (HU): Container for all components related to a specific subject

Documentation

For detailed documentation, visit https://universal-history.readthedocs.io/

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

universal_history-0.1.1.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

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

universal_history-0.1.1-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file universal_history-0.1.1.tar.gz.

File metadata

  • Download URL: universal_history-0.1.1.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for universal_history-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ee939bd42093c63be4bc64ba47643a5ffe3c89b8db3f642532cbf7944e7cc1a1
MD5 a2e9d176bf3ee96b97366ae52290b5f5
BLAKE2b-256 7da8bf69160844e4f5ba412f6109feb244b3e982baa808e225d514cc30137bb3

See more details on using hashes here.

File details

Details for the file universal_history-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for universal_history-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63423e1ebd984e875f2bec65aac175a86ef47b4c449303fea3e49639aec4a7cb
MD5 1c29fedf985eeaabb4244732d310da97
BLAKE2b-256 26e900b727f29f7321a588842ece1912b8d215bdca04b22cf3e27689aabbf720

See more details on using hashes here.

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