# laibaparvaiz/techmate architecture

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

- Interactive diagram: https://gitdiagram.com/laibaparvaiz/techmate
- Repository: https://github.com/laibaparvaiz/techmate

## Overview

TechMate is a Streamlit multi-agent study and coding assistant. A user message enters the supervisor, which handles pending confirmations or routes the request to a study, mentor, or coding specialist; the response is returned through the UI. Study answers can use uploaded-document retrieval, grading, web fallback, and verification. Write-capable actions are proposed before execution. The graph preserves documented capabilities even where implementation was not sampled; those links cite the README rather than implying source inspection.

Main entry points: [`app/agents/supervisor.py`](https://github.com/laibaparvaiz/techmate/blob/master/app/agents/supervisor.py) (Supervisor graph), [`app/agents/study_agent.py`](https://github.com/laibaparvaiz/techmate/blob/master/app/agents/study_agent.py) (Study agent), [`app/ui/streaming.py`](https://github.com/laibaparvaiz/techmate/blob/master/app/ui/streaming.py) (Streamlit interface), [`app/agents/coding_agent.py`](https://github.com/laibaparvaiz/techmate/blob/master/app/agents/coding_agent.py) (Coding agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Conversation and routing"]
  node_ui["Streamlit interface<br/>[streaming.py]"]
  node_supervisor["Supervisor graph<br/>[supervisor.py]"]
end

subgraph group_agents["Specialist agents"]
  node_study_agent["Study agent<br/>[study_agent.py]"]
  node_mentor["Mentor agent<br/>[mentor_agent.py]"]
  node_coding["Coding agent<br/>[coding_agent.py]"]
  node_summarizer["Conversation summarizer<br/>[summarizer.py]"]
end

subgraph group_study["Study and retrieval"]
  node_study_tools["Study tools<br/>[study_tools.py]"]
  node_ingestion["Document ingestion<br/>[ingestion.py]"]
  node_faiss[("FAISS index<br/>[ingestion.py]")]
  node_retrieval["Chunk retrieval<br/>[retrieval.py]"]
  node_web["Web search<br/>[web_search.py]"]
end

subgraph group_actions["Tools and safeguards"]
  node_code_tools["Code tools<br/>[code_tools.py]"]
  node_pdf_tools["PDF tools<br/>[pdf_tools.py]"]
  node_system_tools["System tools<br/>[system_tools.py]"]
  node_hitl["Pending actions<br/>[hitl.py]"]
  node_permissions["Path permissions<br/>[permissions.py]"]
  node_privacy["Privacy redaction<br/>[privacy.py]"]
end

subgraph group_state["Memory and providers"]
  node_memory["Conversation memory<br/>[memory.py]"]
  node_skills["Weak-area tracking<br/>[skills.py]"]
  node_db[("PostgreSQL state<br/>[models.py]")]
  node_sessions["Session records<br/>[sessions.py]"]
  node_llm["LLM fallback router<br/>[llm_router.py]"]
  node_budget["Context budgeting<br/>[context_budget.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_user(("User"))

node_user -->|"sends message"| node_ui
node_ui -->|"submits turn"| node_supervisor
node_ui -->|"indexes upload"| node_ingestion
node_supervisor -->|"routes study"| node_study_agent
node_supervisor -->|"routes mentor"| node_mentor
node_supervisor -->|"routes coding"| node_coding
node_supervisor -->|"checks action"| node_hitl
node_supervisor -->|"compresses history"| node_summarizer
node_supervisor -->|"loads weaknesses"| node_skills
node_supervisor -->|"redacts responses"| node_privacy
node_study_agent -->|"retrieves context"| node_retrieval
node_study_agent -->|"uses study tools"| node_study_tools
node_study_agent -.->|"falls back web"| node_web
node_study_agent -->|"invokes models"| node_llm
node_study_agent -->|"caps context"| node_budget
node_retrieval -->|"searches index"| node_faiss
node_ingestion -->|"writes index"| node_faiss
node_mentor -->|"uses tools"| node_code_tools
node_mentor -->|"uses tools"| node_system_tools
node_mentor -->|"invokes models"| node_llm
node_coding -->|"uses tools"| node_code_tools
node_coding -->|"uses tools"| node_system_tools
node_coding -->|"uses PDF tools"| node_pdf_tools
node_coding -->|"invokes models"| node_llm
node_code_tools -->|"validates paths"| node_permissions
node_code_tools -->|"registers proposals"| node_hitl
node_code_tools -->|"redacts content"| node_privacy
node_pdf_tools -->|"validates paths"| node_permissions
node_pdf_tools -->|"registers proposals"| node_hitl
node_study_tools -->|"checks permissions"| node_permissions
node_study_tools -->|"registers proposals"| node_hitl
node_system_tools -->|"checks permissions"| node_permissions
node_memory -->|"checkpoints state"| node_db
node_summarizer -->|"invokes models"| node_llm
node_skills -->|"stores weak areas"| node_db
node_sessions -->|"stores sessions"| node_db
node_ui -->|"loads memory"| node_memory
node_ui -->|"manages sessions"| node_sessions
node_llm -->|"reads providers"| node_config
node_db -->|"reads database settings"| node_config

click node_ui "https://github.com/laibaparvaiz/techmate/blob/master/app/ui/streaming.py"
click node_supervisor "https://github.com/laibaparvaiz/techmate/blob/master/app/agents/supervisor.py"
click node_study_agent "https://github.com/laibaparvaiz/techmate/blob/master/app/agents/study_agent.py"
click node_mentor "https://github.com/laibaparvaiz/techmate/blob/master/app/agents/mentor_agent.py"
click node_coding "https://github.com/laibaparvaiz/techmate/blob/master/app/agents/coding_agent.py"
click node_summarizer "https://github.com/laibaparvaiz/techmate/blob/master/app/agents/summarizer.py"
click node_study_tools "https://github.com/laibaparvaiz/techmate/blob/master/app/tools/study_tools.py"
click node_ingestion "https://github.com/laibaparvaiz/techmate/blob/master/app/rag/ingestion.py"
click node_faiss "https://github.com/laibaparvaiz/techmate/blob/master/app/rag/ingestion.py"
click node_retrieval "https://github.com/laibaparvaiz/techmate/blob/master/app/rag/retrieval.py"
click node_web "https://github.com/laibaparvaiz/techmate/blob/master/app/tools/web_search.py"
click node_code_tools "https://github.com/laibaparvaiz/techmate/blob/master/app/tools/code_tools.py"
click node_pdf_tools "https://github.com/laibaparvaiz/techmate/blob/master/app/tools/pdf_tools.py"
click node_system_tools "https://github.com/laibaparvaiz/techmate/blob/master/app/tools/system_tools.py"
click node_hitl "https://github.com/laibaparvaiz/techmate/blob/master/app/safety/hitl.py"
click node_permissions "https://github.com/laibaparvaiz/techmate/blob/master/app/safety/permissions.py"
click node_privacy "https://github.com/laibaparvaiz/techmate/blob/master/app/safety/privacy.py"
click node_memory "https://github.com/laibaparvaiz/techmate/blob/master/app/memory/memory.py"
click node_skills "https://github.com/laibaparvaiz/techmate/blob/master/app/memory/skills.py"
click node_db "https://github.com/laibaparvaiz/techmate/blob/master/app/database/models.py"
click node_sessions "https://github.com/laibaparvaiz/techmate/blob/master/app/sessions.py"
click node_llm "https://github.com/laibaparvaiz/techmate/blob/master/app/utils/llm_router.py"
click node_budget "https://github.com/laibaparvaiz/techmate/blob/master/app/utils/context_budget.py"
click node_config "https://github.com/laibaparvaiz/techmate/blob/master/app/config.py"

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_ui,node_supervisor,node_user toneBlue
class node_study_agent,node_mentor,node_coding,node_summarizer toneAmber
class node_study_tools,node_ingestion,node_faiss,node_retrieval,node_web toneMint
class node_code_tools,node_pdf_tools,node_system_tools,node_hitl,node_permissions,node_privacy toneRose
class node_memory,node_skills,node_db,node_sessions,node_llm,node_budget,node_config toneIndigo
```

## Components

### Conversation and routing

- [Streamlit interface](https://github.com/laibaparvaiz/techmate/blob/master/app/ui/streaming.py): `app/ui/streaming.py`
- [Supervisor graph](https://github.com/laibaparvaiz/techmate/blob/master/app/agents/supervisor.py): `app/agents/supervisor.py`

### Specialist agents

- [Study agent](https://github.com/laibaparvaiz/techmate/blob/master/app/agents/study_agent.py): `app/agents/study_agent.py`
- [Mentor agent](https://github.com/laibaparvaiz/techmate/blob/master/app/agents/mentor_agent.py): `app/agents/mentor_agent.py`
- [Coding agent](https://github.com/laibaparvaiz/techmate/blob/master/app/agents/coding_agent.py): `app/agents/coding_agent.py`
- [Conversation summarizer](https://github.com/laibaparvaiz/techmate/blob/master/app/agents/summarizer.py): `app/agents/summarizer.py`

### Study and retrieval

- [Study tools](https://github.com/laibaparvaiz/techmate/blob/master/app/tools/study_tools.py): `app/tools/study_tools.py`
- [Document ingestion](https://github.com/laibaparvaiz/techmate/blob/master/app/rag/ingestion.py): `app/rag/ingestion.py`
- [FAISS index](https://github.com/laibaparvaiz/techmate/blob/master/app/rag/ingestion.py): `app/rag/ingestion.py`
- [Chunk retrieval](https://github.com/laibaparvaiz/techmate/blob/master/app/rag/retrieval.py): `app/rag/retrieval.py`
- [Web search](https://github.com/laibaparvaiz/techmate/blob/master/app/tools/web_search.py): `app/tools/web_search.py`

### Tools and safeguards

- [Code tools](https://github.com/laibaparvaiz/techmate/blob/master/app/tools/code_tools.py): `app/tools/code_tools.py`
- [PDF tools](https://github.com/laibaparvaiz/techmate/blob/master/app/tools/pdf_tools.py): `app/tools/pdf_tools.py`
- [System tools](https://github.com/laibaparvaiz/techmate/blob/master/app/tools/system_tools.py): `app/tools/system_tools.py`
- [Pending actions](https://github.com/laibaparvaiz/techmate/blob/master/app/safety/hitl.py): `app/safety/hitl.py`
- [Path permissions](https://github.com/laibaparvaiz/techmate/blob/master/app/safety/permissions.py): `app/safety/permissions.py`
- [Privacy redaction](https://github.com/laibaparvaiz/techmate/blob/master/app/safety/privacy.py): `app/safety/privacy.py`

### Memory and providers

- [Conversation memory](https://github.com/laibaparvaiz/techmate/blob/master/app/memory/memory.py): `app/memory/memory.py`
- [Weak-area tracking](https://github.com/laibaparvaiz/techmate/blob/master/app/memory/skills.py): `app/memory/skills.py`
- [PostgreSQL state](https://github.com/laibaparvaiz/techmate/blob/master/app/database/models.py): `app/database/models.py`
- [Session records](https://github.com/laibaparvaiz/techmate/blob/master/app/sessions.py): `app/sessions.py`
- [LLM fallback router](https://github.com/laibaparvaiz/techmate/blob/master/app/utils/llm_router.py): `app/utils/llm_router.py`
- [Context budgeting](https://github.com/laibaparvaiz/techmate/blob/master/app/utils/context_budget.py): `app/utils/context_budget.py`
- [Runtime configuration](https://github.com/laibaparvaiz/techmate/blob/master/app/config.py): `app/config.py`

### Other components

- **User**

## Connections

- User → Streamlit interface: sends message (evidence: `README.md`)
- Streamlit interface → Supervisor graph: submits turn (evidence: `app/ui/streaming.py`)
- Streamlit interface → Document ingestion: indexes upload (evidence: `app/ui/streaming.py`)
- Supervisor graph → Study agent: routes study (evidence: `app/agents/supervisor.py`)
- Supervisor graph → Mentor agent: routes mentor (evidence: `app/agents/supervisor.py`)
- Supervisor graph → Coding agent: routes coding (evidence: `app/agents/supervisor.py`)
- Supervisor graph → Pending actions: checks action (evidence: `app/agents/supervisor.py`)
- Supervisor graph → Conversation summarizer: compresses history (evidence: `app/agents/supervisor.py`)
- Supervisor graph → Weak-area tracking: loads weaknesses (evidence: `app/agents/supervisor.py`)
- Supervisor graph → Privacy redaction: redacts responses (evidence: `app/agents/supervisor.py`)
- Study agent → Chunk retrieval: retrieves context (evidence: `app/agents/study_agent.py`)
- Study agent → Study tools: uses study tools (evidence: `app/agents/study_agent.py`)
- Study agent → Web search: falls back web (evidence: `README.md`)
- Study agent → LLM fallback router: invokes models (evidence: `app/agents/study_agent.py`)
- Study agent → Context budgeting: caps context (evidence: `app/agents/study_agent.py`)
- Chunk retrieval → FAISS index: searches index (evidence: `app/rag/retrieval.py`)
- Document ingestion → FAISS index: writes index (evidence: `app/rag/ingestion.py`)
- Mentor agent → Code tools: uses tools (evidence: `app/agents/mentor_agent.py`)
- Mentor agent → System tools: uses tools (evidence: `app/agents/mentor_agent.py`)
- Mentor agent → LLM fallback router: invokes models (evidence: `app/agents/mentor_agent.py`)
- Coding agent → Code tools: uses tools (evidence: `app/agents/coding_agent.py`)
- Coding agent → System tools: uses tools (evidence: `app/agents/coding_agent.py`)
- Coding agent → PDF tools: uses PDF tools (evidence: `app/agents/coding_agent.py`)
- Coding agent → LLM fallback router: invokes models (evidence: `app/agents/coding_agent.py`)
- Code tools → Path permissions: validates paths (evidence: `app/tools/code_tools.py`)
- Code tools → Pending actions: registers proposals (evidence: `app/tools/code_tools.py`)
- Code tools → Privacy redaction: redacts content (evidence: `app/tools/code_tools.py`)
- PDF tools → Path permissions: validates paths (evidence: `app/tools/pdf_tools.py`)
- PDF tools → Pending actions: registers proposals (evidence: `app/tools/pdf_tools.py`)
- Study tools → Path permissions: checks permissions (evidence: `app/tools/study_tools.py`)
- Study tools → Pending actions: registers proposals (evidence: `app/tools/study_tools.py`)
- System tools → Path permissions: checks permissions (evidence: `app/tools/system_tools.py`)
- Conversation memory → PostgreSQL state: checkpoints state (evidence: `README.md`)
- Conversation summarizer → LLM fallback router: invokes models (evidence: `app/agents/summarizer.py`)
- Weak-area tracking → PostgreSQL state: stores weak areas (evidence: `app/memory/skills.py`)
- Session records → PostgreSQL state: stores sessions (evidence: `app/sessions.py`)
- Streamlit interface → Conversation memory: loads memory (evidence: `app/ui/streaming.py`)
- Streamlit interface → Session records: manages sessions (evidence: `app/ui/streaming.py`)
- LLM fallback router → Runtime configuration: reads providers (evidence: `app/utils/llm_router.py`)
- PostgreSQL state → Runtime configuration: reads database settings (evidence: `app/database/models.py`)
