# yourikka/go_agent architecture

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

- Interactive diagram: https://gitdiagram.com/yourikka/go_agent
- Repository: https://github.com/yourikka/go_agent

## Overview

AI Agent Stack provides a browser extension backed by a REST gateway and RPC services for agent execution, retrieval-augmented memory, summarization, and configuration. The principal flow is a user query through the extension and gateway to the agent workflow, which can use RAG and summary services before returning an answer. The README documents additional document and memory administration features. Some subsystem links reflect documented architecture because their implementation was not sampled.

Main entry points: [`gateway/internal/handler/routes.go`](https://github.com/yourikka/go_agent/blob/main/gateway/internal/handler/routes.go) (REST gateway), [`apps/rag/internal/server/ragserver.go`](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/server/ragserver.go) (RAG service), [`apps/rag/internal/repository/chroma.go`](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/repository/chroma.go) (RAG repository), [`apps/agent/internal/logic/runlogic.go`](https://github.com/yourikka/go_agent/blob/main/apps/agent/internal/logic/runlogic.go) (Agent service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client and gateway"]
  node_extension["Browser extension<br/>[popup.ts]"]
  node_gateway["REST gateway<br/>[routes.go]"]
  node_agentlogic["Agent API logic<br/>[agentrunlogic.go]"]
  node_raglogic["RAG API logic"]
  node_summarylogic["Summary API logic<br/>[summarylogic.go]"]
  node_configlogic["Config API logic<br/>[configgetlogic.go]"]
end

subgraph group_agent["Agent workflow"]
  node_agentservice["Agent service<br/>[runlogic.go]"]
  node_langgraph["LangGraph workflow<br/>[main.py]"]
  node_agentllm["Chat model<br/>[main.py]"]
end

subgraph group_knowledge["RAG and memory"]
  node_ragservice["RAG service<br/>[ragserver.go]"]
  node_ingest["Document ingest"]
  node_retrieval["Hybrid retrieval<br/>[searchlogic.go]"]
  node_feedback["Memory feedback<br/>[feedbacklogic.go]"]
  node_repository["RAG repository<br/>[chroma.go]"]
  node_sqlite[("Local memory store<br/>[sqlite.go]")]
  node_chroma[("Chroma vector store<br/>[chroma.go]")]
end

subgraph group_support["Summary and configuration"]
  node_summaryservice["Summary service<br/>[summarizelogic.go]"]
  node_summarymodel["Summary LLM client<br/>[client.go]"]
  node_configservice["Config service<br/>[configlogic.go]"]
  node_configstore[("Encrypted config store<br/>[store.go]")]
end

node_user(("User"))
node_openai["OpenAI-compatible API"]

node_user -->|"submits query"| node_extension
node_extension -->|"sends REST request"| node_gateway
node_gateway -->|"routes agent requests"| node_agentlogic
node_gateway -->|"routes RAG requests"| node_raglogic
node_gateway -->|"routes summaries"| node_summarylogic
node_gateway -->|"routes config requests"| node_configlogic
node_agentlogic -->|"calls RPC"| node_agentservice
node_agentservice -->|"posts workflow request"| node_langgraph
node_langgraph -.->|"classifies and answers"| node_agentllm
node_agentllm -.->|"requests completion"| node_openai
node_agentservice -->|"calls retrieval RPC"| node_ragservice
node_agentservice -->|"calls summary RPC"| node_summaryservice
node_raglogic -->|"calls RAG RPC"| node_ragservice
node_summarylogic -->|"calls summary RPC"| node_summaryservice
node_configlogic -->|"calls config RPC"| node_configservice
node_ragservice -->|"dispatches ingest"| node_ingest
node_ragservice -->|"dispatches search"| node_retrieval
node_ragservice -->|"dispatches feedback"| node_feedback
node_ingest -->|"writes documents"| node_repository
node_retrieval -->|"searches memories"| node_repository
node_feedback -->|"updates memory weights"| node_repository
node_repository -->|"reads and writes"| node_sqlite
node_repository -.->|"vector search"| node_chroma
node_summaryservice -->|"summarizes content"| node_summarymodel
node_summarymodel -.->|"requests completion"| node_openai
node_configservice -->|"reads and writes"| node_configstore

click node_extension "https://github.com/yourikka/go_agent/blob/main/extension/src/popup.ts"
click node_gateway "https://github.com/yourikka/go_agent/blob/main/gateway/internal/handler/routes.go"
click node_agentlogic "https://github.com/yourikka/go_agent/blob/main/gateway/internal/logic/agentrunlogic.go"
click node_raglogic "https://github.com/yourikka/go_agent/blob/main/gateway/internal/logic/searchdocumentlogic.go"
click node_summarylogic "https://github.com/yourikka/go_agent/blob/main/gateway/internal/logic/summarylogic.go"
click node_configlogic "https://github.com/yourikka/go_agent/blob/main/gateway/internal/logic/configgetlogic.go"
click node_agentservice "https://github.com/yourikka/go_agent/blob/main/apps/agent/internal/logic/runlogic.go"
click node_langgraph "https://github.com/yourikka/go_agent/blob/main/apps/agent/langgraph/main.py"
click node_agentllm "https://github.com/yourikka/go_agent/blob/main/apps/agent/langgraph/main.py"
click node_ragservice "https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/server/ragserver.go"
click node_ingest "https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/logic/adddocumentlogic.go"
click node_retrieval "https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/logic/searchlogic.go"
click node_feedback "https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/logic/feedbacklogic.go"
click node_repository "https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/repository/chroma.go"
click node_sqlite "https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/repository/sqlite.go"
click node_chroma "https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/repository/chroma.go"
click node_summaryservice "https://github.com/yourikka/go_agent/blob/main/apps/summary/internal/logic/summarizelogic.go"
click node_summarymodel "https://github.com/yourikka/go_agent/blob/main/apps/summary/internal/llm/client.go"
click node_configservice "https://github.com/yourikka/go_agent/blob/main/apps/config/internal/logic/configlogic.go"
click node_configstore "https://github.com/yourikka/go_agent/blob/main/apps/config/internal/store/store.go"

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_extension,node_gateway,node_agentlogic,node_raglogic,node_summarylogic,node_configlogic,node_user toneBlue
class node_agentservice,node_langgraph,node_agentllm toneAmber
class node_ragservice,node_ingest,node_retrieval,node_feedback,node_repository,node_sqlite,node_chroma,node_openai toneMint
class node_summaryservice,node_summarymodel,node_configservice,node_configstore toneRose
```

## Components

### Client and gateway

- [Browser extension](https://github.com/yourikka/go_agent/blob/main/extension/src/popup.ts): `extension/src/popup.ts`
- [REST gateway](https://github.com/yourikka/go_agent/blob/main/gateway/internal/handler/routes.go): `gateway/internal/handler/routes.go`
- [Agent API logic](https://github.com/yourikka/go_agent/blob/main/gateway/internal/logic/agentrunlogic.go): `gateway/internal/logic/agentrunlogic.go`
- [RAG API logic](https://github.com/yourikka/go_agent/blob/main/gateway/internal/logic/searchdocumentlogic.go): `gateway/internal/logic/searchdocumentlogic.go`
- [Summary API logic](https://github.com/yourikka/go_agent/blob/main/gateway/internal/logic/summarylogic.go): `gateway/internal/logic/summarylogic.go`
- [Config API logic](https://github.com/yourikka/go_agent/blob/main/gateway/internal/logic/configgetlogic.go): `gateway/internal/logic/configgetlogic.go`

### Agent workflow

- [Agent service](https://github.com/yourikka/go_agent/blob/main/apps/agent/internal/logic/runlogic.go): `apps/agent/internal/logic/runlogic.go`
- [LangGraph workflow](https://github.com/yourikka/go_agent/blob/main/apps/agent/langgraph/main.py): `apps/agent/langgraph/main.py`
- [Chat model](https://github.com/yourikka/go_agent/blob/main/apps/agent/langgraph/main.py): `apps/agent/langgraph/main.py`

### RAG and memory

- [RAG service](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/server/ragserver.go): `apps/rag/internal/server/ragserver.go`
- [Document ingest](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/logic/adddocumentlogic.go): `apps/rag/internal/logic/adddocumentlogic.go`
- [Hybrid retrieval](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/logic/searchlogic.go): `apps/rag/internal/logic/searchlogic.go`
- [Memory feedback](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/logic/feedbacklogic.go): `apps/rag/internal/logic/feedbacklogic.go`
- [RAG repository](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/repository/chroma.go): `apps/rag/internal/repository/chroma.go`
- [Local memory store](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/repository/sqlite.go): `apps/rag/internal/repository/sqlite.go`
- [Chroma vector store](https://github.com/yourikka/go_agent/blob/main/apps/rag/internal/repository/chroma.go): `apps/rag/internal/repository/chroma.go`

### Summary and configuration

- [Summary service](https://github.com/yourikka/go_agent/blob/main/apps/summary/internal/logic/summarizelogic.go): `apps/summary/internal/logic/summarizelogic.go`
- [Summary LLM client](https://github.com/yourikka/go_agent/blob/main/apps/summary/internal/llm/client.go): `apps/summary/internal/llm/client.go`
- [Config service](https://github.com/yourikka/go_agent/blob/main/apps/config/internal/logic/configlogic.go): `apps/config/internal/logic/configlogic.go`
- [Encrypted config store](https://github.com/yourikka/go_agent/blob/main/apps/config/internal/store/store.go): `apps/config/internal/store/store.go`

### Other components

- **User**
- **OpenAI-compatible API**

## Connections

- User → Browser extension: submits query
- Browser extension → REST gateway: sends REST request
- REST gateway → Agent API logic: routes agent requests
- REST gateway → RAG API logic: routes RAG requests
- REST gateway → Summary API logic: routes summaries
- REST gateway → Config API logic: routes config requests
- Agent API logic → Agent service: calls RPC
- Agent service → LangGraph workflow: posts workflow request
- LangGraph workflow → Chat model: classifies and answers
- Chat model → OpenAI-compatible API: requests completion
- Agent service → RAG service: calls retrieval RPC
- Agent service → Summary service: calls summary RPC
- RAG API logic → RAG service: calls RAG RPC
- Summary API logic → Summary service: calls summary RPC
- Config API logic → Config service: calls config RPC
- RAG service → Document ingest: dispatches ingest
- RAG service → Hybrid retrieval: dispatches search
- RAG service → Memory feedback: dispatches feedback
- Document ingest → RAG repository: writes documents
- Hybrid retrieval → RAG repository: searches memories
- Memory feedback → RAG repository: updates memory weights
- RAG repository → Local memory store: reads and writes
- RAG repository → Chroma vector store: vector search
- Summary service → Summary LLM client: summarizes content
- Summary LLM client → OpenAI-compatible API: requests completion
- Config service → Encrypted config store: reads and writes
