建议支持“本地/自定义代码知识库(RAG)”:优先检索成熟脚本复用,未命中时再调用 AI 生成
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 719
- Avg merge
- 4h 30m
- Merged PRs (30d)
- 83
Description
反馈内容:
目前在日常开发中,许多通用工具函数、自动化脚本、规范模板或团队内部组件是高度标准化的。若 AI 每次接收到指令都全量从零编写代码,存在以下问题:
生成延迟与效率折损: 对于完全可以用现有代码解决的任务,等待 AI 逐步生成耗时较长。
积分与 Token 浪费: 频繁生成标准模板或常见脚本消耗了不必要的计算资源与积分。
团队规范不统一: 全新生成的代码风格容易出现偏差,无法完全对齐已有的最佳实践。
建议引入 代码知识库检索机制(Code Snippet / Repo RAG),建立“先检索复用,后补充生成”的工作流。
期望效果:
知识库构建与导入(Knowledge Base / Snippet Index):
支持用户将常用脚本库、企业内部公用组件库、标准化代码片段(Snippets)导入为本地或云端专属知识库,并建立语义索引。
“检索优先,生成兜底”的执行策略:
当用户提出开发需求时,AI 优先在知识库中进行语义检索与匹配:
完全/高度命中: 直接调用或仅对现有成熟脚本做轻量微调并返回,大幅降低响应延迟与积分消耗。
未命中或需求复杂: 自动回退至完整的大模型代码生成流程。
沉淀闭环:
允许用户在对话中一键将调试成功的优质脚本或代码块“保存至知识库”,使知识库能够随着日常使用不断丰富。
我的 UID: 01a013fb-7152-7083-9f1d-40fd321b162a
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not identify any files, tests, or entry points. Start by locating the existing AI request flow and any knowledge-base, indexing, or conversation persistence components, then determine how local or cloud code sources, semantic retrieval, fallback generation, and saving successful snippets would integrate. Done would require an agreed design and an end-to-end implementation of the proposed workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, backend, search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100