Tencent/WeKnora
Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 10 generated files: docreader/proto/docreader_grpc.pb.go, docreader/proto/docreader_pb2_grpc.py, docreader/proto/docreader_pb2.py, docreader/proto/docreader.pb.go, docs/docs.go, frontend/public/tdesign-icons/0.4.1/fonts/index.js, frontend/src/wailsjs/go/main/App.d.ts, frontend/src/wailsjs/go/main/App.js, internal/types/interfaces/custom_agent.go, internal/types/interfaces/knowledgebase.go.
Largest clones in the code
- 6 lines in 18 placesgo50 tokensinternal/handler/wiki_page.go:95–100internal/handler/wiki_page.go:153–158internal/handler/wiki_page.go:226–231internal/handler/wiki_page.go:262–267internal/handler/wiki_page.go:292–297and 13 more
95func (h *WikiPageHandler) ListPages(c *gin.Context) { 96 kbID, _, err := h.validateWikiKB(c) 97 if err != nil { 98 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) 99 return 100 } - 99 lines in 2 placesless630 tokensfrontend/src/views/organization/OrganizationSettingsModal.vue:2970–3068frontend/src/views/settings/TenantMembers.vue:2324–2422
2970.permissions-compact.permissions-compact--popover { 2971 padding: 12px 14px; 2972 margin: 0; 2973 max-height: min(392px, calc(65vh - 8px)); 2974 overflow-x: hidden; 2975 overflow-y: auto; 2976 2977 .permissions-compact-header { 2978 display: flex; 2979 flex-direction: column;First 10 of 99 lines.
- 98 lines in 2 placesless590 tokensfrontend/src/views/organization/OrganizationSettingsModal.vue:2649–2746frontend/src/views/settings/TenantMembers.vue:1764–1861
2649 max-height: none !important; 2650 } 2651} 2652 2653.permissions-compact { 2654 padding: 8px; 2655 2656 .permissions-compact-header { 2657 display: flex; 2658 flex-direction: column;First 10 of 98 lines.
7 more
- 8 lines in 11 placesgo59 tokens
- 8 lines in 11 placesgo56 tokens
- 9 lines in 10 placesgo61 tokens
- 7 lines in 11 placesgo51 tokens
- 47 lines in 2 placesless500 tokens
- 14 lines in 7 placesgo83 tokens
- 74 lines in 2 placesless493 tokens
Largest clones over all files, tests and data included
- 6 lines in 24 placesgotests61 tokensinternal/application/service/memory/coverage_test.go:55–60internal/application/service/memory/coverage_test.go:84–88internal/application/service/memory/coverage_test.go:116–120internal/application/service/memory/coverage_test.go:144–148internal/application/service/memory/coverage_test.go:167–171and 19 more
55func TestEveryTurnIsEventuallyRead(t *testing.T) { 56 svc, tenantRepo, messages, models, enqueuer := newExtractionHarness(t) 57 ctx := enabledCtx(t, tenantRepo, 1, "alice") 58 tenantRepo.set(1, &types.MemoryConfig{ 59 Enabled: true, WriteMode: types.MemoryWriteAuto, 60 ExtractDelaySeconds: 5, ExtractMinIntervalSeconds: 1,84func TestTurnsDuringARunAreNotLost(t *testing.T) { 85 svc, tenantRepo, messages, models, enqueuer := newExtractionHarness(t) 86 ctx := enabledCtx(t, tenantRepo, 1, "alice") 87 tenantRepo.set(1, &types.MemoryConfig{ 88 Enabled: true, WriteMode: types.MemoryWriteAuto, ExtractDelaySeconds: 5, - 6 lines in 18 placesgo50 tokensinternal/handler/wiki_page.go:95–100internal/handler/wiki_page.go:153–158internal/handler/wiki_page.go:226–231internal/handler/wiki_page.go:262–267internal/handler/wiki_page.go:292–297and 13 more
95func (h *WikiPageHandler) ListPages(c *gin.Context) { 96 kbID, _, err := h.validateWikiKB(c) 97 if err != nil { 98 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) 99 return 100 } - 6 lines in 16 placesgotests55 tokensinternal/application/service/memory/retrieval_test.go:17–22internal/application/service/memory/retrieval_test.go:53–59internal/application/service/memory/search_test.go:68–73internal/application/service/memory/search_test.go:86–91internal/application/service/memory/search_test.go:108–112and 11 more
17func TestRetrievalContextCarriesWhoIsAsking(t *testing.T) { 18 svc, _, tenantRepo := newMemoryHarness(t) 19 ctx := enabledCtx(t, tenantRepo, 1, "alice") 20 21 _, err := svc.Remember(ctx, types.MemoryItem{ 22 Kind: types.MemoryKindProfile, Content: "在做医学影像的后端", Importance: 4,53func TestPendingMemoriesNeverReachAPrompt(t *testing.T) { 54 svc, _, tenantRepo := newMemoryHarness(t) 55 ctx := enabledCtx(t, tenantRepo, 1, "alice") 56 57 _, err := svc.Remember(ctx, types.MemoryItem{ 58 Kind: types.MemoryKindProfile, 59 Content: "可能在负责连锁门店的排班", - 10 lines in 11 placesgotests73 tokensinternal/router/router_api_key_capabilities_test.go:34–43internal/router/router_api_key_capabilities_test.go:129–138internal/router/router_api_key_capabilities_test.go:163–172internal/router/router_api_key_capabilities_test.go:199–208internal/router/router_api_key_capabilities_test.go:233–242and 6 more
- 8 lines in 12 placesgo59 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| go | 1,219 | 355,223 | 1,084 | 11,495 | 3.24% |
| less | 170 | 43,716 | 531 | 6,611 | 15.12% |
| typescript | 417 | 85,983 | 121 | 1,390 | 1.62% |
| html | 193 | 14,300 | 87 | 961 | 6.72% |
| css | 16 | 1,767 | 18 | 168 | 9.51% |
| python | 51 | 12,864 | 11 | 109 | 0.85% |
| javascript | 30 | 4,235 | 3 | 29 | 0.68% |
| bash | 35 | 4,801 | 2 | 27 | 0.56% |
| vue | 205 | 150,885 | 0 | 0 | 0% |
| tsx | 7 | 337 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| go | 2,357 | 604,993 | 3,024 | 30,541 | 5.05% |
| less | 194 | 49,266 | 612 | 7,612 | 15.45% |
| typescript | 541 | 136,907 | 176 | 2,213 | 1.62% |
| json | 51 | 31,122 | 107 | 2,547 | 8.18% |
| html | 193 | 14,300 | 87 | 961 | 6.72% |
| markdown | 203 | 52,215 | 74 | 1,062 | 2.03% |
| yaml | 64 | 26,152 | 61 | 1,164 | 4.45% |
| sql | 131 | 7,484 | 44 | 591 | 7.9% |
| python | 89 | 18,040 | 22 | 245 | 1.36% |
| css | 22 | 3,075 | 18 | 168 | 5.46% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Sep 18, 2026 | #8 | 26,514 (+1,125) | 4,400 | 1,125,944 | 4,274 | 4.24% | 3.08% | — | 6db8fdd |
| Sep 17, 2026 | #11 | 25,587 (+1,197) | 4,274 | 1,106,896 | 4,131 | 4.36% | 3.36% | — | c9d5987 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.