How diyamenon/chronicle-ai works
1. Chronicle is split into three runtime boundaries: a Slack ingestion process, a Python FastAPI backend, and a browser-facing dashboard. The intent is clear in the repo: Slack captures organizational conversations, the backend persists and reasons over them, and the UI visualizes decisions, metrics, and replayable context.
2. Slack is the live entry point. The slack/ package uses the Slack Bolt Python SDK (slack/app.py) with separate handlers for commands and events. slack/handlers/events/message_event.py receives message traffic, while slack/handlers/commands/query_command.py handles explicit user queries. This is the real-time acquisition layer.
3. AI decision detection sits inside the Slack layer. slack/ai/prompts/decision_detector.py shows that Chronicle’s first reasoning step is prompt-based classification/extraction from Slack text. That means the bot is not just relaying messages; it is identifying candidate decisions and related context at ingestion time.
4. The backend is a focused API and service layer. backend/main.py starts the FastAPI app, and backend/api/routes/ contains route controllers for metrics and decision_replay. These routes are thin HTTP boundaries; the actual business logic lives in backend/api/services/.
5. Domain logic is separated from transport. backend/api/services/metrics.py and backend/api/services/decision_replay.py represent the core application logic for dashboard analytics and replay retrieval. This separation implies the backend is designed as a reusable reasoning engine rather than a route-heavy CRUD app.
6. Persistence is lightweight and local-first. The database layer uses SQLAlchemy models in backend/database/models.py, Pydantic schemas in backend/database/schemas/, and a session module in backend/database/session.py. The README says SQLite is the backing store, so the current data boundary is simple and self-contained.
7. The data model centers on replayable organizational memory. The schemas include decision_replay.py and health.py, which suggests two core payload types: decision evidence/history and operational status. That aligns with the product mission of reconstructing “why” a decision was made, not just storing the decision itself.
8. The frontend is a visualization shell over backend data. The root src/ tree contains App.tsx plus screens like DashboardView, AnalyticsView, DecisionReplayView, ExpertFinderView, KnowledgeGraphView, and SettingsView. These are not ingestion components; they are consumer views for reviewing and exploring captured organizational knowledge.
9. The UI likely mixes live API data with demo/mock sources. src/services/aiReasoningService.ts, src/services/slackAgent.ts, and src/services/demoGenerator.ts indicate the frontend can either call backend-backed reasoning features or generate demo content. src/data.ts and the various view components suggest the dashboard is designed to render synthesized insights rather than raw Slack streams.
10. There is a second, smaller frontend scaffold under frontend/. It contains frontend/app/layout.tsx and frontend/components/ui/card.tsx, which looks like a Next.js-style or design-system starter. Meanwhile, the root-level src/, index.html, vite.config.ts, and server.ts point to a Vite/React app as the active browser runtime. For an architecture diagram, the safest reading is: root SPA is the main client, and frontend/ is a secondary or in-progress shell.
11. The repo is intentionally multi-process, not a single deployable unit. Slack listener, FastAPI backend, and browser client are separate entrypoints with separate runtimes: Python 3.11+ for backend and Slack, Node/TypeScript for the UI. That separation matters because the system’s critical boundary is the event/API handoff between Slack and backend, not a shared in-process application stack.
12. Docs reinforce the intended architecture. docs/architecture/sprint0_architecture.md and the README describe Chronicle as an enterprise-style foundation for later additions like graph synthesis, ADR generation, and expert discovery. So the current repo is a foundation layer: ingestion, persistence, basic metrics/replay, and visualization, with more advanced reasoning features staged for future sprints.
Main entry points: App.tsx App shell · main.py API app · decision_replay.py Replay service · metrics.py Metrics service
Components 23
Slack runtime
Live ingestion and query entry point for organizational conversations.
- Slack app · Slack Bolt application that registers ingestion and command handlers.
slack/app.py - Message event · Receives Slack message traffic for ingestion and downstream reasoning.
slack/handlers/events/message_event.py - Query command · Handles explicit user queries from Slack.
slack/handlers/commands/query_command.py - Decision detector · Prompt-based extraction/classification for candidate decisions in Slack text.
slack/ai/prompts/decision_detector.py
Backend API
FastAPI boundary, application services, and persistence layer.
- API app · Starts the FastAPI backend and mounts the HTTP surface.
backend/main.py - Metrics route · HTTP boundary for dashboard metrics.
backend/api/routes/metrics.py - Replay route · HTTP boundary for decision replay retrieval.
backend/api/routes/decision_replay.py - Metrics service · Computes analytics and dashboard aggregates.
backend/api/services/metrics.py - Replay service · Builds replayable decision context and evidence views.
backend/api/services/decision_replay.py - Models · Database entities for organizational memory and supporting records.
backend/database/models.py - Session · Database session and connection management.
backend/database/session.py - Replay schema · Typed payload for decision replay data.
backend/database/schemas/decision_replay.py - Health schema · Operational status and health payloads.
backend/database/schemas/health.py - Config · Backend configuration and environment wiring.
backend/core/config.py
Browser UI
Primary dashboard used to explore decisions, analytics, and replayed context.
- UI entry · Browser application bootstrap for the dashboard shell.
src/main.tsx - App shell · Top-level client composition and navigation shell.
src/App.tsx - Dashboard · Primary overview for metrics and summaries.
src/components/DashboardView.tsx - Analytics · Charts and higher-level analytics surface.
src/components/AnalyticsView.tsx - Decision replay · Interactive review of decision context and history.
src/components/DecisionReplayView.tsx - Knowledge graph · Exploration surface for synthesized relationships and context.
src/components/KnowledgeGraphView.tsx - Reasoning service · Frontend integration for AI-backed reasoning features.
src/services/aiReasoningService.ts - Demo generator · Generates sample or mock content for the dashboard.
src/services/demoGenerator.ts - Slack agent · Client-side Slack-oriented integration used by the UI.
src/services/slackAgent.ts
Connections 27
- Slack app → Message event: registers · Slack app wires in the message ingestion handler.
- Slack app → Query command: registers · Slack app wires in the explicit query command handler.
- Message event → Decision detector: classifies · Incoming messages are analyzed for candidate decisions.
- Message event → API app: writes via API · Ingested conversation data is forwarded to the backend boundary.
- Query command → API app: queries via API · Interactive Slack queries are served through the backend.
- API app → Metrics route: mounts · Main app exposes the metrics route.
- API app → Replay route: mounts · Main app exposes the decision replay route.
- Metrics route → Metrics service: delegates · Route logic is kept thin and delegated to a service.
- Replay route → Replay service: delegates · Route logic is kept thin and delegated to a service.
- Metrics service → Models: reads · Metrics are derived from persisted records.
- Metrics service → Session: uses · Service accesses the database through a session boundary.
- Replay service → Replay schema: serializes · Replay service returns typed replay payloads.
- Replay service → Models: reads · Replay context is reconstructed from stored data.
- Replay service → Session: uses · Service accesses persistence through the session boundary.
- API app → Config: loads · Runtime configuration is loaded at startup.
- API app → Health schema: exposes · Backend health payloads support operational checks.
- UI entry → App shell: boots · Browser entrypoint mounts the main app shell.
- App shell → Dashboard: renders · Top-level shell composes the dashboard view.
- App shell → Analytics: renders · Top-level shell composes the analytics view.
- App shell → Decision replay: renders · Top-level shell composes the replay view.
- App shell → Knowledge graph: renders · Top-level shell composes the knowledge graph view.
- Dashboard → Metrics service: fetches metrics · Dashboard consumes analytics from the backend service layer.
- Analytics → Metrics service: fetches metrics · Analytics view is driven by backend metrics.
- Decision replay → Replay service: fetches replay · Replay view consumes backend replay data.
- Knowledge graph → Reasoning service: uses · Graph exploration is augmented by client-side reasoning features.
- Dashboard → Demo generator: can seed · Dashboard can be populated with demo content.
- App shell → Slack agent: integrates · Client app includes Slack-oriented interaction helpers.