Add comprehensive documentation for key organizational aspects
- Introduced "Pension Scheme & Benefits" detailing secondary employment benefits and pension specifics. - Created "Roles & Accountabilities" outlining the Holacracy role structure and responsibilities within Respellion. - Added "Security" section covering GDPR compliance and workplace safety protocols. - Established "Spending and Contracting" policy detailing expense categories and submission processes. - Documented "Who We Are" to define Respellion's identity, services, and operational model under Holacracy and ISO 9001.
This commit is contained in:
58
README.md
58
README.md
@@ -4,24 +4,28 @@ An internal AI-powered learning platform that keeps Respellion employees up to d
|
||||
|
||||
## Features
|
||||
|
||||
- **Weekly Learning Station** — Each employee is assigned a topic each week (via deterministic hash of user ID + week number). They choose their preferred format: Article, Slides, or Infographic. Content is generated on-demand by Claude and cached per topic.
|
||||
- **Weekly Test** — AI-generated quiz based on the knowledge graph. Results are stored and feed the leaderboard.
|
||||
- **Leaderboard & Gamification** — Points for correct answers, badges for streaks and perfect scores.
|
||||
- **R42 Chatbot** — An always-available AI assistant (backed by Claude) with access to the full knowledge graph. Can propose graph updates that admins approve or reject.
|
||||
- **Admin Panel** — Manage the knowledge graph, upload source files, review generated content, refine it with AI, and monitor team progress.
|
||||
- **Onboarding** — On first login each employee enrolls into the curriculum with one tap. Their 26-week cycle starts then and there.
|
||||
- **Weekly Learning Station** — Each employee gets a topic for their current curriculum week, drawn from the active 26-week schedule (with a deterministic hash fallback when no curriculum is active). They engage via micro-learnings (concept explainer, scenario quiz, flashcard set) and can also generate long-form formats (Article, Slides, Infographic) on demand.
|
||||
- **Weekly Test** — A 5-question AI-generated quiz for the week's topic. Results feed the leaderboard.
|
||||
- **Leaderboard & Gamification** — Points for correct answers, badges for milestones (First Steps, Veteran, Perfectionist).
|
||||
- **R42 Chatbot** — An always-available AI assistant (Claude) grounded in the knowledge graph via local TF-IDF retrieval. It can propose graph updates that admins approve or reject.
|
||||
- **Admin Panel** — Manage the knowledge graph, upload source files, review/refine generated content, generate the curriculum, and manage the team.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
| Layer | Technology |
|
||||
|---|---|
|
||||
| Frontend | React 18 + Vite |
|
||||
| Styling | Vanilla CSS (custom properties) + Tailwind utility classes |
|
||||
| Frontend | React 19 + Vite 8, React Router 7 |
|
||||
| Styling | Vanilla CSS (custom properties) + Tailwind v4 utilities |
|
||||
| Animations | Framer Motion |
|
||||
| Icons | Lucide React |
|
||||
| Graph viz | D3.js (admin knowledge graph only) |
|
||||
| Backend / DB | PocketBase (self-hosted) |
|
||||
| Backend / DB / auth | PocketBase (self-hosted, SQLite) |
|
||||
| Retrieval | Local TF-IDF (no Qdrant, no embeddings API) |
|
||||
| AI | Anthropic Claude (via Caddy reverse proxy) |
|
||||
| Infra | Docker + Caddy |
|
||||
| Infra | Docker + Caddy; Ansible playbooks under `infra/` |
|
||||
|
||||
**Claude models (by tier):** `fast` = `claude-haiku-4-5-20251001`, `standard` = `claude-sonnet-4-6`, `reasoning` = `claude-opus-4-7`.
|
||||
|
||||
## Getting Started (local dev)
|
||||
|
||||
@@ -29,14 +33,17 @@ An internal AI-powered learning platform that keeps Respellion employees up to d
|
||||
# 1. Install dependencies
|
||||
npm install
|
||||
|
||||
# 2. Start PocketBase (Windows)
|
||||
# 2. Start PocketBase
|
||||
./pocketbase.exe serve
|
||||
|
||||
# 3. Start the dev server
|
||||
# 3. Bootstrap collections (first run only)
|
||||
node scripts/setup-pb-collections.mjs
|
||||
|
||||
# 4. Start the dev server
|
||||
npm run dev
|
||||
```
|
||||
|
||||
The Vite dev server proxies `/api/anthropic` and `/pb` — see `vite.config.js`.
|
||||
Set `ANTHROPIC_API_KEY` in your environment — the Vite dev server proxies `/api/anthropic` and injects the key server-side (see `vite.config.js`). PocketBase migrations in `pb_migrations/` apply automatically when the binary starts.
|
||||
|
||||
## Deployment (Docker)
|
||||
|
||||
@@ -46,34 +53,39 @@ docker compose up -d
|
||||
|
||||
The `Caddyfile` handles:
|
||||
- SPA fallback routing
|
||||
- `/pb/*` → PocketBase sidecar
|
||||
- `/api/anthropic/*` → Anthropic API (with server-side API key injection)
|
||||
- `/api/anthropic/*` → Anthropic API (server-side API key injection)
|
||||
- `/api/*` and `/_/*` → the PocketBase sidecar
|
||||
|
||||
## Key Files
|
||||
|
||||
| File | Purpose |
|
||||
|---|---|
|
||||
| `src/lib/learningService.js` | Selective content generation (article / slides / infographic) |
|
||||
| `src/lib/extractionPipeline.js` | Uploaded file → knowledge graph extraction |
|
||||
| `src/lib/llm.js` | Core Anthropic LLM wrapper |
|
||||
| `src/lib/llm.js` | Core Anthropic wrapper (`callLLM`): tiers, retry, schema validation, telemetry |
|
||||
| `src/lib/db.js` | All PocketBase data access |
|
||||
| `src/store/AppContext.jsx` | Global state; computes ISO week number on load |
|
||||
| `src/components/admin/UploadZone.jsx` | Drag-and-drop file upload UI |
|
||||
| `src/lib/extractionPipeline.js` | Uploaded file → knowledge-graph extraction |
|
||||
| `src/lib/learningService.js` | On-demand content generation (article / slides / infographic) |
|
||||
| `src/lib/microLearningService.js` | Micro-learning generation (3 types) |
|
||||
| `src/lib/curriculumService.js` | 26-week per-user curriculum engine |
|
||||
| `src/lib/retrieval.js` | TF-IDF retrieval for R42 |
|
||||
| `src/store/AppContext.jsx` | Global state; derives the user's curriculum week from their start date |
|
||||
| `AI_AGENT.md` | Detailed context guide for AI coding agents |
|
||||
|
||||
## Content Types
|
||||
|
||||
Learning content is generated **on demand per type** and merged into the cached object:
|
||||
On-demand long-form content (the `content` collection), generated per type and merged into the cached object:
|
||||
|
||||
| Type | Key in DB | Description |
|
||||
|---|---|---|
|
||||
|---|---|---|
|
||||
| Article | `content.article` | Long-form reading |
|
||||
| Slides | `content.slides` | Slide deck with speaker notes |
|
||||
| Infographic | `content.infographic` | Visual summary with stats and steps |
|
||||
|
||||
> The podcast type was removed. Do not re-add it.
|
||||
|
||||
Micro-learnings (the `micro_learnings` collection): `concept_explainer`, `scenario_quiz`, `flashcard_set`.
|
||||
|
||||
## Documentation
|
||||
|
||||
- **`AI_AGENT.md`** — Full architectural guide for AI coding agents (patterns, gotchas, decisions).
|
||||
- **`CHANGELOG.md`** — PocketBase upstream changelog (not application changelog).
|
||||
- **`CLAUDE.md`** — project overview and constraints for AI coding agents.
|
||||
- **`AI_AGENT.md`** — full architectural guide (patterns, gotchas, decisions).
|
||||
- **`docs/`** — subsystem specs (architecture, data model, ingestion, generation, curriculum, R42, frontend, gamification).
|
||||
|
||||
Reference in New Issue
Block a user