# rcarubbi/tessera architecture

> Architecture diagram of the GitHub repository rcarubbi/tessera, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rcarubbi/tessera
- Repository: https://github.com/rcarubbi/tessera
- Video tour (about a minute): https://gitdiagram.com/rcarubbi/tessera/video

## Overview

Tessera ingests Git repositories, parses their structure, enriches changed entities with optional AI summaries, and stores commit-versioned architecture snapshots. Users explore the resulting graph, compare versions, inspect impact, review descriptions and ask cited questions; GitHub webhooks also trigger analysis and PR risk checks. The graph preserves the documented product branches. Source excerpts show core pipeline, query, retrieval and persistence behavior; several UI, auth and integration links are based on README descriptions rather than inspected implementation.

Main entry points: [`web/app/page.tsx`](https://github.com/rcarubbi/tessera/blob/main/web/app/page.tsx) (Web dashboard), [`src/Tessera.Worker/Pipeline/AnalysisPipeline.cs`](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Worker/Pipeline/AnalysisPipeline.cs) (Repository analysis), [`src/Tessera.Api/Program.cs`](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Api/Program.cs) (Tessera API), [`src/Tessera.Infrastructure/Data/TesseraDbContext.cs`](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Data/TesseraDbContext.cs) (Tessera database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and ingestion"]
  node_api["Tessera API<br/>[Program.cs]"]
  node_auth["Authentication"]
  node_github_hooks["GitHub integration<br/>[GitHubEndpoints.cs]"]
end

subgraph group_analysis["Analysis pipeline"]
  node_worker["Job processor<br/>[JobProcessor.cs]"]
  node_pipeline["Repository analysis"]
  node_ai["AI summarization<br/>[AiSummarizer.cs]"]
  node_linking["Architecture linking"]
  node_embedding["Embedding generation"]
end

subgraph group_knowledge["Knowledge storage"]
  node_merkle["Snapshot composition"]
  node_entities["Graph entities<br/>[KnowledgeNode.cs]"]
  node_database[("Tessera database")]
end

subgraph group_insights["Architecture insights"]
  node_query["Graph queries"]
  node_impact["Impact analysis"]
  node_rules["Architecture rules"]
  node_pr["PR risk review<br/>[PrReviewService.cs]"]
  node_chat["RAG chat"]
  node_retrieval["Semantic retrieval"]
end

subgraph group_dashboard["Dashboard experience"]
  node_web["Web dashboard<br/>[page.tsx]"]
  node_graph_view["Graph explorer<br/>[GraphView.tsx]"]
  node_chat_panel["Chat panel<br/>[ChatPanel.tsx]"]
  node_diff_view["Snapshot diff<br/>[DiffView.tsx]"]
  node_review_panel["Review tools<br/>[ReviewPanel.tsx]"]
end

node_user(("Engineer"))
node_github["GitHub"]
node_llm["LLM provider"]
node_parser["Tree-sitter sidecar<br/>[index.js]"]

node_user -->|"uses"| node_web
node_web -.->|"requests data"| node_api
node_api -->|"authenticates"| node_auth
node_github -->|"sends webhooks"| node_github_hooks
node_github_hooks -.->|"queues analysis"| node_worker
node_worker -->|"processes jobs"| node_pipeline
node_pipeline -->|"parses sources"| node_parser
node_pipeline -->|"summarizes changes"| node_ai
node_llm -.->|"provides completions"| node_ai
node_pipeline -->|"links architecture"| node_linking
node_pipeline -->|"generates embeddings"| node_embedding
node_pipeline -->|"composes snapshots"| node_merkle
node_merkle -->|"persists snapshot"| node_database
node_entities -->|"stored as"| node_database
node_query -->|"reads graph"| node_database
node_api -->|"serves graph queries"| node_query
node_api -->|"serves impact results"| node_impact
node_pr -->|"computes impact"| node_query
node_pr -->|"checks violations"| node_rules
node_chat -.->|"retrieves context"| node_retrieval
node_retrieval -->|"loads nodes"| node_database
node_api -->|"serves chat"| node_chat
node_web -->|"renders graph"| node_graph_view
node_web -->|"offers chat"| node_chat_panel
node_web -->|"shows diffs"| node_diff_view
node_web -->|"supports review"| node_review_panel
node_web -.->|"displays PR risk"| node_pr
node_web -.->|"manages rules"| node_rules

click node_parser "https://github.com/rcarubbi/tessera/blob/main/analyzers/src/index.js"
click node_api "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Api/Program.cs"
click node_auth "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Api/TesseraAuthenticationHandler.cs"
click node_github_hooks "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Api/GitHubEndpoints.cs"
click node_worker "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Worker/JobProcessor.cs"
click node_pipeline "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Worker/Pipeline/AnalysisPipeline.cs"
click node_ai "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Ai/AiSummarizer.cs"
click node_linking "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Analysis/ArchitectureLinkingService.cs"
click node_embedding "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Analysis/EmbeddingGenerator.cs"
click node_merkle "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Domain/Merkle/SnapshotComposer.cs"
click node_entities "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Domain/Entities/KnowledgeNode.cs"
click node_database "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Data/TesseraDbContext.cs"
click node_query "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Queries/GraphQueryService.cs"
click node_impact "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Queries/ImpactAnalysisService.cs"
click node_rules "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Analysis/ArchitectureRuleService.cs"
click node_pr "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Reviews/PrReviewService.cs"
click node_chat "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Chat/ArchitectureChatService.cs"
click node_retrieval "https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Chat/RetrievalService.cs"
click node_web "https://github.com/rcarubbi/tessera/blob/main/web/app/page.tsx"
click node_graph_view "https://github.com/rcarubbi/tessera/blob/main/web/components/GraphView.tsx"
click node_chat_panel "https://github.com/rcarubbi/tessera/blob/main/web/components/ChatPanel.tsx"
click node_diff_view "https://github.com/rcarubbi/tessera/blob/main/web/components/DiffView.tsx"
click node_review_panel "https://github.com/rcarubbi/tessera/blob/main/web/components/ReviewPanel.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_auth,node_github_hooks toneBlue
class node_worker,node_pipeline,node_ai,node_linking,node_embedding toneAmber
class node_merkle,node_entities,node_database toneMint
class node_query,node_impact,node_rules,node_pr,node_chat,node_retrieval toneRose
class node_web,node_graph_view,node_chat_panel,node_diff_view,node_review_panel,node_user,node_github,node_llm toneIndigo
class node_parser toneTeal
```

## Components

### Access and ingestion

- [Tessera API](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Api/Program.cs): `src/Tessera.Api/Program.cs`
- [Authentication](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Api/TesseraAuthenticationHandler.cs): `src/Tessera.Api/TesseraAuthenticationHandler.cs`
- [GitHub integration](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Api/GitHubEndpoints.cs): `src/Tessera.Api/GitHubEndpoints.cs`

### Analysis pipeline

- [Job processor](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Worker/JobProcessor.cs): `src/Tessera.Worker/JobProcessor.cs`
- [Repository analysis](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Worker/Pipeline/AnalysisPipeline.cs): `src/Tessera.Worker/Pipeline/AnalysisPipeline.cs`
- [AI summarization](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Ai/AiSummarizer.cs): `src/Tessera.Infrastructure/Ai/AiSummarizer.cs`
- [Architecture linking](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Analysis/ArchitectureLinkingService.cs): `src/Tessera.Infrastructure/Analysis/ArchitectureLinkingService.cs`
- [Embedding generation](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Analysis/EmbeddingGenerator.cs): `src/Tessera.Infrastructure/Analysis/EmbeddingGenerator.cs`

### Knowledge storage

- [Snapshot composition](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Domain/Merkle/SnapshotComposer.cs): `src/Tessera.Domain/Merkle/SnapshotComposer.cs`
- [Graph entities](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Domain/Entities/KnowledgeNode.cs): `src/Tessera.Domain/Entities/KnowledgeNode.cs`
- [Tessera database](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Data/TesseraDbContext.cs): `src/Tessera.Infrastructure/Data/TesseraDbContext.cs`

### Architecture insights

- [Graph queries](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Queries/GraphQueryService.cs): `src/Tessera.Infrastructure/Queries/GraphQueryService.cs`
- [Impact analysis](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Queries/ImpactAnalysisService.cs): `src/Tessera.Infrastructure/Queries/ImpactAnalysisService.cs`
- [Architecture rules](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Analysis/ArchitectureRuleService.cs): `src/Tessera.Infrastructure/Analysis/ArchitectureRuleService.cs`
- [PR risk review](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Reviews/PrReviewService.cs): `src/Tessera.Infrastructure/Reviews/PrReviewService.cs`
- [RAG chat](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Chat/ArchitectureChatService.cs): `src/Tessera.Infrastructure/Chat/ArchitectureChatService.cs`
- [Semantic retrieval](https://github.com/rcarubbi/tessera/blob/main/src/Tessera.Infrastructure/Chat/RetrievalService.cs): `src/Tessera.Infrastructure/Chat/RetrievalService.cs`

### Dashboard experience

- [Web dashboard](https://github.com/rcarubbi/tessera/blob/main/web/app/page.tsx): `web/app/page.tsx`
- [Graph explorer](https://github.com/rcarubbi/tessera/blob/main/web/components/GraphView.tsx): `web/components/GraphView.tsx`
- [Chat panel](https://github.com/rcarubbi/tessera/blob/main/web/components/ChatPanel.tsx): `web/components/ChatPanel.tsx`
- [Snapshot diff](https://github.com/rcarubbi/tessera/blob/main/web/components/DiffView.tsx): `web/components/DiffView.tsx`
- [Review tools](https://github.com/rcarubbi/tessera/blob/main/web/components/ReviewPanel.tsx): `web/components/ReviewPanel.tsx`

### Other components

- **Engineer**
- **GitHub**
- **LLM provider**
- [Tree-sitter sidecar](https://github.com/rcarubbi/tessera/blob/main/analyzers/src/index.js): `analyzers/src/index.js`

## Connections

- Engineer → Web dashboard: uses (evidence: `README.md`)
- Web dashboard → Tessera API: requests data
- Tessera API → Authentication: authenticates (evidence: `src/Tessera.Api/TesseraAuthenticationHandler.cs`)
- GitHub → GitHub integration: sends webhooks (evidence: `README.md`)
- GitHub integration → Job processor: queues analysis
- Job processor → Repository analysis: processes jobs (evidence: `src/Tessera.Worker/Program.cs`)
- Repository analysis → Tree-sitter sidecar: parses sources
- Repository analysis → AI summarization: summarizes changes (evidence: `src/Tessera.Worker/Pipeline/AnalysisPipeline.cs`)
- LLM provider → AI summarization: provides completions (evidence: `README.md`)
- Repository analysis → Architecture linking: links architecture (evidence: `src/Tessera.Worker/Program.cs`)
- Repository analysis → Embedding generation: generates embeddings (evidence: `src/Tessera.Worker/Program.cs`)
- Repository analysis → Snapshot composition: composes snapshots (evidence: `src/Tessera.Worker/Pipeline/AnalysisPipeline.cs`)
- Snapshot composition → Tessera database: persists snapshot (evidence: `src/Tessera.Worker/Pipeline/AnalysisPipeline.cs`)
- Graph entities → Tessera database: stored as (evidence: `src/Tessera.Infrastructure/Data/TesseraDbContext.cs`)
- Graph queries → Tessera database: reads graph (evidence: `src/Tessera.Infrastructure/Queries/GraphQueryService.cs`)
- Tessera API → Graph queries: serves graph queries (evidence: `src/Tessera.Api/Program.cs`)
- Tessera API → Impact analysis: serves impact results (evidence: `src/Tessera.Api/Program.cs`)
- PR risk review → Graph queries: computes impact (evidence: `src/Tessera.Infrastructure/Reviews/PrReviewService.cs`)
- PR risk review → Architecture rules: checks violations (evidence: `src/Tessera.Infrastructure/Reviews/PrReviewService.cs`)
- RAG chat → Semantic retrieval: retrieves context
- Semantic retrieval → Tessera database: loads nodes (evidence: `src/Tessera.Infrastructure/Chat/RetrievalService.cs`)
- Tessera API → RAG chat: serves chat (evidence: `src/Tessera.Api/Program.cs`)
- Web dashboard → Graph explorer: renders graph (evidence: `README.md`)
- Web dashboard → Chat panel: offers chat (evidence: `README.md`)
- Web dashboard → Snapshot diff: shows diffs (evidence: `README.md`)
- Web dashboard → Review tools: supports review (evidence: `README.md`)
- Web dashboard → PR risk review: displays PR risk
- Web dashboard → Architecture rules: manages rules
