# tencent/weknora architecture

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

- Interactive diagram: https://gitdiagram.com/tencent/weknora
- Repository: https://github.com/tencent/weknora
- Video tour (about a minute): https://gitdiagram.com/tencent/weknora/video

## Overview

WeKnora is an enterprise knowledge framework for document ingestion, cited RAG answers, multi-step agent work, and knowledge wikis. The principal workflow brings documents into shared knowledge bases, parses and indexes them, then retrieves relevant content for user questions and returns answers with citations. The graph also preserves the README’s major agent, wiki, integration, storage, and operations capabilities. Relationships beyond the sampled source are based on README statements; the source excerpts do not expose the full request-to-retrieval implementation.

Main entry points: [`internal/agent/engine.go`](https://github.com/tencent/weknora/blob/main/internal/agent/engine.go) (Agent execution), [`internal/application/service/chat_pipeline/chat_pipeline.go`](https://github.com/tencent/weknora/blob/main/internal/application/service/chat_pipeline/chat_pipeline.go) (RAG answer pipeline), [`frontend/src`](https://github.com/tencent/weknora/tree/main/frontend/src) (Web application), [`internal/router/routes_knowledge.go`](https://github.com/tencent/weknora/blob/main/internal/router/routes_knowledge.go) (Document ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Web application"]
  node_chatui["Chat experience"]
  node_knowledgeui["Knowledge management<br/>[index.ts]"]
end

subgraph group_knowledge["Knowledge processing"]
  node_ingestion["Document ingestion"]
  node_parser["Document parsing<br/>[engines.go]"]
  node_docreader["DocReader parsers<br/>[registry.py]"]
  node_datasources["Data-source sync<br/>[engine.go]"]
  node_retrieval["Semantic retrieval<br/>[engine_factory.go]"]
  node_wiki["Knowledge wiki<br/>[index.ts]"]
end

subgraph group_intelligence["Answering and agents"]
  node_chatpipeline["RAG answer pipeline<br/>[chat_pipeline.go]"]
  node_agent["Agent execution<br/>[engine.go]"]
  node_skills["Agent skills<br/>[manager.go]"]
  node_sandbox["Session sandbox<br/>[session_manager.go]"]
  node_browser["Browser skill<br/>[manager.go]"]
end

subgraph group_platform["Platform services"]
  node_api["Backend API"]
  node_storage[("Storage backends<br/>[storagebackend.go]")]
  node_models["Model providers<br/>[volcengine.go]"]
  node_stream["Session streaming<br/>[redis_manager.go]"]
  node_tracing["Tracing<br/>[manager.go]"]
end

subgraph group_integrations["Channels and integrations"]
  node_mcp["MCP services<br/>[manager.go]"]
  node_mcpserver["MCP server<br/>[server.go]"]
  node_im["Messaging channels<br/>[service.go]"]
  node_embed["Embedded widget<br/>[embed-main.ts]"]
end

node_user(("User"))
node_external(("External systems"))

node_user -->|"uses"| node_web
node_web -->|"asks questions"| node_chatui
node_web -->|"manages knowledge"| node_knowledgeui
node_knowledgeui -.->|"sends requests"| node_api
node_api -->|"routes requests"| node_ingestion
node_ingestion -.->|"parses documents"| node_parser
node_parser -->|"delegates formats"| node_docreader
node_datasources -.->|"syncs documents"| node_ingestion
node_chatui -->|"requests answers"| node_chatpipeline
node_chatpipeline -.->|"retrieves knowledge"| node_retrieval
node_chatpipeline -.->|"generates answers"| node_models
node_chatpipeline -.->|"streams responses"| node_stream
node_chatpipeline -->|"dispatches tasks"| node_agent
node_agent -->|"uses skills"| node_skills
node_agent -->|"runs tools"| node_sandbox
node_agent -->|"controls browser"| node_browser
node_agent -->|"refreshes tools"| node_mcp
node_agent -->|"records steps"| node_tracing
node_wiki -->|"organizes knowledge"| node_retrieval
node_storage -->|"stores files"| node_external
node_mcpserver -->|"serves AI tools"| node_external
node_mcp -->|"connects services"| node_external
node_im -->|"serves Q&amp;A"| node_external
node_embed -->|"embeds chat"| node_external

click node_web "https://github.com/tencent/weknora/tree/main/frontend/src"
click node_chatui "https://github.com/tencent/weknora/blob/main/frontend/src/composables/useChatStreamHandler.ts"
click node_knowledgeui "https://github.com/tencent/weknora/blob/main/frontend/src/api/knowledge-base/index.ts"
click node_api "https://github.com/tencent/weknora/blob/main/internal/router/routes_knowledge.go"
click node_ingestion "https://github.com/tencent/weknora/blob/main/internal/router/routes_knowledge.go"
click node_parser "https://github.com/tencent/weknora/blob/main/internal/infrastructure/docparser/engines.go"
click node_docreader "https://github.com/tencent/weknora/blob/main/docreader/parser/registry.py"
click node_datasources "https://github.com/tencent/weknora/blob/main/internal/datasource/connector/feishu/core/engine.go"
click node_retrieval "https://github.com/tencent/weknora/blob/main/internal/container/engine_factory.go"
click node_chatpipeline "https://github.com/tencent/weknora/blob/main/internal/application/service/chat_pipeline/chat_pipeline.go"
click node_agent "https://github.com/tencent/weknora/blob/main/internal/agent/engine.go"
click node_skills "https://github.com/tencent/weknora/blob/main/internal/agent/skills/manager.go"
click node_sandbox "https://github.com/tencent/weknora/blob/main/internal/sandbox/session_manager.go"
click node_browser "https://github.com/tencent/weknora/blob/main/internal/browserskill/manager.go"
click node_wiki "https://github.com/tencent/weknora/blob/main/frontend/src/api/wiki/index.ts"
click node_storage "https://github.com/tencent/weknora/blob/main/internal/application/service/storagebackend.go"
click node_models "https://github.com/tencent/weknora/blob/main/internal/models/providers/volcengine.go"
click node_stream "https://github.com/tencent/weknora/blob/main/internal/stream/redis_manager.go"
click node_tracing "https://github.com/tencent/weknora/blob/main/internal/tracing/langfuse/manager.go"
click node_mcp "https://github.com/tencent/weknora/blob/main/internal/mcp/manager.go"
click node_mcpserver "https://github.com/tencent/weknora/blob/main/internal/mcpserver/server.go"
click node_im "https://github.com/tencent/weknora/blob/main/internal/im/service.go"
click node_embed "https://github.com/tencent/weknora/blob/main/frontend/src/embed-main.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_web,node_chatui,node_knowledgeui,node_user toneBlue
class node_ingestion,node_parser,node_docreader,node_datasources,node_retrieval,node_wiki toneAmber
class node_chatpipeline,node_agent,node_skills,node_sandbox,node_browser toneMint
class node_api,node_storage,node_models,node_stream,node_tracing toneRose
class node_mcp,node_mcpserver,node_im,node_embed,node_external toneIndigo
```

## Components

### User experience

- [Web application](https://github.com/tencent/weknora/tree/main/frontend/src): `frontend/src`
- [Chat experience](https://github.com/tencent/weknora/blob/main/frontend/src/composables/useChatStreamHandler.ts): `frontend/src/composables/useChatStreamHandler.ts`
- [Knowledge management](https://github.com/tencent/weknora/blob/main/frontend/src/api/knowledge-base/index.ts): `frontend/src/api/knowledge-base/index.ts`

### Knowledge processing

- [Document ingestion](https://github.com/tencent/weknora/blob/main/internal/router/routes_knowledge.go): `internal/router/routes_knowledge.go`
- [Document parsing](https://github.com/tencent/weknora/blob/main/internal/infrastructure/docparser/engines.go): `internal/infrastructure/docparser/engines.go`
- [DocReader parsers](https://github.com/tencent/weknora/blob/main/docreader/parser/registry.py): `docreader/parser/registry.py`
- [Data-source sync](https://github.com/tencent/weknora/blob/main/internal/datasource/connector/feishu/core/engine.go): `internal/datasource/connector/feishu/core/engine.go`
- [Semantic retrieval](https://github.com/tencent/weknora/blob/main/internal/container/engine_factory.go): `internal/container/engine_factory.go`
- [Knowledge wiki](https://github.com/tencent/weknora/blob/main/frontend/src/api/wiki/index.ts): `frontend/src/api/wiki/index.ts`

### Answering and agents

- [RAG answer pipeline](https://github.com/tencent/weknora/blob/main/internal/application/service/chat_pipeline/chat_pipeline.go): `internal/application/service/chat_pipeline/chat_pipeline.go`
- [Agent execution](https://github.com/tencent/weknora/blob/main/internal/agent/engine.go): `internal/agent/engine.go`
- [Agent skills](https://github.com/tencent/weknora/blob/main/internal/agent/skills/manager.go): `internal/agent/skills/manager.go`
- [Session sandbox](https://github.com/tencent/weknora/blob/main/internal/sandbox/session_manager.go): `internal/sandbox/session_manager.go`
- [Browser skill](https://github.com/tencent/weknora/blob/main/internal/browserskill/manager.go): `internal/browserskill/manager.go`

### Platform services

- [Backend API](https://github.com/tencent/weknora/blob/main/internal/router/routes_knowledge.go): `internal/router/routes_knowledge.go`
- [Storage backends](https://github.com/tencent/weknora/blob/main/internal/application/service/storagebackend.go): `internal/application/service/storagebackend.go`
- [Model providers](https://github.com/tencent/weknora/blob/main/internal/models/providers/volcengine.go): `internal/models/providers/volcengine.go`
- [Session streaming](https://github.com/tencent/weknora/blob/main/internal/stream/redis_manager.go): `internal/stream/redis_manager.go`
- [Tracing](https://github.com/tencent/weknora/blob/main/internal/tracing/langfuse/manager.go): `internal/tracing/langfuse/manager.go`

### Channels and integrations

- [MCP services](https://github.com/tencent/weknora/blob/main/internal/mcp/manager.go): `internal/mcp/manager.go`
- [MCP server](https://github.com/tencent/weknora/blob/main/internal/mcpserver/server.go): `internal/mcpserver/server.go`
- [Messaging channels](https://github.com/tencent/weknora/blob/main/internal/im/service.go): `internal/im/service.go`
- [Embedded widget](https://github.com/tencent/weknora/blob/main/frontend/src/embed-main.ts): `frontend/src/embed-main.ts`

### Other components

- **User**
- **External systems**

## Connections

- User → Web application: uses (evidence: `README.md`)
- Web application → Chat experience: asks questions (evidence: `README.md`)
- Web application → Knowledge management: manages knowledge (evidence: `README.md`)
- Knowledge management → Backend API: sends requests
- Backend API → Document ingestion: routes requests (evidence: `internal/router/routes_knowledge.go`)
- Document ingestion → Document parsing: parses documents
- Document parsing → DocReader parsers: delegates formats (evidence: `internal/infrastructure/docparser/engines.go`)
- Data-source sync → Document ingestion: syncs documents
- Chat experience → RAG answer pipeline: requests answers (evidence: `README.md`)
- RAG answer pipeline → Semantic retrieval: retrieves knowledge
- RAG answer pipeline → Model providers: generates answers
- RAG answer pipeline → Session streaming: streams responses
- RAG answer pipeline → Agent execution: dispatches tasks (evidence: `README.md`)
- Agent execution → Agent skills: uses skills (evidence: `internal/agent/engine.go`)
- Agent execution → Session sandbox: runs tools (evidence: `internal/agent/engine.go`)
- Agent execution → Browser skill: controls browser (evidence: `README.md`)
- Agent execution → MCP services: refreshes tools (evidence: `internal/agent/engine.go`)
- Agent execution → Tracing: records steps (evidence: `internal/agent/engine.go`)
- Knowledge wiki → Semantic retrieval: organizes knowledge (evidence: `README.md`)
- Storage backends → External systems: stores files (evidence: `README.md`)
- MCP server → External systems: serves AI tools (evidence: `README.md`)
- MCP services → External systems: connects services (evidence: `README.md`)
- Messaging channels → External systems: serves Q&A (evidence: `README.md`)
- Embedded widget → External systems: embeds chat (evidence: `README.md`)
