How to Build and Manage a High‑Quality Enterprise Knowledge Base for AI‑Powered Q&A
This guide explains why a well‑structured, permission‑controlled enterprise knowledge base is essential for AI‑driven Q&A, outlines document format and naming standards, describes multi‑document organization principles, and provides step‑by‑step instructions for creating and managing knowledge bases in the Cloud Native environment.
Prerequisites
Applicable versions: Tongyi Lingma Enterprise Standard and Enterprise Exclusive editions.
Applicable personnel: Knowledge‑base administrators and global administrators (Exclusive edition).
Typical Use Cases
Free‑form Q&A for onboarding, security compliance, product troubleshooting, and internal API usage.
Code optimization and generation that follows corporate coding standards and security guidelines.
Building a High‑Quality Knowledge Base
To maximise the benefit of retrieval‑augmented generation, follow these practices:
Provide AI‑friendly, accurate data: Upload up‑to‑date documents or code snippets; outdated or incorrect information will degrade model performance.
Design a structured, permission‑isolated repository: Separate knowledge domains, enforce clear visibility scopes, and avoid chaotic permission settings that could cause data‑leak risks.
Document Format Requirements
Supported formats: PDF, CSV, DOCX, TXT, Markdown (recommended).
Size limits: Up to 10 files per upload, each not exceeding 10 MB.
Single‑Document Standards
Encoding: Use UTF‑8.
Naming: Keep names concise, distinct, and free of ambiguous abbreviations or symbols.
Structure: Use multi‑level headings; avoid long paragraphs; list definitions and terms on separate lines.
Good vs. Bad Naming Examples
Bad: "编码规范", "安全规范1", "SR3" – vague and easily confused.
Good: "Java Language Programming Specification", "API Data Security Management Specification", "Cloud Account Security Usage Guidelines" – clear scope and content.
Document Hierarchy and Sections
Layered headings: Organise content with clear, distinct headings at each level.
Consistent terminology: Use the same terms across documents to maintain uniformity.
Comprehensive coverage: Ensure high‑frequency knowledge is present; regularly audit and update the repository.
Multi‑Document Guidelines
Knowledge independence: Each document should contain unique, non‑redundant information.
Knowledge aggregation: Group related topics together to improve cohesion.
Uniform standards: Apply a shared style guide and terminology across all files.
Full coverage: Cover all necessary topics and keep the knowledge base up‑to‑date.
Knowledge‑Base Permission Management
Permissions are defined by content theme and visible members.
Create a public‑visible knowledge base for all authorized developers, or a private one limited to specific teams.
In the Tongyi Lingma admin console, select Knowledge Management → New Knowledge Base , choose the "Intelligent Q&A" scenario, and set the visibility to Private – Only Knowledge‑Base Members .
Manage members by adding or removing developers in the "Visible Members" list; ensure each member only accesses knowledge relevant to their role.
Important Notes
Private visibility protects data isolation and privacy while reducing noise for users.
Regularly review member permissions to maintain security and relevance.
Document Examples and Formatting Guidance
Below are examples of poorly structured documents and their improved versions. Use these patterns to minimise retrieval noise.
《AK安全使用规范》
【目录】
关键词:AK、安全规范、Access Key
一、 定义
Access Key(简称AK),是用于身份验证的一种密钥对,由Access Key ID 和 Access Key Secret 组成。它允许用户通过API调用安全地访问系统服务。本规范旨在明确AK的使用规则,确保系统的安全性与稳定性。Access Key ID是代表用于标识用户的身份。Access Key Secret是代表用于加密签名,保证请求的唯一性和不可抵赖性。
二、 使用原则
确保Access Key Secret的保密性,不得泄露给任何未经授权的第三方。遵循最小权限原则授予API调用权限,仅授予完成任务所必需的权限。定期每90天更换Access Key Secret。记录AK的使用情况,并定期审查使用日志,确保没有异常行为,以及在不需要时及时撤销其权限。
三、 安全实践
为确保访问密钥(AK)的安全,我们实施了以下简化的安全实践:在生产环境中,我们优先使用环境变量存储AK,避免硬编码;通过配置管理系统统一管理AK,防止其在代码中的直接暴露。同时,我们对日志进行过滤,确保AK的Secret信息不会被记录。我们还定期进行权限审查,确保AK仅拥有执行必要操作所需的最低权限。此外,建立了异常检测机制,以便快速识别并响应任何可疑的AK使用活动。这些措施共同保障了AK的安全和合理使用。
四、 API调用示例
● 示例1
Node.js中使用AK/SK进行API调用:在Node.js中,可以使用axios库来发送API请求,并在请求头中包含AK和SK。例如,使用AK和SK进行签名认证的API请求可能如下所示:
【示例代码块】
● 示例2
Python中使用AK/SK调用API:在Python中,可以使用requests库来发送带有AK和SK的API请求。以下是一个示例代码,展示了如何构建请求并添加签名:
【示例代码块】 《AK安全使用规范》
/*
去除干扰元素:文章开头的目录、关键词等无需召回的内容可以删除,以减少干扰。
专业名词解释:专业名词及其解释应以条目形式列出,以便于模型更好地查找和理解。
*/
一、 定义
● Access Key(简称AK):是用于身份验证的一种密钥对,由Access Key ID 和 Access Key Secret 组成,它允许用户通过API调用安全地访问系统服务。
● Access Key ID:用于标识用户的身份。
● Access Key Secret:用于加密签名,保证请求的唯一性和不可抵赖性。
/*
避免使用大段落陈述,建议采用分点陈述的方式,以便模型更容易理解
*/
二、 使用原则
● 保密性:Access Key Secret 必须严格保密,不得泄露给任何未经授权的第三方。
● 最小权限:授予API调用的权限应遵循最小权限原则,仅授予完成任务所必需的权限。
● 定期轮换:定期更换Access Key Secret,推荐每90天更换一次。
● 监控与审计:记录AK的使用情况,并定期审查使用日志,确保没有异常行为。
● 及时撤销:当不再需要使用某个AK时,应及时撤销其权限。
三、 安全实践
● 环境变量:在生产环境中,使用环境变量而非硬编码的方式存储AK。
● 配置管理:使用配置管理系统来管理AK,避免直接在代码中出现。
● 日志过滤:确保日志记录中不会出现Access Key Secret。
● 权限审查:定期检查AK的权限设置,确保符合最小权限原则。
● 异常检测:建立异常检测机制,及时发现并处理可疑活动。
/*
关于API调用示例部分,示例层级的名字不清晰,需要修改为具体的示例名称
*/
四、API调用示例
● Node.js中使用AK/SK进行API调用示例
在Node.js中,可以使用axios库来发送API请求,并在请求头中包含AK和SK。例如,使用AK和SK进行签名认证的API请求可能如下所示:
【示例代码块】
● Python中使用AK/SK调用API示例
在Python中,可以使用requests库来发送带有AK和SK的API请求。以下是一个示例代码,展示了如何构建请求并添加签名:
【示例代码块】Special Content Handling
Tables: First row must be a header; avoid embedding images or compressed files; keep layout single‑column.
Images: Prefer textual description; if images contain essential information, transcribe the text and add a clear caption.
Other media: Avoid audio/video; keep documents plain text for reliable parsing.
Reference Links
Enterprise Code Completion Enhancements – https://help.aliyun.com/zh/lingma/use-cases/enterprise-code-completion-enhancements-beta-usage-practices
Enterprise Knowledge‑Base Q&A – https://help.aliyun.com/zh/lingma/user-guide/enterprise-knowledge-base-q-a
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
