Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🛡️ Enterprise Copilot - Intelligent Data Assistant

Python FastAPI DeepSeek Milvus Security

Enterprise Copilot 是一个面向企业级场景的智能数据助手核心引擎。它旨在解决企业内部“非结构化文档”与“结构化业务数据”的统一交互难题,并提供了严格的数据权限控制 (RBAC)

⚠️ Disclaimer: 本仓库为校企合作项目的 核心逻辑脱敏演示版 (Core Logic Demo)。不包含真实的业务数据与企业私有密钥。

✨ 核心特性 (Key Features)

1. 📊 Data Analysis Agent (Text-to-SQL)

基于 DeepSeek-Coder 构建的数据库查询智能体,实现了从自然语言到 SQL 的精准转换。

  • Schema Linking: 智能提取 Query 中的关键实体,仅加载相关表结构进入 Context,减少噪声。
  • Few-shot Prompting: 动态注入高频业务场景的 SQL 示例 (Few-shot),将生成准确率提升至 90%+
  • Self-Correction Loop: 具备“执行-报错-自动修复”闭环能力。当 SQL 执行失败时,Agent 会捕获数据库 Error Log 并回传给模型进行 Self-Debug

2. 🔐 Permission-Aware RAG (权限感知检索)

针对企业数据安全要求,设计了基于角色的访问控制 (RBAC) 检索链路。

  • Pre-filtering Strategy: 摒弃低效的后置过滤,在向量检索阶段注入 Metadata 过滤条件 expr="array_contains(access_list, user_role)"
  • Zero-Trust Retrieval: 确保 AI 只能“看到”当前用户有权访问的知识切片,从根源杜绝数据越权泄露。

3. 📄 Multi-modal ETL Pipeline

  • PaddleOCR Integration: 集成 OCR 引擎处理扫描件 PDF 与图片文档。
  • Markdown Reformatting: 利用 LLM 的语义理解能力,重构复杂的跨页表格与多栏排版,建立标准化的知识入库流水线。

🏗️ 系统架构 (Architecture)

Text-to-SQL Workflow

graph LR
    User[User Query] --> Schema[Schema Linking]
    Schema --> Prompt[Few-shot Prompt]
    Prompt --> LLM[DeepSeek-Coder]
    LLM -- Generate SQL --> Exec{Execute SQL}
    Exec -- Success --> Result[Return Data]
    Exec -- Error --> Debug[Self-Correction]
    Debug -- Error Log --> LLM
Loading

About

Enterprise-grade Intelligent Assistant featuring Text-to-SQL (Self-Correction) and Permission-Aware RAG (RBAC). Powered by DeepSeek-Coder & FastAPI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages