Taaweel docs Open the appOpen app
On this page
  1. Run it
  2. Providers and models
  3. The two workflows
  4. Offline safety net
  5. Cost discipline
  6. Known boundaries (honest)

Operating Taaweel

Open the app Raw Markdown Download all docs (one file)

Run it

cd taaweel
npm install
copy .env.example .env      # provider + keys
npm run data -- import <folder with the source DBs>
npm run dev                 # http://127.0.0.1:3901/dashboard

For a production install (build, npm start, health checks, shutdown) see the README's Production section; for deploying (Docker, plain Node, cPanel), backups, monitoring and retention, see deploy/README.md.

Providers and models

TAAWEEL_PROVIDER = mock | deepseek | zai | openai | openrouter. Keys resolve: admin-saved key (Models → API keys) → TAAWEEL_<PROVIDER>_API_KEY → <PROVIDER>_API_KEY, from this app's own .env. Per-stage overrides: TAAWEEL_MODEL_PLAN / _EXTRACT / _REASON / _COMPOSE (each accepts provider:model).

Cheap models work — the pipeline decomposes reasoning into small, grounded, code-checked calls. Typical full-run cost on deepseek-chat: $0.6–1.0; a compose-only regeneration: ~$0.02.

The two workflows

Dashboard: New research → refine chat → lock → run (live stage progress) → report → discuss chat / regenerate-from-angle / science sources / rebuild-from-stage → behind-the-scenes page.

API:

MethodPathPurpose
POST/api/questionscreate question (+ first run)
POST/GET/api/questions/:id/chatrefinement chat
POST/api/questions/:id/locklock the refined question
POST/api/questions/:id/runcreate a run for a locked question
POST/api/runs/:id/start · /stoprun control
GET/api/runs/:id/events?since=NDJSON live events
GET/api/runs/:id · /ledger · /report.mdstate, ledger, report
POST/GET/api/runs/:id/report-chatdiscuss the report
POST/api/runs/:id/regenerateregenerate from an angle
POST/api/runs/:id/sourcesattach user-supplied empirical sources
POST/api/objections/:id/resolveresolve a ledger objection
GET/dashboard/runs/:id/metathe provenance page
GET/docs · /docs/:slug · /docs/:slug.md · /docs/exportthis documentation

Offline safety net

npm run smoke runs the entire pipeline against the mock provider (56 checks, no network, no keys) — the same plumbing the live runs use. Use it after every code change.

Cost discipline

  • Deterministic code does everything countable; LLM calls are small and JSON-validated.
  • Every stage records tokens and cost (pipeline_jobs); run pages show totals.
  • Rebuild-from lets you re-run only what a change invalidates (e.g. --rebuild-from audit ≈ $0.05).

Known boundaries (honest)

  • GLM/Z.AI is fully wired but needs account balance to execute live runs.
  • Rāzī's Mafātīḥ al-Ghayb is not yet in any fetchable catalogue; al-Wahīdī's al-Wasīṭ is available (fetchTafsir.ts wasit).
  • With very cheap models, judgment-call stages can vary between runs (e.g. how far the cosmic reading of Ard goes); the code gates (blinding, scope partition, L7, terminology) bound that variance, and the report shows its own audit trail either way.