RedwoodChat is a Redwood-first reusable chat system centered on RedwoodSDK + AI SDK useChat, designed to ship as @redwood-chat/system with subpath exports.
- Phase: v2 UI parity delivery completed (behavior + Vercel-style visual chat surface).
- Active roadmap:
ROADMAP.md. - Validation baseline:
pnpm run lint,pnpm run typecheck,pnpm run test:unit,pnpm run test:regression.
- Git
- Node.js 20+
- Corepack enabled (
corepack enable) - pnpm 9.x (repo is pinned to
pnpm@9.15.9)
If you are forking:
- Fork this repo in GitHub.
- Clone your fork:
git clone <your-fork-url>
cd redwoodChatIf you are not forking:
git clone <repo-url>
cd redwoodChatpnpm installpnpm run lint
pnpm run typecheck
pnpm run test:unit
pnpm run test:regressionRun the RedwoodSDK demo app and use it in the browser.
pnpm --filter redwood-demo run devDefault URL is http://localhost:5173 (Vite may pick 5174+ if 5173 is already in use).
- Open the
LocalURL shown in terminal (usuallyhttp://localhost:5173). - Confirm the Vercel-style chat shell renders: top status bar, centered conversation lane, sticky rounded composer.
- Enter a prompt and optionally attach image/PDF files.
- Click
Sendto stream assistant output. - Use
Stop,Regenerate, andResumefrom the composer controls. - Confirm user messages render as blue right-aligned bubbles and assistant output renders left-aligned with assistant avatar.
By default, demo uses the built-in mock provider. For live providers, use .dev.vars in apps/redwood-demo:
cp apps/redwood-demo/.dev.vars.example apps/redwood-demo/.dev.varsThen set your values in apps/redwood-demo/.dev.vars:
AI_PROVIDER=openaiwithOPENAI_API_KEY=...(and optionalOPENAI_MODEL)- or
AI_PROVIDER=openrouterwithOPENROUTER_API_KEY=...(and optionalOPENROUTER_MODEL)
Then run:
pnpm --filter redwood-demo run devThe demo runtime supports config-driven provider selection via:
apps/redwood-demo/.dev.varsforpnpm --filter redwood-demo run dev.apps/redwood-demo/.envfallback for non-worker local scripts.
Optional telemetry:
CHAT_TELEMETRY_STDOUT=1
- One package with stable subpath exports (
core,react,redwood,providers,ui). - Redwood server-function integration with AI SDK-compatible streaming responses.
- Provider support for OpenAI + OpenRouter in v1.
- D1 persistence + R2/local attachment storage (images/PDF up to 10MB).
- Stream resumption support and telemetry hooks.
- App demo:
apps/redwood-demo - Package:
packages/redwood-chat-system
@redwood-chat/systempackage with required subpath exports.- Core runtime contracts and
createChatSystem. - Redwood handler factory for
/api/chat,/api/chat/:id/stream,/api/chat/attachmentswith AI SDK UI stream-compatible responses. - Provider adapters (
mock, OpenAI-compatible, OpenRouter-compatible) plus config-driven selection. - Storage adapters: in-memory and D1-query-path with retention hooks.
- Attachment adapters: local store and R2 store with fallback support.
- Telemetry event sink wiring in the demo runtime.
- Miniflare config and CI workflow baseline.
- Unit + regression test harness mapped to scenario coverage in the plan.
- RedwoodSDK worker runtime demo path with a Vercel-style chat UI (message bubbles, sticky composer, attachment chips, and send/stop/regenerate/resume controls).
- Follow
AGENTS.md. - Make atomic commits per logical change.
- Only mark work
doneafter lint + tests pass and changes are committed.
- Roadmap:
ROADMAP.md - Change history:
CHANGELOG.md - Repository rules:
AGENTS.md