# maxxie226/weknora architecture

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

- Interactive diagram: https://gitdiagram.com/maxxie226/weknora
- Repository: https://github.com/maxxie226/weknora

## Overview

WeKnora is an enterprise knowledge framework for document ingestion, retrieval-augmented answers, multi-step agents, and wikis over shared knowledge bases. A typical user flow is to add documents to a knowledge base, parse and index them, then ask a question and receive a reasoned answer with citations. The product also includes data-source sync, sandboxed agent tools, chat integrations, and workspace controls. Relationships are grounded in README capability statements or shown source references; several internal handoffs are not visible in the excerpts and are left unconnected.

Main entry points: [`internal/agent/engine.go`](https://github.com/maxxie226/weknora/blob/main/internal/agent/engine.go) (Agent runtime), [`internal/router/routes_knowledge.go`](https://github.com/maxxie226/weknora/blob/main/internal/router/routes_knowledge.go) (Knowledge routes), [`internal/application/service/chat_pipeline/chat_pipeline.go`](https://github.com/maxxie226/weknora/blob/main/internal/application/service/chat_pipeline/chat_pipeline.go) (Chat pipeline), [`cmd/server/main.go`](https://github.com/maxxie226/weknora/blob/main/cmd/server/main.go) (HTTP API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Web application<br/>[App.vue]"]
  node_chat["Chat streaming"]
  node_cli["CLI client<br/>[main.go]"]
end

subgraph group_knowledge["Knowledge lifecycle"]
  node_knowledge_api["Knowledge routes"]
  node_docreader["Document parsing<br/>[registry.py]"]
  node_parser_engines["Parser engines<br/>[engines.go]"]
  node_datasources["Data-source connectors"]
  node_retrieval["Vector retrieval<br/>[engine_factory.go]"]
  node_wiki["Knowledge wiki<br/>[index.ts]"]
end

subgraph group_reasoning["Answering and agents"]
  node_chat_pipeline["Chat pipeline<br/>[chat_pipeline.go]"]
  node_agent["Agent runtime<br/>[engine.go]"]
  node_sandbox["Agent sandbox<br/>[session_manager.go]"]
  node_memory["Conversation memory<br/>[memory_manager.go]"]
  node_models["Model providers<br/>[volcengine.go]"]
end

subgraph group_platform["Platform services"]
  node_api_server["HTTP API server<br/>[main.go]"]
  node_storage["File storage services<br/>[storagebackend.go]"]
  node_streaming["Stream managers<br/>[redis_manager.go]"]
  node_tracing["Langfuse tracing<br/>[manager.go]"]
end

subgraph group_integrations["External integrations"]
  node_mcp["MCP server<br/>[server.go]"]
  node_im["IM channels<br/>[service.go]"]
  node_external_mcp["MCP services<br/>[manager.go]"]
  node_browser["User browser<br/>[manager.go]"]
end

node_user(("User"))

node_user -->|"uses"| node_web
node_user -->|"uses"| node_cli
node_web -->|"requests"| node_api_server
node_cli -.->|"requests"| node_api_server
node_api_server -->|"routes knowledge"| node_knowledge_api
node_user -->|"uploads documents"| node_knowledge_api
node_knowledge_api -.->|"parses documents"| node_parser_engines
node_parser_engines -->|"delegates complex formats"| node_docreader
node_user -->|"connects sources"| node_datasources
node_datasources -.->|"syncs knowledge"| node_knowledge_api
node_knowledge_api -.->|"indexes knowledge"| node_retrieval
node_user -->|"asks questions"| node_chat
node_chat -.->|"streams requests"| node_api_server
node_api_server -.->|"handles chat"| node_chat_pipeline
node_chat_pipeline -.->|"retrieves context"| node_retrieval
node_chat_pipeline -.->|"requests generation"| node_models
node_chat_pipeline -.->|"streams events"| node_streaming
node_chat_pipeline -.->|"uses memory"| node_memory
node_user -->|"starts tasks"| node_agent
node_agent -.->|"reasons with"| node_models
node_agent -->|"runs tools in"| node_sandbox
node_agent -.->|"uses tools"| node_external_mcp
node_agent -->|"controls browser"| node_browser
node_agent -->|"records spans"| node_tracing
node_user -->|"organizes knowledge"| node_wiki
node_user -->|"asks via channels"| node_im
node_user -->|"connects AI tools"| node_mcp
node_knowledge_api -.->|"stores files"| node_storage

click node_web "https://github.com/maxxie226/weknora/blob/main/frontend/src/App.vue"
click node_chat "https://github.com/maxxie226/weknora/blob/main/frontend/src/composables/useChatStreamHandler.ts"
click node_cli "https://github.com/maxxie226/weknora/blob/main/cli/main.go"
click node_knowledge_api "https://github.com/maxxie226/weknora/blob/main/internal/router/routes_knowledge.go"
click node_docreader "https://github.com/maxxie226/weknora/blob/main/docreader/parser/registry.py"
click node_parser_engines "https://github.com/maxxie226/weknora/blob/main/internal/infrastructure/docparser/engines.go"
click node_datasources "https://github.com/maxxie226/weknora/tree/main/internal/datasource"
click node_retrieval "https://github.com/maxxie226/weknora/blob/main/internal/container/engine_factory.go"
click node_wiki "https://github.com/maxxie226/weknora/blob/main/frontend/src/api/wiki/index.ts"
click node_chat_pipeline "https://github.com/maxxie226/weknora/blob/main/internal/application/service/chat_pipeline/chat_pipeline.go"
click node_agent "https://github.com/maxxie226/weknora/blob/main/internal/agent/engine.go"
click node_sandbox "https://github.com/maxxie226/weknora/blob/main/internal/sandbox/session_manager.go"
click node_memory "https://github.com/maxxie226/weknora/blob/main/internal/stream/memory_manager.go"
click node_models "https://github.com/maxxie226/weknora/blob/main/internal/models/providers/volcengine.go"
click node_api_server "https://github.com/maxxie226/weknora/blob/main/cmd/server/main.go"
click node_storage "https://github.com/maxxie226/weknora/blob/main/internal/application/service/storagebackend.go"
click node_streaming "https://github.com/maxxie226/weknora/blob/main/internal/stream/redis_manager.go"
click node_tracing "https://github.com/maxxie226/weknora/blob/main/internal/tracing/langfuse/manager.go"
click node_mcp "https://github.com/maxxie226/weknora/blob/main/internal/mcpserver/server.go"
click node_im "https://github.com/maxxie226/weknora/blob/main/internal/im/service.go"
click node_external_mcp "https://github.com/maxxie226/weknora/blob/main/internal/mcp/manager.go"
click node_browser "https://github.com/maxxie226/weknora/blob/main/internal/browserskill/manager.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_web,node_chat,node_cli,node_user toneBlue
class node_knowledge_api,node_docreader,node_parser_engines,node_datasources,node_retrieval,node_wiki toneAmber
class node_chat_pipeline,node_agent,node_sandbox,node_memory,node_models toneMint
class node_api_server,node_storage,node_streaming,node_tracing toneRose
class node_mcp,node_im,node_external_mcp,node_browser toneIndigo
```

## Components

### User experience

- [Web application](https://github.com/maxxie226/weknora/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Chat streaming](https://github.com/maxxie226/weknora/blob/main/frontend/src/composables/useChatStreamHandler.ts): `frontend/src/composables/useChatStreamHandler.ts`
- [CLI client](https://github.com/maxxie226/weknora/blob/main/cli/main.go): `cli/main.go`

### Knowledge lifecycle

- [Knowledge routes](https://github.com/maxxie226/weknora/blob/main/internal/router/routes_knowledge.go): `internal/router/routes_knowledge.go`
- [Document parsing](https://github.com/maxxie226/weknora/blob/main/docreader/parser/registry.py): `docreader/parser/registry.py`
- [Parser engines](https://github.com/maxxie226/weknora/blob/main/internal/infrastructure/docparser/engines.go): `internal/infrastructure/docparser/engines.go`
- [Data-source connectors](https://github.com/maxxie226/weknora/tree/main/internal/datasource): `internal/datasource`
- [Vector retrieval](https://github.com/maxxie226/weknora/blob/main/internal/container/engine_factory.go): `internal/container/engine_factory.go`
- [Knowledge wiki](https://github.com/maxxie226/weknora/blob/main/frontend/src/api/wiki/index.ts): `frontend/src/api/wiki/index.ts`

### Answering and agents

- [Chat pipeline](https://github.com/maxxie226/weknora/blob/main/internal/application/service/chat_pipeline/chat_pipeline.go): `internal/application/service/chat_pipeline/chat_pipeline.go`
- [Agent runtime](https://github.com/maxxie226/weknora/blob/main/internal/agent/engine.go): `internal/agent/engine.go`
- [Agent sandbox](https://github.com/maxxie226/weknora/blob/main/internal/sandbox/session_manager.go): `internal/sandbox/session_manager.go`
- [Conversation memory](https://github.com/maxxie226/weknora/blob/main/internal/stream/memory_manager.go): `internal/stream/memory_manager.go`
- [Model providers](https://github.com/maxxie226/weknora/blob/main/internal/models/providers/volcengine.go): `internal/models/providers/volcengine.go`

### Platform services

- [HTTP API server](https://github.com/maxxie226/weknora/blob/main/cmd/server/main.go): `cmd/server/main.go`
- [File storage services](https://github.com/maxxie226/weknora/blob/main/internal/application/service/storagebackend.go): `internal/application/service/storagebackend.go`
- [Stream managers](https://github.com/maxxie226/weknora/blob/main/internal/stream/redis_manager.go): `internal/stream/redis_manager.go`
- [Langfuse tracing](https://github.com/maxxie226/weknora/blob/main/internal/tracing/langfuse/manager.go): `internal/tracing/langfuse/manager.go`

### External integrations

- [MCP server](https://github.com/maxxie226/weknora/blob/main/internal/mcpserver/server.go): `internal/mcpserver/server.go`
- [IM channels](https://github.com/maxxie226/weknora/blob/main/internal/im/service.go): `internal/im/service.go`
- [MCP services](https://github.com/maxxie226/weknora/blob/main/internal/mcp/manager.go): `internal/mcp/manager.go`
- [User browser](https://github.com/maxxie226/weknora/blob/main/internal/browserskill/manager.go): `internal/browserskill/manager.go`

### Other components

- **User**

## Connections

- User → Web application: uses (evidence: `README.md`)
- User → CLI client: uses (evidence: `README.md`)
- Web application → HTTP API server: requests (evidence: `README.md`)
- CLI client → HTTP API server: requests
- HTTP API server → Knowledge routes: routes knowledge (evidence: `internal/router/routes_knowledge.go`)
- User → Knowledge routes: uploads documents (evidence: `README.md`)
- Knowledge routes → Parser engines: parses documents
- Parser engines → Document parsing: delegates complex formats (evidence: `internal/infrastructure/docparser/engines.go`)
- User → Data-source connectors: connects sources (evidence: `README.md`)
- Data-source connectors → Knowledge routes: syncs knowledge
- Knowledge routes → Vector retrieval: indexes knowledge
- User → Chat streaming: asks questions (evidence: `README.md`)
- Chat streaming → HTTP API server: streams requests
- HTTP API server → Chat pipeline: handles chat
- Chat pipeline → Vector retrieval: retrieves context
- Chat pipeline → Model providers: requests generation
- Chat pipeline → Stream managers: streams events
- Chat pipeline → Conversation memory: uses memory
- User → Agent runtime: starts tasks (evidence: `README.md`)
- Agent runtime → Model providers: reasons with
- Agent runtime → Agent sandbox: runs tools in (evidence: `internal/agent/engine.go`)
- Agent runtime → MCP services: uses tools
- Agent runtime → User browser: controls browser (evidence: `README.md`)
- Agent runtime → Langfuse tracing: records spans (evidence: `internal/agent/engine.go`)
- User → Knowledge wiki: organizes knowledge (evidence: `README.md`)
- User → IM channels: asks via channels (evidence: `README.md`)
- User → MCP server: connects AI tools (evidence: `README.md`)
- Knowledge routes → File storage services: stores files
