idea70-narrativeweave-real-.../README.md

1.6 KiB

NarrativeWeave — idea70-narrativeweave-real-time

NarrativeWeave is a portable Python library and service for assembling auditable, deterministic market research narratives from streaming inputs. It implements a minimal canonical NarrativeBlock model, an append-only event log, a deterministic replay engine, and a lightweight tamper-evident ledger for provenance.

This repository contains a focused, production-minded foundation for the broader NarrativeWeave project described in the original idea. It provides:

  • A Pydantic-backed NarrativeBlock data model
  • SQLite-based append-only event log and normalized block storage
  • Two adapter stubs (news feed, transcript importer) to show integration points
  • Deterministic replay function that regenerates NarrativeBlocks from the event log
  • A simple hash-chain ledger that anchors block versions
  • A FastAPI app to ingest events and query blocks
  • Tests and a build-ready pyproject/setup.cfg

Getting started

Install dependencies (recommended inside a virtualenv):

python3 -m pip install -e .

Run tests and build (the repository includes test.sh to run both):

./test.sh

Run the API locally for development:

uvicorn idea70_narrativeweave_real_time.api:app --reload

Project layout

  • idea70_narrativeweave_real_time/: python package
  • tests/: pytest tests
  • pyproject.toml + setup.cfg: packaging metadata
  • AGENTS.md: repository rules and notes for future AI contributors

Limitations

This initial implementation focuses on correctness, deterministic replay, and auditable ledger semantics. It intentionally leaves advanced NLP, production adapters for FIX/WebSocket, and UI components for follow-on work.