# staks-sor/ai-free architecture

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

- Interactive diagram: https://gitdiagram.com/staks-sor/ai-free
- Repository: https://github.com/staks-sor/ai-free

## Overview

AI Free is a local developer AI client that exposes DeepSeek, Qwen, and ChatGPT through desktop, CLI, compatible API, and IDE interfaces. A typical coding task enters through an interface, is enriched with project instructions, memory, and skills by the agent orchestrator, then runs through the code agent against the selected provider and workspace. The graph preserves documented memory, browser, voice, and integration capabilities; unsampled implementation details and their internal wiring are not inferred.

Main entry points: [`src/agent-orchestrator/index.mjs`](https://github.com/staks-sor/ai-free/blob/main/src/agent-orchestrator/index.mjs) (Agent orchestrator), [`api/server.mjs`](https://github.com/staks-sor/ai-free/blob/main/api/server.mjs) (Compatible API), [`src/window-app/server.mjs`](https://github.com/staks-sor/ai-free/blob/main/src/window-app/server.mjs) (Desktop app), [`src/providers/deepseek/client.mjs`](https://github.com/staks-sor/ai-free/blob/main/src/providers/deepseek/client.mjs) (DeepSeek client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_desktop["Desktop app<br/>[server.mjs]"]
  node_cli["CLI<br/>[run.mjs]"]
  node_compat_api["Compatible API<br/>[server.mjs]"]
end

subgraph group_agent["Agent workflow"]
  node_orchestrator["Agent orchestrator<br/>[index.mjs]"]
  node_code_agent["Code agent<br/>[run.mjs]"]
  node_instructions["Project instructions"]
  node_skills["Skills<br/>[skill-matcher.mjs]"]
end

subgraph group_providers["AI providers"]
  node_deepseek["DeepSeek client<br/>[client.mjs]"]
  node_qwen["Qwen client<br/>[client.mjs]"]
  node_chatgpt["ChatGPT provider<br/>[client.mjs]"]
  node_provider_services(("AI web providers"))
end

subgraph group_context["Context and memory"]
  node_memory[("Long-term memory<br/>[store.mjs]")]
  node_memory_graph[("Memory graph<br/>[store.mjs]")]
end

subgraph group_integrations["Integrations"]
  node_acp["ACP server<br/>[server.mjs]"]
  node_browser["Browser automation<br/>[service.mjs]"]
  node_stt["Voice input<br/>[service.mjs]"]
  node_telegram["Telegram workflows<br/>[bot.mjs]"]
  node_ide(("IDE tools"))
end

node_developer(("Developer"))

node_developer -->|"uses"| node_desktop
node_developer -->|"uses"| node_cli
node_developer -->|"connects tools"| node_compat_api
node_developer -->|"uses"| node_ide
node_desktop -->|"dispatches tasks"| node_orchestrator
node_acp -->|"runs tasks"| node_orchestrator
node_orchestrator -->|"runs task"| node_code_agent
node_orchestrator -->|"assembles context"| node_instructions
node_orchestrator -->|"assembles context"| node_memory
node_orchestrator -->|"adds graph context"| node_memory_graph
node_orchestrator -->|"matches skills"| node_skills
node_compat_api -->|"calls"| node_deepseek
node_compat_api -->|"calls"| node_qwen
node_compat_api -->|"calls"| node_chatgpt
node_deepseek -->|"sends requests"| node_provider_services
node_qwen -->|"sends requests"| node_provider_services
node_chatgpt -->|"sends requests"| node_provider_services
node_developer -->|"automates browsing"| node_browser
node_developer -->|"dictates input"| node_stt
node_developer -->|"uses workflows"| node_telegram
node_ide -->|"calls API"| node_compat_api
node_ide -->|"uses ACP"| node_acp

click node_desktop "https://github.com/staks-sor/ai-free/blob/main/src/window-app/server.mjs"
click node_cli "https://github.com/staks-sor/ai-free/blob/main/src/cli/run.mjs"
click node_compat_api "https://github.com/staks-sor/ai-free/blob/main/api/server.mjs"
click node_acp "https://github.com/staks-sor/ai-free/blob/main/src/acp/server.mjs"
click node_orchestrator "https://github.com/staks-sor/ai-free/blob/main/src/agent-orchestrator/index.mjs"
click node_code_agent "https://github.com/staks-sor/ai-free/blob/main/src/code-agent/run.mjs"
click node_instructions "https://github.com/staks-sor/ai-free/blob/main/src/agent-orchestrator/project-instructions.mjs"
click node_skills "https://github.com/staks-sor/ai-free/blob/main/src/skills/skill-matcher.mjs"
click node_deepseek "https://github.com/staks-sor/ai-free/blob/main/src/providers/deepseek/client.mjs"
click node_qwen "https://github.com/staks-sor/ai-free/blob/main/src/providers/qwen/client.mjs"
click node_chatgpt "https://github.com/staks-sor/ai-free/blob/main/src/providers/chatgpt/client.mjs"
click node_memory "https://github.com/staks-sor/ai-free/blob/main/src/memory/store.mjs"
click node_memory_graph "https://github.com/staks-sor/ai-free/blob/main/src/memory/graph/store.mjs"
click node_browser "https://github.com/staks-sor/ai-free/blob/main/src/browser/service.mjs"
click node_stt "https://github.com/staks-sor/ai-free/blob/main/src/stt/service.mjs"
click node_telegram "https://github.com/staks-sor/ai-free/blob/main/src/telegram/bot.mjs"

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_desktop,node_cli,node_compat_api toneBlue
class node_orchestrator,node_code_agent,node_instructions,node_skills toneAmber
class node_deepseek,node_qwen,node_chatgpt,node_provider_services toneMint
class node_memory,node_memory_graph toneRose
class node_acp,node_browser,node_stt,node_telegram,node_ide,node_developer toneIndigo
```

## Components

### User interfaces

- [Desktop app](https://github.com/staks-sor/ai-free/blob/main/src/window-app/server.mjs): `src/window-app/server.mjs`
- [CLI](https://github.com/staks-sor/ai-free/blob/main/src/cli/run.mjs): `src/cli/run.mjs`
- [Compatible API](https://github.com/staks-sor/ai-free/blob/main/api/server.mjs): `api/server.mjs`

### Agent workflow

- [Agent orchestrator](https://github.com/staks-sor/ai-free/blob/main/src/agent-orchestrator/index.mjs): `src/agent-orchestrator/index.mjs`
- [Code agent](https://github.com/staks-sor/ai-free/blob/main/src/code-agent/run.mjs): `src/code-agent/run.mjs`
- [Project instructions](https://github.com/staks-sor/ai-free/blob/main/src/agent-orchestrator/project-instructions.mjs): `src/agent-orchestrator/project-instructions.mjs`
- [Skills](https://github.com/staks-sor/ai-free/blob/main/src/skills/skill-matcher.mjs): `src/skills/skill-matcher.mjs`

### AI providers

- [DeepSeek client](https://github.com/staks-sor/ai-free/blob/main/src/providers/deepseek/client.mjs): `src/providers/deepseek/client.mjs`
- [Qwen client](https://github.com/staks-sor/ai-free/blob/main/src/providers/qwen/client.mjs): `src/providers/qwen/client.mjs`
- [ChatGPT provider](https://github.com/staks-sor/ai-free/blob/main/src/providers/chatgpt/client.mjs): `src/providers/chatgpt/client.mjs`
- **AI web providers**

### Context and memory

- [Long-term memory](https://github.com/staks-sor/ai-free/blob/main/src/memory/store.mjs): `src/memory/store.mjs`
- [Memory graph](https://github.com/staks-sor/ai-free/blob/main/src/memory/graph/store.mjs): `src/memory/graph/store.mjs`

### Integrations

- [ACP server](https://github.com/staks-sor/ai-free/blob/main/src/acp/server.mjs): `src/acp/server.mjs`
- [Browser automation](https://github.com/staks-sor/ai-free/blob/main/src/browser/service.mjs): `src/browser/service.mjs`
- [Voice input](https://github.com/staks-sor/ai-free/blob/main/src/stt/service.mjs): `src/stt/service.mjs`
- [Telegram workflows](https://github.com/staks-sor/ai-free/blob/main/src/telegram/bot.mjs): `src/telegram/bot.mjs`
- **IDE tools**

### Other components

- **Developer**

## Connections

- Developer → Desktop app: uses (evidence: `README.md`)
- Developer → CLI: uses (evidence: `README.md`)
- Developer → Compatible API: connects tools (evidence: `README.md`)
- Developer → IDE tools: uses (evidence: `README.md`)
- Desktop app → Agent orchestrator: dispatches tasks (evidence: `src/window-app/server.mjs`)
- ACP server → Agent orchestrator: runs tasks (evidence: `src/acp/server.mjs`)
- Agent orchestrator → Code agent: runs task (evidence: `src/agent-orchestrator/index.mjs`)
- Agent orchestrator → Project instructions: assembles context (evidence: `README.md`)
- Agent orchestrator → Long-term memory: assembles context (evidence: `README.md`)
- Agent orchestrator → Memory graph: adds graph context (evidence: `README.md`)
- Agent orchestrator → Skills: matches skills (evidence: `src/agent-orchestrator/index.mjs`)
- Compatible API → DeepSeek client: calls
- Compatible API → Qwen client: calls
- Compatible API → ChatGPT provider: calls
- DeepSeek client → AI web providers: sends requests (evidence: `README.md`)
- Qwen client → AI web providers: sends requests (evidence: `README.md`)
- ChatGPT provider → AI web providers: sends requests (evidence: `README.md`)
- Developer → Browser automation: automates browsing (evidence: `README.md`)
- Developer → Voice input: dictates input (evidence: `README.md`)
- Developer → Telegram workflows: uses workflows (evidence: `README.md`)
- IDE tools → Compatible API: calls API (evidence: `README.md`)
- IDE tools → ACP server: uses ACP (evidence: `README.md`)
