# phk006/neura-ai- architecture

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

- Interactive diagram: https://gitdiagram.com/phk006/neura-ai-
- Repository: https://github.com/phk006/neura-ai-

## Overview

NEURA AI is a personal assistant workspace: a signed-in user makes a natural-language request, the server routes it to an AI agent, the agent can use connected tools and gated approvals, and task results and activity are persisted and shown in the workspace. The README also documents voice, memory and uploads, connected apps, and activity history; scheduled automations are explicitly not implemented. Unsampled feature links are shown only where documented, so some internal wiring is omitted.

Main entry points: [`client/src/App.tsx`](https://github.com/phk006/neura-ai-/blob/main/client/src/App.tsx) (App and routes), [`server/repos.ts`](https://github.com/phk006/neura-ai-/blob/main/server/repos.ts) (Workspace repositories), [`server/ai/engine.ts`](https://github.com/phk006/neura-ai-/blob/main/server/ai/engine.ts) (Task engine), [`server/tools/registry.ts`](https://github.com/phk006/neura-ai-/blob/main/server/tools/registry.ts) (Tool registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_app["App and routes<br/>[App.tsx]"]
  node_assistant["Assistant chat<br/>[Assistant.tsx]"]
  node_voice["Voice control<br/>[Voice.tsx]"]
  node_automation["Automation workspace<br/>[Automations.tsx]"]
  node_apps["Connected apps<br/>[Apps.tsx]"]
  node_memoryui["Memory workspace<br/>[Memory.tsx]"]
  node_activityui["Activity history<br/>[Activity.tsx]"]
end

subgraph group_agent["Agent runtime"]
  node_agentapi["Agent endpoints<br/>[agentRoutes.ts]"]
  node_engine["Task engine<br/>[engine.ts]"]
  node_router["Intent router<br/>[router.ts]"]
  node_model["Model client<br/>[llm.ts]"]
  node_approval["Approval workflow<br/>[routers.ts]"]
end

subgraph group_tools["Tools and integrations"]
  node_registry["Tool registry<br/>[registry.ts]"]
  node_toolsets["Tool implementations<br/>[index.ts]"]
  node_providers["Provider connections<br/>[providers.ts]"]
  node_http["Provider HTTP client<br/>[http.ts]"]
  node_memorytools["Memory and document tools<br/>[memory.ts]"]
  node_externaltools["External service tools<br/>[external.ts]"]
  node_googletools["Google tools<br/>[google.ts]"]
end

subgraph group_data["User data"]
  node_repos["Workspace repositories<br/>[repos.ts]"]
  node_supabase[("Supabase workspace data<br/>[supabase.ts]")]
  node_uploads["File uploads<br/>[files.ts]"]
end

subgraph group_platform["Platform services"]
  node_auth["Authentication<br/>[auth.tsx]"]
end

node_user(("User"))
node_modelservice{{"Model service"}}
node_connectedservices{{"Connected providers"}}

node_user -->|"uses"| node_app
node_app -->|"checks session"| node_auth
node_app -->|"routes to"| node_assistant
node_app -->|"routes to"| node_voice
node_app -->|"routes to"| node_automation
node_app -->|"routes to"| node_apps
node_app -->|"routes to"| node_memoryui
node_app -->|"routes to"| node_activityui
node_assistant -->|"submits tasks"| node_agentapi
node_voice -.->|"provides voice input"| node_assistant
node_apps -.->|"manages connections"| node_approval
node_memoryui -.->|"manages memories"| node_repos
node_activityui -.->|"reads task history"| node_repos
node_agentapi -->|"runs agent"| node_engine
node_agentapi -->|"stores uploads"| node_uploads
node_agentapi -->|"logs activity"| node_repos
node_engine -->|"routes request"| node_router
node_engine -->|"streams chat"| node_model
node_router -->|"requests structured route"| node_model
node_engine -->|"selects tools"| node_registry
node_toolsets -->|"registers tools"| node_registry
node_registry -->|"gets access token"| node_providers
node_registry -->|"sends provider requests"| node_http
node_providers -->|"saves connections"| node_repos
node_providers -->|"requests provider API"| node_http
node_memorytools -->|"reads and writes memory"| node_repos
node_externaltools -->|"defines tools"| node_registry
node_googletools -->|"defines tools"| node_registry
node_engine -->|"persists task data"| node_repos
node_approval -->|"cancels task"| node_engine
node_repos -.->|"reads and writes"| node_supabase
node_model -->|"calls model endpoint"| node_modelservice
node_http -.->|"calls provider APIs"| node_connectedservices

click node_app "https://github.com/phk006/neura-ai-/blob/main/client/src/App.tsx"
click node_assistant "https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Assistant.tsx"
click node_voice "https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Voice.tsx"
click node_automation "https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Automations.tsx"
click node_apps "https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Apps.tsx"
click node_memoryui "https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Memory.tsx"
click node_activityui "https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Activity.tsx"
click node_agentapi "https://github.com/phk006/neura-ai-/blob/main/server/agentRoutes.ts"
click node_engine "https://github.com/phk006/neura-ai-/blob/main/server/ai/engine.ts"
click node_router "https://github.com/phk006/neura-ai-/blob/main/server/ai/router.ts"
click node_model "https://github.com/phk006/neura-ai-/blob/main/server/ai/llm.ts"
click node_approval "https://github.com/phk006/neura-ai-/blob/main/server/routers.ts"
click node_registry "https://github.com/phk006/neura-ai-/blob/main/server/tools/registry.ts"
click node_toolsets "https://github.com/phk006/neura-ai-/blob/main/server/tools/index.ts"
click node_providers "https://github.com/phk006/neura-ai-/blob/main/server/integrations/providers.ts"
click node_http "https://github.com/phk006/neura-ai-/blob/main/server/integrations/http.ts"
click node_memorytools "https://github.com/phk006/neura-ai-/blob/main/server/tools/memory.ts"
click node_externaltools "https://github.com/phk006/neura-ai-/blob/main/server/tools/external.ts"
click node_googletools "https://github.com/phk006/neura-ai-/blob/main/server/tools/google.ts"
click node_repos "https://github.com/phk006/neura-ai-/blob/main/server/repos.ts"
click node_supabase "https://github.com/phk006/neura-ai-/blob/main/server/supabase.ts"
click node_uploads "https://github.com/phk006/neura-ai-/blob/main/server/files.ts"
click node_auth "https://github.com/phk006/neura-ai-/blob/main/client/src/lib/auth.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_app,node_assistant,node_voice,node_automation,node_apps,node_memoryui,node_activityui,node_user toneBlue
class node_agentapi,node_engine,node_router,node_model,node_approval toneAmber
class node_registry,node_toolsets,node_providers,node_http,node_memorytools,node_externaltools,node_googletools toneMint
class node_repos,node_supabase,node_uploads toneRose
class node_auth,node_modelservice,node_connectedservices toneIndigo
```

## Components

### Workspace

- [App and routes](https://github.com/phk006/neura-ai-/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Assistant chat](https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Assistant.tsx): `client/src/pages/Assistant.tsx`
- [Voice control](https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Voice.tsx): `client/src/pages/Voice.tsx`
- [Automation workspace](https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Automations.tsx): `client/src/pages/Automations.tsx`
- [Connected apps](https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Apps.tsx): `client/src/pages/Apps.tsx`
- [Memory workspace](https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Memory.tsx): `client/src/pages/Memory.tsx`
- [Activity history](https://github.com/phk006/neura-ai-/blob/main/client/src/pages/Activity.tsx): `client/src/pages/Activity.tsx`

### Agent runtime

- [Agent endpoints](https://github.com/phk006/neura-ai-/blob/main/server/agentRoutes.ts): `server/agentRoutes.ts`
- [Task engine](https://github.com/phk006/neura-ai-/blob/main/server/ai/engine.ts): `server/ai/engine.ts`
- [Intent router](https://github.com/phk006/neura-ai-/blob/main/server/ai/router.ts): `server/ai/router.ts`
- [Model client](https://github.com/phk006/neura-ai-/blob/main/server/ai/llm.ts): `server/ai/llm.ts`
- [Approval workflow](https://github.com/phk006/neura-ai-/blob/main/server/routers.ts): `server/routers.ts`

### Tools and integrations

- [Tool registry](https://github.com/phk006/neura-ai-/blob/main/server/tools/registry.ts): `server/tools/registry.ts`
- [Tool implementations](https://github.com/phk006/neura-ai-/blob/main/server/tools/index.ts): `server/tools/index.ts`
- [Provider connections](https://github.com/phk006/neura-ai-/blob/main/server/integrations/providers.ts): `server/integrations/providers.ts`
- [Provider HTTP client](https://github.com/phk006/neura-ai-/blob/main/server/integrations/http.ts): `server/integrations/http.ts`
- [Memory and document tools](https://github.com/phk006/neura-ai-/blob/main/server/tools/memory.ts): `server/tools/memory.ts`
- [External service tools](https://github.com/phk006/neura-ai-/blob/main/server/tools/external.ts): `server/tools/external.ts`
- [Google tools](https://github.com/phk006/neura-ai-/blob/main/server/tools/google.ts): `server/tools/google.ts`

### User data

- [Workspace repositories](https://github.com/phk006/neura-ai-/blob/main/server/repos.ts): `server/repos.ts`
- [Supabase workspace data](https://github.com/phk006/neura-ai-/blob/main/server/supabase.ts): `server/supabase.ts`
- [File uploads](https://github.com/phk006/neura-ai-/blob/main/server/files.ts): `server/files.ts`

### Platform services

- [Authentication](https://github.com/phk006/neura-ai-/blob/main/client/src/lib/auth.tsx): `client/src/lib/auth.tsx`

### Other components

- **User**
- **Model service**
- **Connected providers**

## Connections

- User → App and routes: uses
- App and routes → Authentication: checks session (evidence: `client/src/App.tsx`)
- App and routes → Assistant chat: routes to (evidence: `client/src/App.tsx`)
- App and routes → Voice control: routes to (evidence: `client/src/App.tsx`)
- App and routes → Automation workspace: routes to (evidence: `client/src/App.tsx`)
- App and routes → Connected apps: routes to (evidence: `client/src/App.tsx`)
- App and routes → Memory workspace: routes to (evidence: `client/src/App.tsx`)
- App and routes → Activity history: routes to (evidence: `client/src/App.tsx`)
- Assistant chat → Agent endpoints: submits tasks
- Voice control → Assistant chat: provides voice input
- Connected apps → Approval workflow: manages connections (evidence: `client/src/pages/Apps.tsx`)
- Memory workspace → Workspace repositories: manages memories
- Activity history → Workspace repositories: reads task history
- Agent endpoints → Task engine: runs agent (evidence: `server/agentRoutes.ts`)
- Agent endpoints → File uploads: stores uploads (evidence: `server/agentRoutes.ts`)
- Agent endpoints → Workspace repositories: logs activity (evidence: `server/agentRoutes.ts`)
- Task engine → Intent router: routes request (evidence: `server/ai/engine.ts`)
- Task engine → Model client: streams chat (evidence: `server/ai/engine.ts`)
- Intent router → Model client: requests structured route (evidence: `server/ai/router.ts`)
- Task engine → Tool registry: selects tools (evidence: `server/ai/engine.ts`)
- Tool implementations → Tool registry: registers tools (evidence: `server/tools/index.ts`)
- Tool registry → Provider connections: gets access token (evidence: `server/tools/registry.ts`)
- Tool registry → Provider HTTP client: sends provider requests (evidence: `server/tools/registry.ts`)
- Provider connections → Workspace repositories: saves connections (evidence: `server/integrations/providers.ts`)
- Provider connections → Provider HTTP client: requests provider API (evidence: `server/integrations/providers.ts`)
- Memory and document tools → Workspace repositories: reads and writes memory (evidence: `server/tools/memory.ts`)
- External service tools → Tool registry: defines tools (evidence: `server/tools/index.ts`)
- Google tools → Tool registry: defines tools (evidence: `server/tools/index.ts`)
- Task engine → Workspace repositories: persists task data (evidence: `server/ai/engine.ts`)
- Approval workflow → Task engine: cancels task (evidence: `server/routers.ts`)
- Workspace repositories → Supabase workspace data: reads and writes (evidence: `server/repos.ts`)
- Model client → Model service: calls model endpoint (evidence: `server/ai/llm.ts`)
- Provider HTTP client → Connected providers: calls provider APIs
