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.0.tar.gz (33.8 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.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: universal_history-0.1.0.tar.gz
  • Upload date:
  • Size: 33.8 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.0.tar.gz
Algorithm Hash digest
SHA256 1fde16c4644331c9990478a3541c801eb5efea1c373b7d63ef5bf29097356150
MD5 7ad33bef479d681454b7200e41c6f623
BLAKE2b-256 943ca6c8194641d1a08a6bc0c4f05071b4689693f4a2788ec63f1af0dd4e76a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for universal_history-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f817ce3100ae9064778277498e3b4f8c37a49beded891000aa17d8ded72f2e4
MD5 e5075886e51708f3934f08a14f06eec0
BLAKE2b-256 0874ba7bfd6873c72e3613c037dc5a2850f69387fc4cdc3ff8656a191b60da7f

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