Runbook is an embeddable AI onboarding assistant. Companies connect or import docs, configure the assistant in Studio, and embed it into any app or site. The assistant answers questions using seeded demo knowledge plus any manual sources you add in Studio (stored in the browser until real integrations ship).
Tagline: Turn your docs into an embedded onboarding copilot.
-
Knowledge — Curated demo docs (engineering setup, first week, security, product, expenses). In Studio you can also paste a public GitHub repo URL and import a broad repo snapshot (README + docs + common source files such as
src/**/*.{ts,tsx,js,py,go,...}within demo limits). -
Studio (
/studio) — Edit assistant name, welcome message, primary color, suggested questions, and manual sources. Changes persist tolocalStoragekeyrunbook_demo_bundle_v1and update the live preview (sameEmbeddedRunbookAssistantas embed-demo). -
Embed — Two options:
- React (recommended for Next apps): import
EmbeddedRunbookAssistantfrom@/components/EmbeddedRunbookAssistant. - Script tag (any HTML page): load
public/runbook-embed.jswithdata-project-id="northstar-demo". On the same origin, the script readsrunbook_demo_bundle_v1for welcome, title, color, suggestions, andcustomSourceson each chat request.
- React (recommended for Next apps): import
-
Chat API —
POST /api/embed/chatreturns answer, sources (with excerpts), and steps. Ifdocumentsare provided in the request (Studio/embed demo flow), retrieval uses those imported docs. Otherwise it falls back to seeded demo docs. LLM uses Gemini (with OpenAI fallback) when keys are available.
- Open
/— marketing landing. - Open
/studio— pastehttps://github.com/owner/repoand click Connect GitHub repo. - Confirm imported docs are listed + embed code updates with project id (
owner-repo). - Open
/embed-demo— banner shows which repo currently powers answers. - Ask a docs-related question in the assistant and verify steps + sources reference imported docs.
- Optional: in Studio save multiple repo imports as test agent profiles, then switch between them in
/embed-demoto simulate different customer apps/AI agents.
| Route | Purpose |
|---|---|
/ |
Landing |
/studio |
Studio — config, sources, embed code, live assistant preview |
/embed-demo |
Sample customer page + embedded assistant |
/runbook-embed.js |
Static embed script (public/runbook-embed.js) |
POST /api/embed/chat |
Body: projectId, message, optional pageContext, optional customSources (demo) |
POST /api/github/import |
Body: repoUrl; imports readable docs from a public GitHub repository |
Bearer-authenticated projectId (non-demo) uses indexed project retrieval when Supabase is wired; see route implementation.
- Next.js (App Router) + React + Tailwind
- Gemini + optional OpenAI fallback (
src/lib/ai.ts) for text generation - Keyword retrieval for the public demo (
src/lib/embedKeywordRetrieval.ts) — no extra vector DB fornorthstar-demo - Supabase (optional) for vector-backed keyed projects
npm install
npm run devVisit http://localhost:3000, /studio, and /embed-demo.
npm run buildSee .env.example. The app must not crash if keys are missing.
| Variable | Role |
|---|---|
GEMINI_API_KEY |
Primary LLM for /api/embed/chat (northstar + keyed paths use generateFromGemini) |
OPENAI_API_KEY |
Optional: used if Gemini fails or is absent (see generateFromGemini in src/lib/ai.ts) |
| Supabase / GitHub / OAuth | Optional for production-style indexing and keyed embeds |
Northstar demo: no keys required — keyword retrieval + scripted fallbacks for GitHub access, local setup, first steps, “explain this page”, security rules, etc.
Studio and embed-demo share browser localStorage in the same origin:
runbook_assistant_configrunbook_project_idrunbook_imported_docsrunbook_imported_repo
The vanilla /runbook-embed.js widget can also read these same-origin keys.
Project scoping note: imported docs are only attached to chat when the current widget/assistant projectId matches runbook_project_id, so different repos produce different embed snippets and different AI context.
- Server-side persistence for Studio config and manual sources.
- Wire real GitHub / Notion ingestion into retrieval for production projects.
- Billing / multi-tenant auth — out of scope for this demo.
Routes such as /dashboard, /manager, /demo/* may still exist but are not part of the main product shell.