Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

LiveX Wiki: Taobao Live's Agent Knowledge Base with LLM Wiki, OKF & Git Boosts AI Coding by 39%

The Taobao Live Interactive Team built LiveX Wiki, an agent knowledge base combining LLM Wiki, OKF, and Git to structure business knowledge into a three-layer domain-scenario-knowledge model, enabling hierarchical indexing and agentic search with source verification. Evaluation shows 39% improvement over no knowledge base and 30% over RAG in end-to-end code generation, with repository localization accuracy rising from 60% to 90%.

Background: How Far Are Coding Agents from Writing Correct Business Code?

Coding agents excel at implementing well-defined functions or local logic, but in complex business scenarios requirements span multiple repositories and platforms, involve extensive domain jargon, and depend on intricate configurations and experiment designs. These facts are scattered across code, documents, and team experience, and they evolve continuously. Turning this knowledge into reusable, verifiable, and maintainable context is the foundation for improving business code delivery quality.

Pain Points with Traditional RAG Vector Knowledge Bases

The team initially used a RAG vector knowledge base to supplement business materials, improving knowledge retrieval. However, in actual tasks the retrieved fragments still required manual completion of scenario boundaries, dependency relationships, and current facts. This shifted the focus from material retrieval to structured organization, on-demand consumption, and continuous maintenance of business knowledge.

Observed Limitations of RAG in Business Coding

Knowledge is point-like, lacking holistic view: Retrieved content consists of specifications, classes, methods, or local implementations; overall relationships among pages, components, interfaces, and dependencies must be assembled separately.

Business perspective requires ad-hoc assembly: After obtaining several knowledge entries, the agent must still decide which page, business behavior, and implementation chain they belong to.

Impact analysis depends on further investigation: Retrieval finds candidate content, but core chains behind pages, shared capabilities, and forward/backward dependencies need separate modeling and verification.

Knowledge freshness needs extra constraints: Without linked source versions and verification evidence, outdated knowledge conflicts with current reality, forcing the agent to judge on its own.

These issues stemmed from the knowledge organization and consumption approach, not from RAG per se. The problem shifted from "can we find knowledge?" to "can we understand knowledge by business structure?"

First-Principles Derivation: What Kind of Knowledge Base Does an Agent Need?

A coding agent's task is to turn a business requirement into a correct code change. Models have strong general programming ability, but specific business facts must be supplied externally: which page scenario, which implementation chain, which configurations and experiments control behavior, which upstream/downstream services are affected. This context changes constantly and cannot be fully stuffed into every task. When the knowledge base's reader expands from humans to agents, the key questions become: how to provide machine-parseable identity and boundaries, deterministic routing entry points, and traceable evidence. Feeding human-oriented knowledge directly to agents is a common misalignment.

From these premises, four design constraints emerge:

Supply on demand, not full dump. Irrelevant information, similar distractors, and expired rules increase filtering burden. The knowledge base must let the agent take only the needed level at each stage.

Organize by business structure, not by entries. Business facts have ownership and relationships; point-like knowledge detached from structure forces the agent to rebuild relationships during the task.

Provide verifiable paths, not just citable conclusions. Models may err, knowledge may expire; the knowledge base preserves structure and locating information so current facts can be confirmed at execution time by returning to original sources.

Have a lifecycle, evolve with changes. Knowledge decoupled from code changes can continuously mislead later tasks. Knowledge must be versioned like code: updates traceable, impact auditable, errors revertible.

LiveX Wiki: Technical Choices and Trade-offs

The four constraints point to a single engineering problem: how to continuously transform scattered, changing business facts into agent-usable context. The team split the selection along the full knowledge lifecycle into four dimensions: knowledge modeling, knowledge production, knowledge consumption, and knowledge iteration.

3.1 Knowledge Modeling: Business Scenario as Core Unit

The team considered free documents (easy to write but identity/boundaries/references rely on reader understanding), code-symbol-level splitting (easy to locate code but hard to express cross-platform business behavior), and ontology semantic modeling (explicit objects, properties, relations, actions but larger modeling/maintenance scope). LiveX Wiki chooses business scenario as the core knowledge unit, with domain defining ownership and shared knowledge enabling reuse . Expression borrows OKF's lightweight file idea: Markdown stores business explanations, YAML frontmatter and reference declarations capture identity, sources, and dependencies, making it human-reviewable, programmatically checkable, and agent-readable in structure. Specific fields and consumption rules are defined by project contracts.

They invest in scenario boundaries and relationship accuracy, prioritizing that a business behavior can be fully understood, independently verified, and clearly assigned. Not all business objects and operations need a unified runtime model; retaining sufficient semantic structure while controlling modeling scope fits the knowledge navigation goal. The trade-off: scenario partitioning still requires business judgment, not automatable from file directories or code structure alone.

3.2 Knowledge Production: Making Business Semantics Reusable Knowledge

Manual curation explains business intent but cross-repo investigation and subsequent sync are time-consuming; automatic extraction gathers symbols, entities, and candidate relations but business boundaries and relation meanings still need confirmation. LLM Wiki inspires letting the model compile cross-source understanding into continuously maintained knowledge so investigation results can be reused.

Adopted production mode: humans define boundaries and responsibilities, agent performs cross-source investigation and verification, programs check structure . Owners specify scenario scope and authoritative sources; the agent, on fixed versions and environments, traces implementation from business entry points, then reverse-checks callers and dependencies, compiling verified relations into scenario knowledge; insufficient-evidence content is recorded separately, business ambiguities referred to owners.

This shifts part of the understanding cost to knowledge production, enabling later tasks to reuse already-investigated paths. Whether cold-start investment pays off depends on whether outcomes continuously serve subsequent changes in the same business. Production quality is measured by key-chain coverage, evidence-backed relations, and clear ownership.

3.3 Knowledge Consumption: Hierarchical Index + Agentic Search, Final Verification at Fact Layer

Consumption determines where the agent starts and how it obtains required evidence. Vector RAG provides semantic retrieval entry; GraphRAG and LightRAG introduce entity/relation indexes; PageIndex uses tree indexes and model reasoning for location. Each strengthens semantic matching, relation retrieval, or hierarchical navigation, but for business changes all still need further judgment of correspondence between retrieval results and current implementation.

LiveX Wiki chooses hierarchical index combined with Agentic Search : deterministic programs provide compact domain and scenario entries; the agent selects scenarios, core interface chains, and necessary dependencies per requirement, then returns to code and runtime platforms to verify current facts. This borrows hierarchical navigation (business levels defined by scenario model) and active search (evidence investigation, follow-up questioning along task needs).

The combination lets accumulated business understanding narrow investigation scope while implementation judgments face current-fact verification. Focus is on reducing repeated investigation and accurately determining change scope, not just count of retrieved fragments. Stepwise reading and source verification incur call costs, so consumption sets termination conditions: stop when evidence is complete, report gaps on repetition or misses, avoid unbounded expansion.

3.4 Knowledge Iteration: Bringing Content Maintenance into Engineering Governance

Manual maintenance handles complex judgments but continuous updates rely on human effort; index updates let new materials enter retrieval but cannot alone confirm cross-source business relations still hold. LLM can assist in discovering changes, investigating impact, and revising content; Git provides diffs, reviews, and version records. Together they handle knowledge content and change governance, enabling sustainable maintenance.

LiveX Wiki adopts incremental updates, periodic full reviews, and Git-controlled releases : along source code changes, locate affected scenarios, re-verify at source to form candidate revisions; periodically re-check facts and coverage, discovering omissions that tracking existing chains alone cannot expose. Revisions pass structure checks, quality gates, and applicable review processes before release, making every change evidenced, versioned, traceable, and revertible.

Automation best handles repetitive investigation and consistency checks; responsibility for business ambiguities and knowledge accuracy remains with maintainers. This choice accepts ongoing review and human safety-net costs, validated by subsequent task delivery gains.

3.5 Selection Summary

The four dimensions connect around the same business scenario: modeling establishes common language, production creates reusable investigation outcomes, consumption verifies knowledge against current tasks, iteration handles changes and omissions. The trade-off: treat business understanding as an engineering product that continuously accumulates value through repeated use and verification.

Knowledge Modeling: Scenario Model + OKF-style Lightweight Expression — Define knowledge identity, boundaries, ownership, dependencies

Knowledge Production: LLM Wiki Compilation + Human Boundary Setting & Source Verification — Precipitate cross-source investigation into evidenced scenario knowledge

Knowledge Consumption: Hierarchical Index + Agentic Search — On-demand locate and expand knowledge, verify current facts

Knowledge Iteration: LLM Incremental Update & Full Review + Git Governance — Track changes, check omissions, controlled release

LiveX Wiki Knowledge Modeling Details

4.1 Core Ideas

Complete context by business scenario: Organize as "Business Domain — Business Scenario — Shared Knowledge", aggregating entry points, rules, dependencies, and maintenance responsibilities around a single business behavior, making implicit experience explicit to help agents judge modification scope.

Guide verification and clarification with knowledge map: Across requirements, technical designs, and source code investigations, accumulate confirmed business relations, source locations, and pending items separately. Implementation facts prioritized back to code, interfaces, and configs; business intent, rule trade-offs, or unresolved ambiguities after verification go to owners for clarification. Pending items not used as implementation basis.

4.2 OKF + Domain/Scenario/Knowledge Modeling: Building Hierarchical Knowledge Network

Logically, domains, business scenarios, and shared knowledge form a three-layer understanding structure; files organized by domain and scenario, shared knowledge has its own scenario identity, reused via direct dependencies.

Business Domain: Responsibilities, boundaries, maintainers, scenario entries of a capability group — Scenarios have unique ownership; confirm domain boundaries before entering scenarios

Business Scenario: Full panorama of page/system responsibilities, core interface chains, verification paths — One authoritative map per scenario; source code changes aggregated by scenario

Shared Knowledge: Platform access, specifications, common concepts, constraints — Independently maintained, referenced via verified direct dependencies

Scenarios too large expand verification scope on every change; too small degenerate into fragments needing ad-hoc assembly. Page aggregation defines business scope; real interface chains ground technical facts. Both together maintain complete semantics and accurate implementation entry points.

4.3 Knowledge Graph: Visualizing Hierarchical Network and Dependencies

Trees provide deterministic entries; graphs preserve cross-boundary relations. "Progressive disclosure" controls when to expand what; selecting a scenario still requires full-text understanding of its boundaries, summaries cannot replace context. Dependency-level layout expands domains, scenarios, knowledge vertically, grouped by domain; dashed lines express domain ownership, solid lines express direct dependencies. Which scenarios reference a shared capability, whether dependencies cross domain boundaries, can be checked along connections.

Ownership answers "who maintains"; dependencies answer "where to investigate after changes". Graph layers express knowledge organization relations; actual calls and change impact still need verification along interface chains. Two diagrams from same knowledge graph version show organic layout and dependency-level layout (node types, ownership, dependencies preserved; names/identifiers desensitized).

LiveX Wiki Knowledge Lifecycle

Production, consumption, and maintenance organized around the same scenario: production creates verifiable knowledge, consumption confirms knowledge validity for current task, maintenance handles changes and omissions. LLM handles understanding and verification, programs handle structure and scope, Git handles versions and release records. Cold-start, auto-update, and full review share production contracts and release gates; consumption reads released knowledge, reports mismatches, and only authorized maintenance flows produce revisions.

The complete lifecycle is divided into Knowledge Production, Knowledge Consumption, Knowledge Iteration , governed by repository-level AGENTS.md (entry points, read order, behavior boundaries) and MAINTENANCE.md (production, maintenance, release processes, encapsulated as unified Skills for agents).

5.1 Knowledge Production: Custom Cold-Start Logic, Model Cross-Source Investigation with Human Boundaries

Most valuable human work in cold-start: clarifying scenario boundaries and maintenance responsibilities. Owners provide requirements, source code, original PRDs, technical design docs, sources, and verification scope; agent performs cross-repo investigation, evidence cross-checking, and knowledge compilation. If source code and authoritative materials still cannot explain business ownership, owners decide.

Four key actions in production flow:

Fix sources and versions: Each source repo bound to current commit, explicit platform, environment, and unit config to avoid mixing versions during investigation.

Two-round search to bridge terminology gaps: First round uses business behavior, page copy, requirement fields to find candidates; second round uses confirmed interfaces, classes, fields, events, config identifiers to reverse-query, supplementing endpoints and modules missed in first round.

Trace down from entry, reverse-query from consumers: Enumerate APIs, messages, scheduling, extension points, expand along real calls; then check callers, registration points, strategy implementation families to confirm branches beyond main chain.

LLM verifies then compiles: Write verified relations as interface chains, sync configs, experiments, DB dependencies; list unclosed evidence separately, then run structure and release checks.

Example: generic async task scenario — finding submission interface insufficient. If task state also advanced by message processing, need another entry; if processing uses strategy dispatch, must verify selection conditions and applicable implementations. Finding one implementation only proves existence; bidirectional investigation judges scenario completeness.

5.2 Knowledge Consumption: Progressive Disclosure, On-Demand Expansion, Source Verification

Consumption protocol must answer "what to read first" and "where to stop". Deterministic programs generate discovery list; agent judges task relevance; on scenario hit, verify along real sources.

1. Discover Domain: After structure check, read each domain's name, alias, summary in one line — Select business scope with minimal context

2. Select Scenario: Expand candidate domain list, fully read domain boundaries and hit scenarios — Avoid keyword fragments detached from business semantics

3. Pick Chains by Requirement: From interface list locate relevant core chains, read nodes, edges, control items — Ground business problem to implementation entry

4. Expand Necessary Dependencies: Query declared direct dependencies, read target domains and scenarios on demand — Supplement shared knowledge, avoid full-graph loading

5. Source Verification: Establish "navigation assertion — current fact — verification conclusion" correspondence per item — Judge whether knowledge holds for current task

A concrete business change requires confirming inputs, rejection branches, exception handling in current code; verifying how control items take effect in target environment; judging whether shared capabilities affected. Reading knowledge and verifying implementation are two different completion conditions. Consumption maintains visited set: stop when evidence complete; end expansion and report gaps on repetition or misses; on unreachable sources or invalid locators, do not infer "no impact" from "not found". Keep knowledge read-only to prevent task-internal speculation becoming shared fact.

5.3 Knowledge Iteration: LLM Wiki + Git, Evolving Knowledge Like Code

Cold-start built scenario maps; continuous iteration keeps them aligned with business changes. Organized as knowledge auto-update, knowledge auto-review, and Git governance : from code changes locate knowledge needing revision, periodically return to original sources to check facts and coverage, all revisions pass same candidate review and release gates. LLM understands changes, verifies evidence, rewrites knowledge; Git carries versions, diffs, merge records, making every revision inspectable and traceable.

Knowledge Auto-Update: From scenario-registered source repos and verification commits. After new commits on target branch, investigate changes between versions, aggregate cross-repo impact by scenario, transform code diffs into knowledge scope needing re-verification. Merge multi-repo evidence into single candidate revision per scenario, sync chains, configs/experiments, DB dependencies, necessary source baselines. Only produce commit when knowledge expression truly changes, then enter unified Git governance.

Knowledge Auto-Review: Periodic source return, check facts and coverage. Tracking diffs only along existing locators may long miss chains outside the map. Each review fixes scenario map and verification version, then expands two directions: item-by-item back to source code and platform to verify recorded interfaces, call relations, bottom dependencies; re-enumerate entries, registration points, callers, strategy implementations to find omissions. Scenarios without recent code commits also checked because runtime controls may change.

Git Governance: Both auto-update and auto-review produce candidates first; release rules decide when they become team-consumable knowledge. Each scenario's maintenance task uses independent candidate branch, workspace, and change review; commits contain only authorized revisions. Retry reuses existing candidates; when main branch advances or candidate commits change, re-sync and check to ensure final merged content matches this round's verified content.

Effect Validation and Improvement Directions

6.1 Overall Evaluation Approach and Foundational Capability Building

Agent knowledge base value must land on coding agent's business delivery help. Using historical real requirements as samples, two evaluations around "quantify benefit, locate gaps, trace improvements":

End-to-End Code Generation Evaluation: Fixed same-batch agent runtime and workflow, compare code output under no knowledge base, RAG vector knowledge base, and LiveX Wiki.

Requirement Routing Evaluation: Layer-by-layer compare business domain, scenario, repository, core chain, check knowledge coverage and localization. Trace execution trajectories to find loss points, letting metrics serve both value judgment and improvement priority.

Both evaluations unify dataset, system under test, and evaluator, recording inputs, outputs, run conditions, execution traces. Dataset manages task and expected results, system executes tasks, evaluator scores per rules. All three versioned separately, enabling re-runs after knowledge/consumption adjustments and attribution of differences.

6.2 End-to-End Code Generation Evaluation: Assessing Knowledge Impact on Code Output

Inputs and ground truth (GT) built from historical requirements, technical designs, actual changes. Inputs restore task requirements; GT describes required business behaviors, key constraints, acceptance points. Same batch uses knowledge supply as core variable, fixed agent runtime/workflow, isolated task context/environment; evaluator scores against output and GT on functional correctness, implementation fit, compatibility safety, engineering quality.

Historical materials used for input and evaluation reference; design checks whether input leaks target implementation to avoid mistaking answer hints for knowledge gains. Since different batches may differ in requirement composition and evaluation conditions, only same-batch controlled results compared, not cross-batch differences.

Results (relative improvement = (solution score / baseline score - 1) × 100%, one decimal):

Two batches: LiveX Wiki comprehensive score vs. no-knowledge-base baseline improved ~54.5% and ~23.8% respectively.

Vs. existing RAG vector knowledge base improved ~44.3% and ~15.9% respectively.

Functional correctness, implementation fit, compatibility safety, engineering quality all show positive changes.

This supports value of organizing knowledge by business scenario to assist agent understanding and implementation, macro-validating LiveX Wiki's benefits.

6.3 Requirement Routing Evaluation: Separating Knowledge Coverage from Localization Ability

Same input/GT construction, annotated target domain, scenario, repository, core chain. Tested agent only performs routing localization; evaluator compares four target sets, computes precision, recall, F1.

First verify which scenarios exist at evaluation time, then see how those requirements localize. Per requirement, GT target scenarios compared with evaluation-time scenario list and file identities:

GT Fully Covered Group: all GT target scenarios covered.

GT Contains Uncovered Group: at least one GT target scenario not covered, distinguishing coverage gaps from localization issues on existing knowledge.

Normalized value = group's dimension F1 / all-tasks same-dimension F1, all-tasks F1 set as baseline 1, two decimals. These are relative ratios, not raw F1 or percentages. E.g., 1.28 means group's dimension F1 ~1.28× overall baseline.

Routing evaluation shows: on covered scenarios LiveX Wiki's localization precision and recall significantly improved, chain F1 reached 1.38 : 0.10 , validating ROI of scenario coverage investment.

6.4 Conclusion: Scores Judge Investment, Trajectories Guide Improvement

Final scores help decide whether to continue investing; execution trajectories decide what to improve next. Stepwise check along requirement understanding, knowledge routing, chain verification, solution implementation, prioritize earliest deviation.

Knowledge Breadth: target scenario knowledge uncovered, or business terminology fails to hit → Targeted scenario coverage supplementation, calibrate scenario index frontmatter fields and aliases

Knowledge Accuracy: locators invalid, or map inconsistent with code/platform → Enhance knowledge timeliness, auto-maintenance, and fact-layer evidence linking

Knowledge Freshness: knowledge acquired sufficiently but inconsistent with fact sources → Improve auto-update via prior fact-source tracing and posterior evaluation calibration

Agent Behavior: scenario selected correctly but knowledge misused or ignored → Build online/offline knowledge consumption observability, targeted analysis and tuning

Evaluation Noise: unstable scores within same batch, or GT ambiguity → Annotation, evaluation rules, manual GT/evaluation review, LLM-assisted analysis

Future plans: controlled ablations on dependency expansion, source verification adjustments to separate quality and cost sources. Each revision lands on specific scenario, relation, or consumption step, re-run affected tasks, letting evaluation results guide modeling, consumption, and maintenance.

Closing: LiveX Wiki's Applicable Boundaries and Limitations

This approach suits cross-repo, cross-platform, continuously changing, repeatedly developed businesses . Upfront investigation accumulated as scenarios enables path reuse in later tasks, maintenance has clear scope. Three transferable methods:

Let requirement changes drive knowledge partitioning. First determine which entries, rules, dependencies jointly support a business behavior, then set scenario boundaries; auto-grouping by repo or technical theme needs extra completion of this layer.

Reuse understood structure, re-confirm current facts. Business map narrows investigation scope; source code and runtime platform decide this task's implementation basis; knowledge version and fact version managed separately.

Align production, consumption, maintenance, and evaluation to same object. Same scenario carries routing, verification, responsibility, revision unit; evaluation losses trace back to specific scenarios and interface chains, making construction investment accumulative.

Limitations mirror the design: scenario boundaries need human involvement, coverage completion requires investment; dependency graph may miss unmodeled relations, model verification depends on source accessibility; Git and CI provide traceability and deterministic checks but cannot guarantee all business judgments correct, so humans must be responsible for knowledge accuracy and act as safety net.

Retaining business understanding gives the next change a reusable starting point; continuous fact verification keeps that starting point trustworthy. Next construction continues around scenario coverage, delivery quality, and maintenance cost, testing whether this knowledge stably helps agents make evidence-based implementation decisions as business evolves.

References

Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks: https://arxiv.org/abs/2005.11401

GraphRAG Official Documentation: https://microsoft.github.io/graphrag/

LightRAG: Simple and Fast Retrieval-Augmented Generation: https://arxiv.org/abs/2410.05779

PageIndex Project: https://github.com/VectifyAI/PageIndex/

LLM Wiki Proposal: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f

Open Knowledge Format Spec: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md

Palantir Ontology Core Concepts: https://www.palantir.com/docs/foundry/ontology/core-concepts

Code example

背景:Coding Agent 离写对业务代码有多远
About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

RAGGitKnowledge BaseEvaluationAI Coding AgentTaobao LiveAgentic SearchLLM WikiOKFLiveX Wiki

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion