Skip to content
PR
01Live

LYTA

An edge-native workspace with persistent files, cited retrieval, and resilient streaming.

What it solves
Keeps a reusable document library across conversations, so users do not upload files and rebuild their context from zero each time.
Engineering decision
The SSE response is opened before the model runs, so an upstream failure becomes a controlled in-stream error instead of a platform crash page mid-answer.
Proof
Unit and integration tests cover retrieval boundaries, streaming persistence, log redaction, abuse controls and security headers. An end-to-end smoke test and a versioned AI evaluation suite run in CI.

TypeScript · Cloudflare Workers · Durable Objects · Workers AI · SSE · PDF.js · Mammoth

Scope note: LYTA does not use a dedicated external vector database.

Animated diagram: documents orbit a persistent workspace core; a retrieved document lights up and streams a cited answer.

Documents orbit a persistent workspace core; relevant fragments illuminate and form a cited response trail.

(Case study)

How LYTA is built

Constraints, decisions and limits, in the order they shaped the system.

Use case

  • A persistent working surface where documents stay available across conversations and answers point back to the source fragment.

What I built

  • Built and deployed a live workspace with persistent conversations and reusable documents.
  • Split responsibility across router, authentication, workspace, and conversation state.
  • Used Cloudflare Durable Objects for explicit state ownership.
  • Implemented document parsing, chunking, embeddings, retrieval, and citations.
  • Added persistent chat and reusable output workflows.
  • Opened the SSE response before model execution so upstream failures return controlled errors rather than platform crash pages.
  • Added traceable, privacy-conscious failure handling.
  • Made model selection config-driven, with timeout, retry and fallback.
  • Added a versioned AI evaluation baseline enforced as a CI gate.

Constraints

  • Edge runtime: no long-lived server process, no local filesystem.
  • State has to be owned somewhere explicit, or concurrent writes corrupt a conversation.
  • Model calls can fail after the user has already committed to waiting.

Approach

  • Give each concern its own boundary: router, auth, workspace state, conversation state.
  • Persist documents at the workspace level so they are reusable across conversations.
  • Parse and chunk on upload, embed once, retrieve per question, and carry citations through.

Architecture

  • Cloudflare Workers router with authentication in front of Durable Objects.
  • Durable Objects as the single owner of workspace and conversation state.
  • Workers AI for embeddings and generation; PDF.js and Mammoth for document parsing.

Key decisions

  • Durable Objects over shared global state, because state ownership should be nameable.
  • Open the SSE channel first so every downstream failure has a delivery path.
  • Citations stored with the answer so a response can be checked, not just read.

Limitations

  • No dedicated external vector database; retrieval runs against the workspace's own stored embeddings.
  • Deployed as a personal live workspace, not a multi-tenant commercial product.

What I learned

  • Where state lives is an architectural decision, not an implementation detail.
  • The failure path deserves the same design attention as the happy path.