# akanemo22/core_ai_agent architecture

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

- Interactive diagram: https://gitdiagram.com/akanemo22/core_ai_agent
- Repository: https://github.com/akanemo22/core_ai_agent

## Overview

This is a realtime AI mock-interview service with two browser frontends. The main workflow creates a session from candidate and job inputs, profiles them and prepares a retrieval-grounded plan, runs streamed interview turns, then evaluates evidence and produces a verdict report. A background control plane coordinates coverage and follow-up; durable session state and workspaces support recovery and inspection. The README describes several capabilities whose implementation was not sampled, so those relationships are shown only when documented or referenced in the source index.

Main entry points: [`api/routes.py`](https://github.com/akanemo22/core_ai_agent/blob/main/api/routes.py) (Session API), [`core/assessor/worker.py`](https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/worker.py) (Assessment workers), [`core/profiler/agent.py`](https://github.com/akanemo22/core_ai_agent/blob/main/core/profiler/agent.py) (Profile and plan), [`core/interview/controller.py`](https://github.com/akanemo22/core_ai_agent/blob/main/core/interview/controller.py) (Turn controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces and API"]
  node_fe_test["Interview frontend<br/>[app.js]"]
  node_fe_inspect["Inspection frontend<br/>[app.js]"]
  node_api["Session API<br/>[routes.py]"]
  node_api_app["Application lifecycle<br/>[main.py]"]
end

subgraph group_prepare["Preparation and retrieval"]
  node_profiler["Profile and plan<br/>[agent.py]"]
  node_documents["Document extraction<br/>[documents.py]"]
  node_knowledge["Interview knowledge<br/>[knowledge.py]"]
  node_rag["RAG engine<br/>[engine.py]"]
end

subgraph group_interview["Interview runtime"]
  node_controller["Turn controller<br/>[controller.py]"]
  node_runner["Interview runner<br/>[runner.py]"]
  node_speaker["Turn speaker<br/>[speaker.py]"]
  node_orchestrator["Control plane<br/>[orchestrator.py]"]
  node_runtime["Agent runtime<br/>[agent.py]"]
  node_provider["LLM provider contract<br/>[client.py]"]
end

subgraph group_assessment["Assessment and reporting"]
  node_assessment_queue["Assessment queue<br/>[queue.py]"]
  node_assessment_worker["Assessment workers<br/>[worker.py]"]
  node_evaluation["Criterion evaluation<br/>[evaluator.py]"]
  node_pipeline["Assessment barrier<br/>[pipeline.py]"]
  node_synthesizer["Verdict and report<br/>[synthesizer.py]"]
end

subgraph group_durability["Durability and inspection"]
  node_state[("Session state<br/>[state.py]")]
  node_workspace[("Session workspace<br/>[session.py]")]
  node_archive[("Artifact archive<br/>[archive.py]")]
  node_inspect_api["Trace inspection API<br/>[inspect.py]"]
  node_trace_store[("Trace store<br/>[store.py]")]
end

node_candidate(("Candidate"))

node_candidate -->|"provides inputs"| node_fe_test
node_fe_test -->|"starts sessions"| node_api
node_api -->|"extracts uploads"| node_documents
node_api -->|"starts profiling"| node_profiler
node_profiler -->|"retrieves knowledge"| node_knowledge
node_knowledge -->|"uses backend"| node_rag
node_api -->|"submits turns"| node_controller
node_controller -->|"runs turns"| node_runner
node_runner -->|"runs speaker"| node_speaker
node_runner -->|"coordinates control"| node_orchestrator
node_speaker -->|"generates responses"| node_runtime
node_orchestrator -->|"delegates agents"| node_runtime
node_runtime -->|"streams completions"| node_provider
node_api_app -->|"starts workers"| node_assessment_queue
node_assessment_worker -->|"claims jobs"| node_assessment_queue
node_assessment_worker -->|"evaluates criteria"| node_evaluation
node_assessment_worker -->|"signals completion"| node_pipeline
node_pipeline -->|"starts synthesis"| node_synthesizer
node_synthesizer -->|"archives artifacts"| node_archive
node_api -->|"updates lifecycle"| node_state
node_controller -->|"checks session state"| node_state
node_profiler -->|"reads and writes"| node_workspace
node_synthesizer -->|"uses evidence"| node_workspace
node_fe_inspect -->|"views traces"| node_inspect_api
node_inspect_api -->|"reads traces"| node_trace_store
node_trace_store -.->|"shares database layer"| node_state

click node_fe_test "https://github.com/akanemo22/core_ai_agent/blob/main/FE-test/app.js"
click node_fe_inspect "https://github.com/akanemo22/core_ai_agent/blob/main/FE-inspect/app.js"
click node_api "https://github.com/akanemo22/core_ai_agent/blob/main/api/routes.py"
click node_api_app "https://github.com/akanemo22/core_ai_agent/blob/main/api/main.py"
click node_profiler "https://github.com/akanemo22/core_ai_agent/blob/main/core/profiler/agent.py"
click node_documents "https://github.com/akanemo22/core_ai_agent/blob/main/core/profiler/documents.py"
click node_knowledge "https://github.com/akanemo22/core_ai_agent/blob/main/core/retrieval/knowledge.py"
click node_rag "https://github.com/akanemo22/core_ai_agent/blob/main/rag/engine.py"
click node_controller "https://github.com/akanemo22/core_ai_agent/blob/main/core/interview/controller.py"
click node_runner "https://github.com/akanemo22/core_ai_agent/blob/main/core/interview/runner.py"
click node_speaker "https://github.com/akanemo22/core_ai_agent/blob/main/core/interview/speaker.py"
click node_orchestrator "https://github.com/akanemo22/core_ai_agent/blob/main/core/orchestration/orchestrator.py"
click node_runtime "https://github.com/akanemo22/core_ai_agent/blob/main/core/runtime/agent.py"
click node_provider "https://github.com/akanemo22/core_ai_agent/blob/main/core/runtime/client.py"
click node_assessment_queue "https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/queue.py"
click node_assessment_worker "https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/worker.py"
click node_evaluation "https://github.com/akanemo22/core_ai_agent/blob/main/core/agents/evaluator.py"
click node_pipeline "https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/pipeline.py"
click node_synthesizer "https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/synthesizer.py"
click node_state "https://github.com/akanemo22/core_ai_agent/blob/main/core/session/state.py"
click node_workspace "https://github.com/akanemo22/core_ai_agent/blob/main/core/workspace/session.py"
click node_archive "https://github.com/akanemo22/core_ai_agent/blob/main/core/storage/archive.py"
click node_inspect_api "https://github.com/akanemo22/core_ai_agent/blob/main/api/inspect.py"
click node_trace_store "https://github.com/akanemo22/core_ai_agent/blob/main/fe_inspect/store.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_fe_test,node_fe_inspect,node_api,node_api_app toneBlue
class node_profiler,node_documents,node_knowledge,node_rag toneAmber
class node_controller,node_runner,node_speaker,node_orchestrator,node_runtime,node_provider toneMint
class node_assessment_queue,node_assessment_worker,node_evaluation,node_pipeline,node_synthesizer toneRose
class node_state,node_workspace,node_archive,node_inspect_api,node_trace_store,node_candidate toneIndigo
```

## Components

### User interfaces and API

- [Interview frontend](https://github.com/akanemo22/core_ai_agent/blob/main/FE-test/app.js): `FE-test/app.js`
- [Inspection frontend](https://github.com/akanemo22/core_ai_agent/blob/main/FE-inspect/app.js): `FE-inspect/app.js`
- [Session API](https://github.com/akanemo22/core_ai_agent/blob/main/api/routes.py): `api/routes.py`
- [Application lifecycle](https://github.com/akanemo22/core_ai_agent/blob/main/api/main.py): `api/main.py`

### Preparation and retrieval

- [Profile and plan](https://github.com/akanemo22/core_ai_agent/blob/main/core/profiler/agent.py): `core/profiler/agent.py`
- [Document extraction](https://github.com/akanemo22/core_ai_agent/blob/main/core/profiler/documents.py): `core/profiler/documents.py`
- [Interview knowledge](https://github.com/akanemo22/core_ai_agent/blob/main/core/retrieval/knowledge.py): `core/retrieval/knowledge.py`
- [RAG engine](https://github.com/akanemo22/core_ai_agent/blob/main/rag/engine.py): `rag/engine.py`

### Interview runtime

- [Turn controller](https://github.com/akanemo22/core_ai_agent/blob/main/core/interview/controller.py): `core/interview/controller.py`
- [Interview runner](https://github.com/akanemo22/core_ai_agent/blob/main/core/interview/runner.py): `core/interview/runner.py`
- [Turn speaker](https://github.com/akanemo22/core_ai_agent/blob/main/core/interview/speaker.py): `core/interview/speaker.py`
- [Control plane](https://github.com/akanemo22/core_ai_agent/blob/main/core/orchestration/orchestrator.py): `core/orchestration/orchestrator.py`
- [Agent runtime](https://github.com/akanemo22/core_ai_agent/blob/main/core/runtime/agent.py): `core/runtime/agent.py`
- [LLM provider contract](https://github.com/akanemo22/core_ai_agent/blob/main/core/runtime/client.py): `core/runtime/client.py`

### Assessment and reporting

- [Assessment queue](https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/queue.py): `core/assessor/queue.py`
- [Assessment workers](https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/worker.py): `core/assessor/worker.py`
- [Criterion evaluation](https://github.com/akanemo22/core_ai_agent/blob/main/core/agents/evaluator.py): `core/agents/evaluator.py`
- [Assessment barrier](https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/pipeline.py): `core/assessor/pipeline.py`
- [Verdict and report](https://github.com/akanemo22/core_ai_agent/blob/main/core/assessor/synthesizer.py): `core/assessor/synthesizer.py`

### Durability and inspection

- [Session state](https://github.com/akanemo22/core_ai_agent/blob/main/core/session/state.py): `core/session/state.py`
- [Session workspace](https://github.com/akanemo22/core_ai_agent/blob/main/core/workspace/session.py): `core/workspace/session.py`
- [Artifact archive](https://github.com/akanemo22/core_ai_agent/blob/main/core/storage/archive.py): `core/storage/archive.py`
- [Trace inspection API](https://github.com/akanemo22/core_ai_agent/blob/main/api/inspect.py): `api/inspect.py`
- [Trace store](https://github.com/akanemo22/core_ai_agent/blob/main/fe_inspect/store.py): `fe_inspect/store.py`

### Other components

- **Candidate**

## Connections

- Candidate → Interview frontend: provides inputs (evidence: `README.md`)
- Interview frontend → Session API: starts sessions (evidence: `README.md`)
- Session API → Document extraction: extracts uploads (evidence: `api/routes.py`)
- Session API → Profile and plan: starts profiling (evidence: `api/routes.py`)
- Profile and plan → Interview knowledge: retrieves knowledge (evidence: `core/profiler/agent.py`)
- Interview knowledge → RAG engine: uses backend (evidence: `README.md`)
- Session API → Turn controller: submits turns (evidence: `api/main.py`)
- Turn controller → Interview runner: runs turns (evidence: `core/interview/controller.py`)
- Interview runner → Turn speaker: runs speaker (evidence: `core/interview/runner.py`)
- Interview runner → Control plane: coordinates control (evidence: `core/interview/runner.py`)
- Turn speaker → Agent runtime: generates responses (evidence: `README.md`)
- Control plane → Agent runtime: delegates agents (evidence: `core/orchestration/orchestrator.py`)
- Agent runtime → LLM provider contract: streams completions (evidence: `core/runtime/agent.py`)
- Application lifecycle → Assessment queue: starts workers (evidence: `api/main.py`)
- Assessment workers → Assessment queue: claims jobs (evidence: `core/assessor/worker.py`)
- Assessment workers → Criterion evaluation: evaluates criteria (evidence: `core/assessor/worker.py`)
- Assessment workers → Assessment barrier: signals completion (evidence: `core/assessor/worker.py`)
- Assessment barrier → Verdict and report: starts synthesis (evidence: `core/assessor/pipeline.py`)
- Verdict and report → Artifact archive: archives artifacts (evidence: `core/assessor/synthesizer.py`)
- Session API → Session state: updates lifecycle (evidence: `api/routes.py`)
- Turn controller → Session state: checks session state (evidence: `core/interview/controller.py`)
- Profile and plan → Session workspace: reads and writes (evidence: `core/profiler/agent.py`)
- Verdict and report → Session workspace: uses evidence (evidence: `core/assessor/synthesizer.py`)
- Inspection frontend → Trace inspection API: views traces (evidence: `README.md`)
- Trace inspection API → Trace store: reads traces
- Trace store → Session state: shares database layer
