# nikhiltiwari1234/e.d.i.t.h architecture

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

- Interactive diagram: https://gitdiagram.com/nikhiltiwari1234/e.d.i.t.h
- Repository: https://github.com/nikhiltiwari1234/e.d.i.t.h

## Overview

This is a command-line desktop AI assistant: users enter prompts, the assistant sends them to a Gemini model, and model-requested tools can launch apps or search in the current app. On quit, it asks the model to extract durable memories and stores them through the memory engine. The AI engine also offers screen analysis, though the shown workflow does not call it. Memory retrieval and history support are present but commented out of the active prompt loop; source excerpts do not establish a working retrieval store setup.

Main entry points: [`brain/ai_engine.py`](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/ai_engine.py) (AI engine), [`assistant.py`](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/assistant.py) (Assistant loop), [`brain/executer.py`](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/executer.py) (Tool executor), [`brain/memory_engine.py`](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/memory_engine.py) (Memory engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User workflow"]
  node_main["CLI entry<br/>[main.py]"]
  node_assistant["Assistant loop<br/>[assistant.py]"]
end

subgraph group_intelligence["AI services"]
  node_ai["AI engine<br/>[ai_engine.py]"]
  node_executor["Tool executor<br/>[executer.py]"]
  node_config["Runtime config<br/>[config.py]"]
  node_screen["Screen analysis<br/>[ai_engine.py]"]
end

subgraph group_actions["Desktop actions"]
  node_launcher["App launcher<br/>[app_launcher.py]"]
  node_search["App search<br/>[search.py]"]
end

subgraph group_memory["Memory"]
  node_memory["Memory engine<br/>[memory_engine.py]"]
end

node_user(("User"))
node_gemini["Gemini API"]
node_desktop["Windows desktop"]
node_vector[("Chroma collection")]

node_user -->|"starts"| node_main
node_main -->|"runs"| node_assistant
node_assistant -->|"prompts"| node_user
node_assistant -->|"sends prompts"| node_ai
node_ai -->|"requests responses"| node_gemini
node_ai -->|"dispatches tools"| node_executor
node_executor -->|"loads by name"| node_launcher
node_executor -->|"loads by name"| node_search
node_launcher -->|"launches apps"| node_desktop
node_search -->|"types search"| node_desktop
node_assistant -->|"stores extracted memories"| node_memory
node_memory -->|"reads settings"| node_config
node_ai -->|"reads settings"| node_config
node_memory -->|"queries and updates"| node_vector
node_ai -->|"captures and analyzes"| node_screen
node_screen -->|"sends screenshot"| node_gemini

click node_main "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/main.py"
click node_assistant "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/assistant.py"
click node_ai "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/ai_engine.py"
click node_executor "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/executer.py"
click node_config "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/config.py"
click node_screen "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/ai_engine.py"
click node_launcher "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/actions/app_launcher.py"
click node_search "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/actions/search.py"
click node_memory "https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/memory_engine.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_main,node_assistant,node_user toneBlue
class node_ai,node_executor,node_config,node_screen,node_vector toneAmber
class node_launcher,node_search,node_gemini toneMint
class node_memory toneRose
class node_desktop toneIndigo
```

## Components

### User workflow

- [CLI entry](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/main.py): `main.py`
- [Assistant loop](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/assistant.py): `assistant.py`

### AI services

- [AI engine](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/ai_engine.py): `brain/ai_engine.py`
- [Tool executor](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/executer.py): `brain/executer.py`
- [Runtime config](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/config.py): `config.py`
- [Screen analysis](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/ai_engine.py): `brain/ai_engine.py`

### Desktop actions

- [App launcher](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/actions/app_launcher.py): `actions/app_launcher.py`
- [App search](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/actions/search.py): `actions/search.py`

### Memory

- [Memory engine](https://github.com/nikhiltiwari1234/e.d.i.t.h/blob/main/brain/memory_engine.py): `brain/memory_engine.py`

### Other components

- **User**
- **Gemini API**
- **Windows desktop**
- **Chroma collection**

## Connections

- User → CLI entry: starts (evidence: `main.py`)
- CLI entry → Assistant loop: runs (evidence: `main.py`)
- Assistant loop → User: prompts (evidence: `assistant.py`)
- Assistant loop → AI engine: sends prompts (evidence: `assistant.py`)
- AI engine → Gemini API: requests responses (evidence: `brain/ai_engine.py`)
- AI engine → Tool executor: dispatches tools (evidence: `brain/ai_engine.py`)
- Tool executor → App launcher: loads by name (evidence: `brain/executer.py`)
- Tool executor → App search: loads by name (evidence: `brain/executer.py`)
- App launcher → Windows desktop: launches apps (evidence: `actions/app_launcher.py`)
- App search → Windows desktop: types search (evidence: `actions/search.py`)
- Assistant loop → Memory engine: stores extracted memories (evidence: `assistant.py`)
- Memory engine → Runtime config: reads settings (evidence: `brain/memory_engine.py`)
- AI engine → Runtime config: reads settings (evidence: `brain/ai_engine.py`)
- Memory engine → Chroma collection: queries and updates (evidence: `brain/memory_engine.py`)
- AI engine → Screen analysis: captures and analyzes (evidence: `brain/ai_engine.py`)
- Screen analysis → Gemini API: sends screenshot (evidence: `brain/ai_engine.py`)
