# marker-inc-korea/autorag architecture

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

- Interactive diagram: https://gitdiagram.com/marker-inc-korea/autorag
- Repository: https://github.com/marker-inc-korea/autorag

## Overview

AutoRAG Agent is a self-evolving librarian for searching documents in place, verifying evidence, and returning curated findings; the repository also retains the legacy Python AutoRAG tool, which is not the main product mapped here. The documented workflow consults memory, searches through multiple retrieval methods, applies access controls and merges results, then directly reads promising sources and emits findings. The graph preserves the documented MinSync, Jikji, datasource, web, Lite, and feedback capabilities. Several subsystem links follow README descriptions because their implementation was not sampled.

Main entry points: [`src/agent/agent.ts`](https://github.com/marker-inc-korea/autorag/blob/main/src/agent/agent.ts) (Librarian Agent), [`src/retrieval/engine.ts`](https://github.com/marker-inc-korea/autorag/blob/main/src/retrieval/engine.ts) (Retrieval Engine), [`src/datasource/skills/factory.ts`](https://github.com/marker-inc-korea/autorag/blob/main/src/datasource/skills/factory.ts) (Datasource Skills), [`src/cli/index.ts`](https://github.com/marker-inc-korea/autorag/blob/main/src/cli/index.ts) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Entry"]
  node_cli["CLI<br/>[index.ts]"]
  node_agent["Librarian Agent<br/>[agent.ts]"]
  node_memory[("Evolving Memory<br/>[memory.ts]")]
end

subgraph group_retrieval["Retrieval"]
  node_retrieval_engine["Retrieval Engine<br/>[engine.ts]"]
  node_retrieval_registry["Method Registry<br/>[registry.ts]"]
  node_minsync["MinSync Search<br/>[client.ts]"]
  node_jikji["Jikji Discovery<br/>[client.ts]"]
end

subgraph group_sources["Data Sources"]
  node_datasource_skills["Datasource Skills<br/>[factory.ts]"]
  node_crawler["Crawler Client<br/>[crawler-client.ts]"]
  node_mirror["Document Mirror<br/>[sync.ts]"]
  node_parser["Document Parser<br/>[index.ts]"]
end

subgraph group_runtime["Local Runtime"]
  node_embedding_runtime["Embedding Gateway<br/>[index.ts]"]
  node_lite_commands["Lite Commands<br/>[lite.ts]"]
end

subgraph group_research["Research &amp; Feedback"]
  node_bash_tool["Direct Evidence Read<br/>[bash-tool.ts]"]
  node_web_tools["Web Search &amp; Fetch<br/>[web-search-tool.ts]"]
  node_feedback["Feedback<br/>[feedback.ts]"]
  node_results["Curated Findings"]
end

node_user(("User"))
node_local_files[("Local Documents")]
node_external_sources["External Data Sources"]

node_user -->|"asks"| node_agent
node_user -->|"runs command"| node_cli
node_cli -->|"dispatches"| node_lite_commands
node_agent -->|"consults"| node_memory
node_agent -->|"searches"| node_retrieval_engine
node_retrieval_engine -->|"selects methods"| node_retrieval_registry
node_retrieval_engine -->|"queries"| node_minsync
node_retrieval_engine -->|"queries"| node_datasource_skills
node_agent -->|"discovers"| node_jikji
node_datasource_skills -->|"invokes"| node_crawler
node_crawler -->|"searches"| node_external_sources
node_external_sources -->|"returns hits"| node_datasource_skills
node_minsync -->|"uses embeddings"| node_embedding_runtime
node_mirror -->|"parses documents"| node_parser
node_local_files -->|"syncs documents"| node_mirror
node_agent -->|"reads evidence"| node_bash_tool
node_bash_tool -->|"opens sources"| node_local_files
node_agent -->|"researches web"| node_web_tools
node_agent -->|"emits findings"| node_results
node_user -->|"provides feedback"| node_feedback
node_feedback -->|"records outcomes"| node_memory
node_lite_commands -->|"retrieves"| node_retrieval_engine

click node_cli "https://github.com/marker-inc-korea/autorag/blob/main/src/cli/index.ts"
click node_agent "https://github.com/marker-inc-korea/autorag/blob/main/src/agent/agent.ts"
click node_memory "https://github.com/marker-inc-korea/autorag/blob/main/src/memory/memory.ts"
click node_retrieval_engine "https://github.com/marker-inc-korea/autorag/blob/main/src/retrieval/engine.ts"
click node_retrieval_registry "https://github.com/marker-inc-korea/autorag/blob/main/src/retrieval/registry.ts"
click node_minsync "https://github.com/marker-inc-korea/autorag/blob/main/src/minsync/client.ts"
click node_jikji "https://github.com/marker-inc-korea/autorag/blob/main/src/jikji/client.ts"
click node_datasource_skills "https://github.com/marker-inc-korea/autorag/blob/main/src/datasource/skills/factory.ts"
click node_crawler "https://github.com/marker-inc-korea/autorag/blob/main/src/datasource/crawler-client.ts"
click node_mirror "https://github.com/marker-inc-korea/autorag/blob/main/src/mirror/sync.ts"
click node_parser "https://github.com/marker-inc-korea/autorag/blob/main/src/parser/index.ts"
click node_embedding_runtime "https://github.com/marker-inc-korea/autorag/blob/main/src/embedding-runtime/index.ts"
click node_lite_commands "https://github.com/marker-inc-korea/autorag/blob/main/src/cli/commands/lite.ts"
click node_bash_tool "https://github.com/marker-inc-korea/autorag/blob/main/src/agent/bash-tool.ts"
click node_web_tools "https://github.com/marker-inc-korea/autorag/blob/main/src/agent/web-search-tool.ts"
click node_feedback "https://github.com/marker-inc-korea/autorag/blob/main/src/cli/commands/feedback.ts"
click node_results "https://github.com/marker-inc-korea/autorag/blob/main/src/agent/emit-results-tool.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_cli,node_agent,node_memory,node_user toneBlue
class node_retrieval_engine,node_retrieval_registry,node_minsync,node_jikji,node_local_files toneAmber
class node_datasource_skills,node_crawler,node_mirror,node_parser toneMint
class node_embedding_runtime,node_lite_commands toneRose
class node_bash_tool,node_web_tools,node_feedback,node_results,node_external_sources toneIndigo
```

## Components

### User Entry

- [CLI](https://github.com/marker-inc-korea/autorag/blob/main/src/cli/index.ts): `src/cli/index.ts`
- [Librarian Agent](https://github.com/marker-inc-korea/autorag/blob/main/src/agent/agent.ts): `src/agent/agent.ts`
- [Evolving Memory](https://github.com/marker-inc-korea/autorag/blob/main/src/memory/memory.ts): `src/memory/memory.ts`

### Retrieval

- [Retrieval Engine](https://github.com/marker-inc-korea/autorag/blob/main/src/retrieval/engine.ts): `src/retrieval/engine.ts`
- [Method Registry](https://github.com/marker-inc-korea/autorag/blob/main/src/retrieval/registry.ts): `src/retrieval/registry.ts`
- [MinSync Search](https://github.com/marker-inc-korea/autorag/blob/main/src/minsync/client.ts): `src/minsync/client.ts`
- [Jikji Discovery](https://github.com/marker-inc-korea/autorag/blob/main/src/jikji/client.ts): `src/jikji/client.ts`

### Data Sources

- [Datasource Skills](https://github.com/marker-inc-korea/autorag/blob/main/src/datasource/skills/factory.ts): `src/datasource/skills/factory.ts`
- [Crawler Client](https://github.com/marker-inc-korea/autorag/blob/main/src/datasource/crawler-client.ts): `src/datasource/crawler-client.ts`
- [Document Mirror](https://github.com/marker-inc-korea/autorag/blob/main/src/mirror/sync.ts): `src/mirror/sync.ts`
- [Document Parser](https://github.com/marker-inc-korea/autorag/blob/main/src/parser/index.ts): `src/parser/index.ts`

### Local Runtime

- [Embedding Gateway](https://github.com/marker-inc-korea/autorag/blob/main/src/embedding-runtime/index.ts): `src/embedding-runtime/index.ts`
- [Lite Commands](https://github.com/marker-inc-korea/autorag/blob/main/src/cli/commands/lite.ts): `src/cli/commands/lite.ts`

### Research & Feedback

- [Direct Evidence Read](https://github.com/marker-inc-korea/autorag/blob/main/src/agent/bash-tool.ts): `src/agent/bash-tool.ts`
- [Web Search & Fetch](https://github.com/marker-inc-korea/autorag/blob/main/src/agent/web-search-tool.ts): `src/agent/web-search-tool.ts`
- [Feedback](https://github.com/marker-inc-korea/autorag/blob/main/src/cli/commands/feedback.ts): `src/cli/commands/feedback.ts`
- [Curated Findings](https://github.com/marker-inc-korea/autorag/blob/main/src/agent/emit-results-tool.ts): `src/agent/emit-results-tool.ts`

### Other components

- **User**
- **Local Documents**
- **External Data Sources**

## Connections

- User → Librarian Agent: asks
- User → CLI: runs command
- CLI → Lite Commands: dispatches
- Librarian Agent → Evolving Memory: consults
- Librarian Agent → Retrieval Engine: searches
- Retrieval Engine → Method Registry: selects methods
- Retrieval Engine → MinSync Search: queries
- Retrieval Engine → Datasource Skills: queries
- Librarian Agent → Jikji Discovery: discovers
- Datasource Skills → Crawler Client: invokes
- Crawler Client → External Data Sources: searches
- External Data Sources → Datasource Skills: returns hits
- MinSync Search → Embedding Gateway: uses embeddings
- Document Mirror → Document Parser: parses documents
- Local Documents → Document Mirror: syncs documents
- Librarian Agent → Direct Evidence Read: reads evidence
- Direct Evidence Read → Local Documents: opens sources
- Librarian Agent → Web Search & Fetch: researches web
- Librarian Agent → Curated Findings: emits findings
- User → Feedback: provides feedback
- Feedback → Evolving Memory: records outcomes
- Lite Commands → Retrieval Engine: retrieves
