Skip to main content

Add your description here

Project description

RealTimeX.AI Manifest - Document Analysis & Validation

๐Ÿ“ Directory Structure

manifest-ai/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ realtimex_manifest_ai/     # Main package source
โ”‚       โ”œโ”€โ”€ main.py                 # MCP tools and server entry
โ”‚       โ”œโ”€โ”€ batch.py                # Batch ID generation
โ”‚       โ”œโ”€โ”€ registry.py             # Document registry
โ”‚       โ”œโ”€โ”€ master_records.py       # Master records extraction
โ”‚       โ”œโ”€โ”€ template_filler.py      # Template filling utility
โ”‚       โ”œโ”€โ”€ utils.py                # Utility functions
โ”‚       โ”œโ”€โ”€ schemas/                # JSON schemas
โ”‚       โ””โ”€โ”€ batch_data/             # Runtime batch data (git-ignored)
โ”œโ”€โ”€ examples/                       # Sample data (not installed)
โ”‚   โ”œโ”€โ”€ README.md                   # Examples documentation
โ”‚   โ”œโ”€โ”€ setup_samples.py            # Script to copy samples to cache
โ”‚   โ””โ”€โ”€ sample_batch_data/          # Pre-generated sample batches
โ”‚       โ””โ”€โ”€ {batch_id}/             # Sample batch
โ”‚           โ”œโ”€โ”€ registry.json       # Document registry
โ”‚           โ”œโ”€โ”€ summary.json        # Batch summary
โ”‚           โ”œโ”€โ”€ data/               # Extracted structured data
โ”‚           โ”œโ”€โ”€ enhanced_data/      # AI-enhanced data
โ”‚           โ”œโ”€โ”€ images/             # Page images
โ”‚           โ”œโ”€โ”€ ocr_data/           # OCR results
โ”‚           โ”œโ”€โ”€ outputs/            # Generated outputs
โ”‚           โ””โ”€โ”€ documents/          # Original documents
โ”œโ”€โ”€ templates/                      # Web UI templates
โ”‚   โ”œโ”€โ”€ index.html                  # Main dashboard
โ”‚   โ”œโ”€โ”€ summary.html                # Summary view
โ”‚   โ”œโ”€โ”€ css/                        # Stylesheets
โ”‚   โ””โ”€โ”€ js/                         # JavaScript modules
โ”œโ”€โ”€ plannings/                      # Implementation plans
โ””โ”€โ”€ README.md

๐Ÿš€ Quick Start

Installation

pip install realtimex-manifest-ai

Setup Sample Data

To test the package with pre-generated sample data:

python examples/setup_samples.py

This copies sample batches to ~/.realtimex.ai/Resources/agent-resources/manifest-ai/batch_data/

See examples/README.md for more details.

๐Ÿ“‹ MCP Tools

Document Analysis

  • get_document_batch_id(file_path) - Generate batch ID for document
  • get_document_registry(batch_id, file_path) - Get document registry

Master Records

  • get_master_records(batch_id) - Map which document contains which field
  • extract_master_records_data(batch_id) - Extract actual data values
  • export_payment_order(batch_id) - Generate filled payment order

Dashboard & Analysis

  • show_manifest_dashboard(batch_id) - Show dashboard UI
  • analyze_with_bank_flow(batch_id) - Analyze with banking context

๐Ÿ“ Batch Data Structure

Runtime batch data is stored in cache:

~/.realtimex.ai/Resources/agent-resources/manifest-ai/batch_data/
โ””โ”€โ”€ {batch_id}/             # Each batch has its own folder
    โ”œโ”€โ”€ registry.json       # Document registry for this batch
    โ”œโ”€โ”€ summary.json        # Batch summary
    โ”œโ”€โ”€ data/               # OCR JSON payloads
    โ”‚   โ””โ”€โ”€ bank/           # Banking-specific data
    โ”‚       โ””โ”€โ”€ master_records.json  # Final extracted data
    โ”œโ”€โ”€ enhanced_data/      # AI-enhanced data (optional)
    โ”œโ”€โ”€ images/             # Rendered page images
    โ”œโ”€โ”€ ocr_data/           # OCR results per document
    โ”œโ”€โ”€ outputs/            # Generated outputs (payment orders, etc.)
    โ”œโ”€โ”€ documents/          # Original documents
    โ””โ”€โ”€ master_records.json # Document-to-field mapping

๐ŸŒ Web Dashboard

Start the Server

# From project root
python -m realtimex_manifest_ai.server

Or:

python src/realtimex_manifest_ai/server.py

Expected Output:

================================================================================
๐Ÿš€ Manifest AI Server Starting
================================================================================

๐Ÿ“ Batch Data Directory: ~/.realtimex.ai/Resources/agent-resources/manifest-ai/batch_data
๐ŸŽจ Templates Directory: /path/to/src/realtimex_manifest_ai/templates

โœ“ Found 1 batch(es) in cache:
  - c45cd2fbfa40c4663862ec723ef17a5fd17635dd

๐ŸŒ Server URL: http://localhost:8000
๐Ÿ“Š Dashboard: http://localhost:8000/templates?batch_id=<BATCH_ID>

================================================================================

The server:

  • Serves templates from package directory
  • Reads/writes batch data from cache directory
  • Provides API endpoints for user data (overrides, verifications, etc.)
  • Auto-creates user_data folder for modifications

Access the Dashboard

http://localhost:8000/templates?batch_id={BATCH_ID}&theme=light

Example with Sample Data:

http://localhost:8000/templates?batch_id=c45cd2fbfa40c4663862ec723ef17a5fd17635dd&theme=light

Note: If you see a warning about no batch data, run:

python examples/setup_samples.py

๐Ÿ“š Documentation

For detailed documentation:

๐Ÿ“ Files

1. index.html

  • Basic HTML shell
  • Links to CSS and JavaScript modules
  • Minimal body placeholder

2. CSS modules (templates/css/...)

  • main.css: Global styles and CSS variables
  • modal.css: Modal, grid view, and AI enhancement styles
  • tree.css: Tree view styles
  • components.css: UI components (tabs, badges, buttons)

3. JavaScript modules (templates/js/...)

  • state.js: Shared data structures and UI state
  • analysis.js: Data loading, validation logic, and batch URL parameter handling
  • tree.js: Builds and renders the validation tree + related handlers
  • render.js: List/document/table/grid rendering helpers
  • canvas.js: Drawing utilities for the viewer and cropped previews
  • viewer.js: Modal/viewer controls, zooming, and master evidence logic
  • overrides.js: Data override management system for editing field values
  • changelog.js: Changelog viewer UI for tracking all data modifications
  • verification.js: Field verification system
  • ai-enhancements.js: AI enhancement loading and application
  • events.js: Global event wiring, search/tabs, resize handling, and document toggles
  • icons.js & utils.js: Shared SVG icons + formatting helpers

โœจ Features

Batch Data Loading

Load different batches using URL parameter:

?batch_id=BATCH-VN-CN-2021-9982

The app automatically loads from batch_data/{batch_id}/ folder.

Data Override System

The application includes a powerful override system that allows you to edit field values without modifying the original JSON files:

  • Edit Values: Click the edit button (โœ๏ธ) on any field value in the grid view to modify it
  • Visual Indicators: Edited fields are highlighted with an "EDITED" badge
  • Revert Changes: Use the revert button (โ†บ) to restore original values
  • File-based Storage: All overrides are automatically saved to user_data/overrides.json
  • Change Log: View all modifications in the change log panel (clock icon in bottom-right)
  • Auto-Save: Every change is immediately saved to disk

AI Enhancement System

If a document has AI-enhanced data in enhanced_data/ folder:

  • Banner Notification: A banner appears at the top of the document fields panel
  • Apply All: Click โœ“ to apply all AI suggestions at once
  • Dismiss: Click โœ• to hide the banner
  • Individual Suggestions: Apply or dismiss suggestions field by field

Verification System

  • Mark Fields as Verified: Toggle verification status on any validation
  • Verification Statistics: Track verified vs. total fields
  • Persistent State: Verifications are saved to user_data/verifications.json

Change Log Features

  • Track All Changes: Every edit, revert, and clear action is recorded with timestamp
  • Export/Import Backup: Create backups of your overrides or import from a backup file
  • Clear All: Remove all overrides at once (with confirmation)
  • Real-time Updates: Change count badge updates automatically

Responsive Design

  • Desktop (โ‰ฅ1024px): Split-view with validation list and viewer side-by-side
  • Mobile (<1024px): Full-screen modal viewer
  • Auto-resize: UI automatically updates when resizing browser window

Dark/Light Theme

The application supports dark and light themes controlled via URL parameter:

Main Dashboard (index.html):

http://localhost:8000/templates?batch_id=BATCH-VN-CN-2021-9982&theme=dark
http://localhost:8000/templates?batch_id=BATCH-VN-CN-2021-9982&theme=light

Summary Page (summary.html):

http://localhost:8000/templates/summary.html?batch_id=BATCH-VN-CN-2021-9982&theme=dark
  • Default theme is light if no parameter is specified
  • Theme parameter: ?theme=dark or ?theme=light
  • Summary page is designed for iframe embedding with minimal UI

๐Ÿ”ง Maintenance

Update CSS

Edit the modules under templates/css/

Update JavaScript

Edit the modules under templates/js/

Update HTML shell

Edit templates/index.html

โš ๏ธ Notes

  • Use python3 server.py instead of the basic HTTP server โ€” the override system requires API endpoints for saving/loading data.
  • JavaScript modules use batch_id URL parameter to determine data paths.
  • On XL screens the dashboard/tree view stays on the left (scrollable) and previews render on the right.
  • Data overrides are stored in files (in the user_data/ folder) โ€” they persist across sessions and browsers.
  • The user_data/ folder is automatically git-ignored to prevent committing user-specific data.

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

realtimex_manifest_ai-0.1.2.tar.gz (125.1 kB view details)

Uploaded Source

Built Distribution

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

realtimex_manifest_ai-0.1.2-py3-none-any.whl (149.0 kB view details)

Uploaded Python 3

File details

Details for the file realtimex_manifest_ai-0.1.2.tar.gz.

File metadata

File hashes

Hashes for realtimex_manifest_ai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b4773265ad26d4dbad54d4ca566239cd788c6cc1362045312e1996e761b8202a
MD5 b79137d31ed0e89668a36fbd72dfc596
BLAKE2b-256 019535f7ba1a510f18803bfc317d9f6f5ebb77928af50614e78817cd1a556388

See more details on using hashes here.

File details

Details for the file realtimex_manifest_ai-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for realtimex_manifest_ai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c50d5c712f66a30e9780c43ac5a2eebd43db9201d2b49046872ea2e3d6263f2
MD5 851b59a79f57d6fdefc1d623919ae458
BLAKE2b-256 5a79ebb96e0628d46bf3c14e9ef0d6533fe368a8d0cdd775e8197c2dd3a3dc8e

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