How ebrahimabdelwahed/cardine works
Cardine is a repository-backed study workspace whose main workflow is to create a course, add trusted source material, and ask grounded questions through a conversation-first shell. Its runtime also supports durable sessions, generated and reviewed study artifacts, assessment, and recall. The README describes canonical events as authority and projections as rebuildable read models. The graph reflects those documented boundaries and sampled service behavior; unsampled subsystem wiring is shown only where the README explicitly establishes it.
Main entry points: event_store.py Canonical event stream · main.py CLI host · indexing.py Source indexing · gateway.py Study capabilities
Components 21
Product hosts
- CLI host
src/cardine/cli/main.py - Conversation shell
src/cardine/demo/product_shell.py - Browser host
src/cardine/demo/browser.py
Application workflows
- Conversation turns
src/cardine/application/conversation_turn.py - Grounded ask
src/cardine/application/grounding_ask.py - Source indexing
src/cardine/application/indexing.py - Document admission
src/cardine/documents/admission.py
Learning runtime
- Lesson retrieval
src/cardine/knowledge/lesson_selection.py - Study playbooks
src/study_agent/playbooks/engine.py - Study capabilities
src/study_agent/capabilities/gateway.py - Study artifacts
src/study_agent/artifacts/service.py - Assessment and grading
src/study_agent/assessments/service.py - Flashcard recall
src/study_agent/recall/service.py
Canonical state
- Session turns
src/study_agent/sessions/turn_service.py - Canonical event stream
src/study_agent/adapters/sqlite/event_store.py - Course read model
src/cardine/courses/projection.py - Source snapshots
src/study_agent/adapters/filesystem/blob_store.py
Adapters and integrations
- Model adapters
src/cardine/adapters/model/openai_luna.py - Host tools
src/cardine/hosts/runner.py - Repository boundary
src/study_agent/adapters/filesystem/repository_target.py
Other components
- Learner
Connections 20
- Learner → CLI host: runs commands
- Learner → Conversation shell: uses shell
- Learner → Browser host: uses browser
- CLI host → Repository boundary: resolves repository
- CLI host → Source indexing: dispatches commands
- Conversation shell → Conversation turns: starts conversation
- Browser host → Conversation turns: presents conversation
- Conversation turns → Session turns: records turns
- Source indexing → Document admission: admits documents
- Source indexing → Source snapshots: stores snapshots
- Grounded ask → Lesson retrieval: selects evidence
- Grounded ask → Study playbooks: runs study flow
- Study playbooks → Study capabilities: dispatches capability
- Study capabilities → Model adapters: requests generation
- Study capabilities → Host tools: invokes tools
- Session turns → Canonical event stream: appends events
- Study artifacts → Canonical event stream: appends events
- Assessment and grading → Canonical event stream: appends events
- Flashcard recall → Canonical event stream: appends events
- Course read model → Canonical event stream: projects events