LEXWEAVECORE ENGINE BY LEXPOSERRead the docs

Compile the book once.
Shape every exposure.

Lexweave turns long-form text into a portable reading program, then plans deterministic word, phrase and sentence exposure for each reader without a read-time LLM.

THREE LINES · MANY READING STATES
A REAL RULE THROUGH THE ENGINEVERIFIED AGAINST packages/render/test/engine.test.cjs

The checked-in test rule replaces 灵石 with spirit stone. Change its action level to inspect the exact scaffold rendered for the reader.

BUNDLEcandidates + annotations
COREexpressionsFromAssets()
COREplanReplacements()
RENDERtransformSection()
REPLACEMENT RULE@lexweave/core
{
  from: '灵石',
  to: 'spirit stone',
  level: 1,
  tier: 'word'
}
FLOW BUDGET
selects which rules surface
ACTION LEVEL
controls visible scaffolding
LEVEL DISPLAY@lexweave/render
Action level
transformText('三块灵石在桌上', rules)

三块灵石(spirit stone)在桌上

Source primary · target gloss visible
Planner inputReadingMemory + ReadingMetricsSummary + bundle strategyPlanner outputfrom + to + level + retired + tierRenderer outputoutput + appliedSources

Choose the boundary
your product needs.

Start from the input object you already own. Each path names the minimum package surface and the output you can verify.

01

I have raw long-form text

@lexweave/compile + core + render

Compile, plan, and render the complete loop.

02

I already have verified annotations

@lexweave/core + render

Build reader state and deterministic replacement rules.

03

I only need text substitution

@lexweave/render

Apply known replacement rules to HTML or plain text.

04

I want to inspect the full system

lexweave CLI

Run the offline sample before embedding packages.

A reading engine,
not a text highlighter.

Units are extracted and verified at compile time. At read time, Lexweave selects only the replacements that fit the current reader, location and flow budget.

01 · STRUCTURE

Compile meaning, not decoration.

Extract verbatim words, phrases, grammar and entities from the complete source.

02 · PLAN

Use the reader signal.

Balance density, scaffolding, unit tier and novelty against comprehension.

03 · RENDER

Keep the output deterministic.

The same source, bundle, reader state and parameters produce the same view.

One asset. Infinite reading states.

SOURCEbook.txt
COMPILE · LLM ONCEstructure · units
PORTABLE ASSET.lexweave.json
PLANNER · LOCALreader state
RENDER · OFFLINEadaptive view
60-SECOND OFFLINE DEMO

Inspect the whole loop.

No API key is required for the mock-provider demo.

Open Quickstart →
git clone https://github.com/lexweave-hq/lexweave
cd lexweave && npm install && npm run build

# compile and render the bundled sample
npm run demo

# inspect the portable reading program
node packages/cli/dist/lexweave.cjs inspect \
  examples/demo/sample-book.lexweave.json

Real packages.
Narrow interfaces.

Use the full CLI or embed only the boundary your product needs.

@lexweave/core

Schemas, language units, flow budget, planning and reader memory.

npm i @lexweave/core
@lexweave/compile

Compile long-form text into a portable reading program with any LLM.

npm i @lexweave/compile
@lexweave/render

Deterministic replacement injection for HTML and plain text.

npm i @lexweave/render
lexweave

CLI for compile, render and inspect workflows.

npm i lexweave
APACHE-2.0

Open where it matters.

Read the planner. Inspect the bundle. Replace the model adapter. Run the renderer in a browser, WebView or Node.

A1
A2
B1
B2
C1

Plan the next
exposure.

Start with Quickstart