Skip to content

tcaniagboso/chronos-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chronos Engine

High-performance virtualized history engine for LLM web interfaces with massive chat histories.

Chronos is a C++ runtime designed to efficiently store, page, cache, and retrieve extremely large sequential data streams such as long AI chat sessions, logs, and timelines without loading all content into memory at once.

It uses chunked storage, windowed access, and OS-style cache eviction strategies to deliver constant-time access and smooth traversal even with millions of entries.

Project Status

Chronos Engine is under active development.

The core C++ runtime, caching model, window retrieval logic, tests, and initial WebAssembly bindings are implemented.
The browser extension frontend is currently experimental and still being optimized for long-chat rendering performance and smooth takeover of existing DOM state.

Motivation

LLM web interfaces degrade rapidly as chat histories grow.

Long conversations often cause:

  • UI freezes
  • unresponsive pages
  • excessive memory usage
  • slow scrolling and rendering

This happens because entire chat histories are kept in memory and rendered in the DOM.

Chronos virtualizes history data so only a small active window is ever loaded and displayed, mirroring how operating systems page memory and how databases manage buffer pools.

Core Concepts

  • Chunked byte-based storage for contiguous message records
  • Atomic message layout (no partial paging)
  • Windowed access to visible history ranges only
  • CLOCK (second-chance) cache eviction
  • Zero-copy internal access paths
  • Predictable memory footprint

Architecture

Chronos Engine (C++)

 ├── ChunkStore        // append-only segmented message storage
 ├── MessageMeta      // lightweight record descriptors
 ├── ChunkCache       // CLOCK-based page cache
 ├── HistoryEngine    // paging + retrieval orchestration
 └── Window API       // efficient visible range access

Performance Goals

  • O(1) amortized message append
  • O(1) record access
  • bounded memory usage
  • smooth scrolling regardless of chat length

Primary Use Case

  • Large LLM chat histories on the web (ChatGPT-style interfaces)

Secondary:

  • log viewers
  • event streams
  • long timelines

Roadmap

Implemented

  • Chunked in-memory message store
  • Append pipeline
  • Window retrieval API
  • CLOCK cache eviction
  • Engine test harness
  • WebAssembly bindings

In Progress

  • Browser extension frontend
  • DOM takeover and virtualization strategy
  • Long-chat performance tuning

Tech Stack

  • Modern C++ (C++20)
  • WebAssembly
  • JavaScript browser extension prototype

Design Philosophy

Chronos prioritizes:

  • Performance over abstraction
  • Predictable behavior over convenience
  • Systems-level architecture over UI hacks

Inspired by:

  • OS virtual memory managers
  • Database buffer pools
  • High-throughput log systems

About

High-performance virtualized history engine for large LLM web chat sessions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors