# djoahp/logassist architecture

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

- Interactive diagram: https://gitdiagram.com/djoahp/logassist
- Repository: https://github.com/djoahp/logassist

## Overview

LogAssist is a Tauri desktop AI assistant. The main workflow runs from the user composing a chat turn, through context preparation and a configured LLM provider, to streamed, persisted and rendered replies; optional MCP/Web and GitHub tools extend that turn. SQLite holds conversations and knowledge, while API credentials stay in the Windows credential store. The graph retains documented settings, recovery, export and security-related capabilities. Source excerpts limit certainty about some runtime wiring, so undocumented links are omitted.

Main entry points: [`src/hooks/useChat.ts`](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/hooks/useChat.ts) (Turn orchestration), [`src/lib/chat/prepareConversationContext.ts`](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/chat/prepareConversationContext.ts) (Context preparation), [`src/App.tsx`](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/App.tsx) (Desktop shell), [`src/components/chat/ChatView.tsx`](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/chat/ChatView.tsx) (Chat interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation experience"]
  node_app["Desktop shell<br/>[App.tsx]"]
  node_chat_ui["Chat interface<br/>[ChatView.tsx]"]
  node_input_ui["Message composer<br/>[InputBar.tsx]"]
  node_chat_turn["Turn orchestration<br/>[useChat.ts]"]
  node_conversation_ui["Conversation navigation<br/>[Sidebar.tsx]"]
end

subgraph group_model_context["Models and context"]
  node_provider_settings["Provider settings"]
  node_model_adapter["LLM adapters<br/>[openai-compat.ts]"]
  node_context_prep["Context preparation"]
  node_context_planner["Context planning<br/>[contextPlanner.ts]"]
  node_knowledge_retrieval["Knowledge retrieval"]
  node_prompt_settings["Prompt settings<br/>[store.ts]"]
  node_token_metrics["Token metrics<br/>[estimate.ts]"]
end

subgraph group_integrations["Tools and integrations"]
  node_mcp_settings["MCP and Web settings<br/>[McpDialog.tsx]"]
  node_mcp_runtime["MCP runtime<br/>[runtime.ts]"]
  node_mcp_tool_agent["Tool agent<br/>[toolAgent.ts]"]
  node_mcp_ipc["MCP IPC client<br/>[client.ts]"]
  node_mcp_backend["MCP service<br/>[client.rs]"]
  node_mcp_transport["MCP transport<br/>[transport.rs]"]
  node_github_ui["GitHub connector UI"]
  node_github_client["GitHub IPC client<br/>[client.ts]"]
  node_github_service["GitHub service<br/>[service.rs]"]
end

subgraph group_persistence["Persistence and security"]
  node_sqlite[("SQLite database<br/>[database.ts]")]
  node_conversation_store["Conversation storage<br/>[conversations.ts]"]
  node_knowledge_store["Knowledge storage<br/>[knowledge.ts]"]
  node_message_store["Message storage<br/>[messages.ts]"]
  node_credentials[("Credential Manager")]
  node_export["Markdown export<br/>[export.ts]"]
end

node_user(("User"))
node_external_llm{{"LLM provider"}}
node_web_service{{"TinyFish Web"}}
node_github_api{{"GitHub API"}}

node_user -->|"uses"| node_app
node_app -->|"shows"| node_chat_ui
node_app -->|"shows"| node_conversation_ui
node_user -->|"composes"| node_input_ui
node_input_ui -->|"submits"| node_chat_turn
node_chat_ui -->|"renders"| node_chat_turn
node_chat_turn -->|"prepares context"| node_context_prep
node_context_prep -->|"plans tokens"| node_context_planner
node_context_prep -->|"retrieves passages"| node_knowledge_retrieval
node_context_prep -->|"loads prompts"| node_prompt_settings
node_context_prep -->|"loads knowledge"| node_knowledge_store
node_chat_turn -->|"creates provider"| node_model_adapter
node_chat_turn -->|"streams request"| node_external_llm
node_external_llm -->|"streams response"| node_chat_turn
node_chat_turn -->|"persists messages"| node_message_store
node_chat_turn -->|"updates conversation"| node_conversation_store
node_chat_ui -->|"formats metrics"| node_token_metrics
node_provider_settings -->|"configures access"| node_external_llm
node_chat_turn -->|"uses tools"| node_mcp_runtime
node_mcp_runtime -->|"calls"| node_mcp_ipc
node_mcp_ipc -->|"invokes commands"| node_mcp_backend
node_mcp_backend -->|"delegates connections"| node_mcp_transport
node_mcp_transport -.->|"calls"| node_web_service
node_chat_turn -->|"dispatches tools"| node_mcp_tool_agent
node_mcp_tool_agent -->|"requests tool decisions"| node_external_llm
node_mcp_settings -.->|"configures"| node_mcp_runtime
node_chat_turn -->|"calls connector tools"| node_github_client
node_github_ui -.->|"configures connector"| node_github_client
node_github_client -->|"invokes commands"| node_github_service
node_github_service -->|"reads repository"| node_github_api
node_conversation_store -->|"reads and writes"| node_sqlite
node_knowledge_store -.->|"reads and writes"| node_sqlite
node_message_store -.->|"reads and writes"| node_sqlite
node_app -->|"loads conversations"| node_conversation_store
node_chat_turn -.->|"loads provider key"| node_credentials
node_github_service -.->|"uses GitHub token"| node_credentials
node_chat_turn -.->|"exports conversation"| node_export

click node_app "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/App.tsx"
click node_chat_ui "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/chat/ChatView.tsx"
click node_input_ui "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/chat/InputBar.tsx"
click node_chat_turn "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/hooks/useChat.ts"
click node_conversation_ui "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/sidebar/Sidebar.tsx"
click node_provider_settings "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/settings/ProvidersDialog.tsx"
click node_model_adapter "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/ai/openai-compat.ts"
click node_context_prep "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/chat/prepareConversationContext.ts"
click node_context_planner "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/context/contextPlanner.ts"
click node_knowledge_retrieval "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/context/knowledgeRetriever.ts"
click node_prompt_settings "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/prompts/store.ts"
click node_token_metrics "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/token/estimate.ts"
click node_mcp_settings "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/settings/McpDialog.tsx"
click node_mcp_runtime "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/mcp/runtime.ts"
click node_mcp_tool_agent "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/mcp/toolAgent.ts"
click node_mcp_ipc "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/mcp/client.ts"
click node_mcp_backend "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src-tauri/src/mcp/client.rs"
click node_mcp_transport "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src-tauri/src/mcp/transport.rs"
click node_github_ui "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/settings/GithubConnectorDialog.tsx"
click node_github_client "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/connectors/client.ts"
click node_github_service "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src-tauri/src/connectors/service.rs"
click node_sqlite "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/db/database.ts"
click node_conversation_store "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/db/conversations.ts"
click node_knowledge_store "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/db/knowledge.ts"
click node_message_store "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/db/messages.ts"
click node_export "https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/export.ts"

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_chat_ui,node_input_ui,node_chat_turn,node_conversation_ui,node_user toneBlue
class node_provider_settings,node_model_adapter,node_context_prep,node_context_planner,node_knowledge_retrieval,node_prompt_settings,node_token_metrics toneAmber
class node_mcp_settings,node_mcp_runtime,node_mcp_tool_agent,node_mcp_ipc,node_mcp_backend,node_mcp_transport,node_github_ui,node_github_client,node_github_service,node_github_api toneMint
class node_sqlite,node_conversation_store,node_knowledge_store,node_message_store,node_credentials,node_export toneRose
class node_external_llm,node_web_service toneIndigo
```

## Components

### Conversation experience

- [Desktop shell](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/App.tsx): `src/App.tsx`
- [Chat interface](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/chat/ChatView.tsx): `src/components/chat/ChatView.tsx`
- [Message composer](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/chat/InputBar.tsx): `src/components/chat/InputBar.tsx`
- [Turn orchestration](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/hooks/useChat.ts): `src/hooks/useChat.ts`
- [Conversation navigation](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/sidebar/Sidebar.tsx): `src/components/sidebar/Sidebar.tsx`

### Models and context

- [Provider settings](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/settings/ProvidersDialog.tsx): `src/components/settings/ProvidersDialog.tsx`
- [LLM adapters](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/ai/openai-compat.ts): `src/lib/ai/openai-compat.ts`
- [Context preparation](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/chat/prepareConversationContext.ts): `src/lib/chat/prepareConversationContext.ts`
- [Context planning](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/context/contextPlanner.ts): `src/lib/context/contextPlanner.ts`
- [Knowledge retrieval](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/context/knowledgeRetriever.ts): `src/lib/context/knowledgeRetriever.ts`
- [Prompt settings](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/prompts/store.ts): `src/lib/prompts/store.ts`
- [Token metrics](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/token/estimate.ts): `src/lib/token/estimate.ts`

### Tools and integrations

- [MCP and Web settings](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/settings/McpDialog.tsx): `src/components/settings/McpDialog.tsx`
- [MCP runtime](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/mcp/runtime.ts): `src/lib/mcp/runtime.ts`
- [Tool agent](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/mcp/toolAgent.ts): `src/lib/mcp/toolAgent.ts`
- [MCP IPC client](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/mcp/client.ts): `src/lib/mcp/client.ts`
- [MCP service](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src-tauri/src/mcp/client.rs): `src-tauri/src/mcp/client.rs`
- [MCP transport](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src-tauri/src/mcp/transport.rs): `src-tauri/src/mcp/transport.rs`
- [GitHub connector UI](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/components/settings/GithubConnectorDialog.tsx): `src/components/settings/GithubConnectorDialog.tsx`
- [GitHub IPC client](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/connectors/client.ts): `src/lib/connectors/client.ts`
- [GitHub service](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src-tauri/src/connectors/service.rs): `src-tauri/src/connectors/service.rs`

### Persistence and security

- [SQLite database](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/db/database.ts): `src/lib/db/database.ts`
- [Conversation storage](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/db/conversations.ts): `src/lib/db/conversations.ts`
- [Knowledge storage](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/db/knowledge.ts): `src/lib/db/knowledge.ts`
- [Message storage](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/db/messages.ts): `src/lib/db/messages.ts`
- **Credential Manager**
- [Markdown export](https://github.com/djoahp/logassist/blob/feat/m1-socle-chat/src/lib/export.ts): `src/lib/export.ts`

### Other components

- **User**
- **LLM provider**
- **TinyFish Web**
- **GitHub API**

## Connections

- User → Desktop shell: uses
- Desktop shell → Chat interface: shows (evidence: `src/App.tsx`)
- Desktop shell → Conversation navigation: shows (evidence: `src/App.tsx`)
- User → Message composer: composes
- Message composer → Turn orchestration: submits (evidence: `src/components/chat/InputBar.tsx`)
- Chat interface → Turn orchestration: renders (evidence: `src/components/chat/ChatView.tsx`)
- Turn orchestration → Context preparation: prepares context (evidence: `src/hooks/useChat.ts`)
- Context preparation → Context planning: plans tokens (evidence: `src/lib/chat/prepareConversationContext.ts`)
- Context preparation → Knowledge retrieval: retrieves passages (evidence: `src/lib/chat/prepareConversationContext.ts`)
- Context preparation → Prompt settings: loads prompts (evidence: `src/lib/chat/prepareConversationContext.ts`)
- Context preparation → Knowledge storage: loads knowledge (evidence: `src/lib/chat/prepareConversationContext.ts`)
- Turn orchestration → LLM adapters: creates provider (evidence: `src/hooks/useChat.ts`)
- Turn orchestration → LLM provider: streams request
- LLM provider → Turn orchestration: streams response
- Turn orchestration → Message storage: persists messages (evidence: `src/hooks/useChat.ts`)
- Turn orchestration → Conversation storage: updates conversation (evidence: `src/hooks/useChat.ts`)
- Chat interface → Token metrics: formats metrics (evidence: `src/components/chat/ChatView.tsx`)
- Provider settings → LLM provider: configures access
- Turn orchestration → MCP runtime: uses tools (evidence: `src/hooks/useChat.ts`)
- MCP runtime → MCP IPC client: calls (evidence: `src/lib/mcp/runtime.ts`)
- MCP IPC client → MCP service: invokes commands (evidence: `src/lib/mcp/client.ts`)
- MCP service → MCP transport: delegates connections (evidence: `src-tauri/src/mcp/client.rs`)
- MCP transport → TinyFish Web: calls
- Turn orchestration → Tool agent: dispatches tools (evidence: `src/hooks/useChat.ts`)
- Tool agent → LLM provider: requests tool decisions (evidence: `src/lib/mcp/toolAgent.ts`)
- MCP and Web settings → MCP runtime: configures
- Turn orchestration → GitHub IPC client: calls connector tools (evidence: `src/hooks/useChat.ts`)
- GitHub connector UI → GitHub IPC client: configures connector
- GitHub IPC client → GitHub service: invokes commands (evidence: `src/lib/connectors/client.ts`)
- GitHub service → GitHub API: reads repository (evidence: `src-tauri/src/connectors/service.rs`)
- Conversation storage → SQLite database: reads and writes (evidence: `src/lib/db/conversations.ts`)
- Knowledge storage → SQLite database: reads and writes
- Message storage → SQLite database: reads and writes
- Desktop shell → Conversation storage: loads conversations (evidence: `src/App.tsx`)
- Turn orchestration → Credential Manager: loads provider key
- GitHub service → Credential Manager: uses GitHub token
- Turn orchestration → Markdown export: exports conversation
