How swamiabhishek45/openbook works
OpenBook is an AI research and study studio: users create workspaces, ingest research sources, then chat over them or generate study artifacts and interactive debate podcasts. The client presents workspace, source, chat, and learning flows; the Express API delegates domain work to services, with Inngest for background generation. The README documents RAG, integrations, subscriptions, and artifact types; sampled source confirms source and integration handling plus podcast interruption and audio delivery. Some subsystem wiring is based on README and tree evidence rather than inspected implementation.
Main entry points: artifact-generation.services.ts Artifact generation · index.ts Express API · source.services.ts Source processing · api-client.ts API client
Components 33
Workspace studio
- Workspace UI
client/app/(protected)/workspace/[workspaceId]/page.tsx - Source library
client/features/sources/components/sources-panel.tsx - Grounded chat
client/features/chat/components/chat-panel.tsx - Learning studio
client/features/learn/components/studio-panel.tsx - Podcast viewer
client/features/learn/components/podcast-viewer.tsx - API client
client/lib/api-client.ts
API and domain
- Express API
server/src/index.ts - Source routes
server/src/routes/source.routes.ts - Source controller
server/src/controllers/source.controller.ts - Artifact controller
server/src/controllers/artifact.controller.ts - Chat routes
server/src/routes/chat.routes.ts - Chat service
server/src/services/chat.services.ts
Source and retrieval
- Source processing
server/src/services/source.services.ts - Ingestion adapters
server/src/lib/sources - Chunking
server/src/lib/chunking.ts - RAG retrieval
server/src/lib/rag/retrieve.ts - Source records
server/src/repository/source.repository.ts - Vector index
server/src/lib/pinecone.ts
Learning generation
- Artifact service
server/src/services/artifact.services.ts - Artifact generation
server/src/services/artifact-generation.services.ts - Background workers
server/src/inngest/index.ts - Artifact records
server/src/repository/artifact.repository.ts - Podcast interruption
server/src/services/podcast-interruption.services.ts
Accounts and services
- Authentication
server/src/lib/auth.ts - Billing services
server/src/services/payment.services.ts - Integration services
server/src/controllers/integration.controller.ts - PostgreSQL
server/src/lib/db.ts
Other components
- Researcher
- AI models
- ElevenLabs
- Cloudinary
- External sources
- Razorpay
Connections 38
- Researcher → Workspace UI: uses
- Workspace UI → Source library: opens
- Source library → API client: submits sources
- Grounded chat → API client: sends questions
- Learning studio → API client: requests artifacts
- Podcast viewer → API client: asks interruption
- API client → Express API: HTTP requests
- Express API → Authentication: authenticates
- Express API → Source routes: registers routes
- Source routes → Source controller: dispatches
- Source controller → Source processing: calls
- Source processing → Ingestion adapters: fetches content
- Source processing → Chunking: chunks content
- Source processing → Source records: persists sources
- Source processing → Background workers: emits processing work
- Ingestion adapters → External sources: imports from
- Chat routes → Chat service: dispatches
- Chat service → RAG retrieval: retrieves context
- RAG retrieval → Vector index: searches vectors
- RAG retrieval → AI models: embeds and reranks
- Chat service → AI models: generates replies
- Artifact controller → Artifact service: calls
- Artifact service → Background workers: queues generation
- Background workers → Artifact generation: runs generation
- Artifact generation → Source records: uses workspace sources
- Artifact generation → AI models: generates artifacts
- Artifact generation → ElevenLabs: synthesizes speech
- Artifact generation → Cloudinary: stores media
- Artifact generation → Artifact records: persists artifacts
- Artifact controller → Podcast interruption: processes questions
- Podcast interruption → RAG retrieval: grounds replies
- Podcast interruption → ElevenLabs: synthesizes response
- Artifact controller → Artifact records: reads podcast audio
- Express API → Integration services: serves integration API
- Integration services → External sources: connects providers
- Express API → Billing services: serves billing API
- Billing services → Razorpay: handles subscriptions
- Billing services → PostgreSQL: updates plan state