RAG 实战|用 StarRocks + DeepSeek 构建智能问答与企业知识库

Ollama 可以在 Windows 上运行了 阅读详情

RAG 和向量索引简介

RAG(Retrieval-Augmented Generation,检索增强生成)是一种结合外部知识检索与 AI 生成的技术,弥补了传统大模型知识静态、易编造信息的缺陷,使回答更加准确且基于实时信息。

1

RAG 的核心流程

  1. 检索(Retrieval)

    1. 用户输入问题后,RAG 从外部数据库(如维基百科、企业文档、科研论文等)检索相关内容。
    2. 检索工具可以是向量数据库、搜索引擎或传统数据库。
  2. 生成(Generation)

    1. 将检索到的相关信息与用户输入一起输入生成模型(如 GPT、LLaMA 等),生成更准确的回答。
    2. 模型基于检索内容“增强”输出,而非仅依赖内部参数化知识。

图片

上图展示了 RAG 的标准流程。首先,图片、文档、视频和音频等数据经过预处理,转换为 Embedding 并存入向量数据库。Embedding 通常是高维 float 数组,借助向量索引(如 HNSW、IVF)进行相似性搜索,加速高效检索。

向量索引通过近似最近邻(ANN)算法优化查询效率,减少高维计算负担。语义搜索匹配用户问题与知识库中的相关内容,使回答基于真实信息,从而降低大模型的“幻觉”风险,提升回答的自然性和可靠性。

StarRocks + DeepSeek 的典型 RAG 应用场景

DeepSeek 负责生成高质量 Embedding 和回答,StarRocks 提供实时高效的向量检索,二者结合可构建更智能、更精准的 AI 解决方案。

1

企业级知识库

适用场景:

  • 企业内部知识库(文档搜索、FAQ)
  • 法律、金融、医药等专业领域问答
  • 代码搜索、软件开发文档查询

方案:

  1. 文档嵌入(DeepSeek 负责): 将企业知识库、FAQ、技术文档等数据转换为向量。

  2. 存储+索引(StarRocks 负责): 使用 HNSW 或 IVFPQ 存储向量存储在 StarRocks 中,支持高效检索。

  3. 检索增强生成(RAG 负责): 用户输入问题 → DeepSeek 生成查询向量 → StarRocks 进行向量匹配 → 返回相关文档 → DeepSeek 结合文档生成最终回答。

2

AI 客服与智能问答

适用场景:

  • 智能客服(银行、证券、电商)
  • 法律、医疗等专业咨询
  • 技术支持自动问答

方案:

  1. 客户对话日志嵌入(DeepSeek 负责): 训练 LLM 处理用户意图,转换历史聊天记录为向量。
  2. 存储+索引(StarRocks 负责): 采用向量索引让客服系统能够高效查找相似案例。
  3. 检索增强(RAG 负责): 结合历史客服对话 + 知识库 + DeepSeek LLM 生成答案。

示例流程:

  • 用户问:“我如何更改银行卡预留手机号?”
  • StarRocks 检索到 3 个最相似的客户服务记录
  • DeepSeek 结合这 3 条历史记录 + 预设 FAQ,生成精准回答

操作演示

系统组成

  • DeepSeek:提供文本向量化(embedding)和答案生成能力
  • StarRocks:高效存储和检索向量数据(3.4+版本支持向量索引)

实现流程

步骤负责组件具体实现
1. 环境准备OllamaStarRocks用 Ollama 在本地机器上便捷地部署和运行大型语言模型
2. 数据向量化DeepSeek-Embedding文本 → 3584 维向量
3. 存储向量StarRocks创建表,存入向量
4. 近似最近邻搜索StarRocks 向量索引IVFPQ / HNSW 检索
5. 检索增强模拟 RAG 逻辑结合检索数据
6. 生成答案DeepSeek LLM生成基于真实数据的回答

1

环境准备

1.1 DeepSeek 本地部署

Tips: 以下内容使用的是 macbook 进行 demo 演示

1.1.1 使用 ollama 安装本地模型

在本地部署 DeepSeek 时,Ollama 主要起到模型管理和提供推理接口的作用,支持运行多个不同的 LLM,并允许用户在本地切换和管理不同的模型。

  • 下载 ollama:https://ollama.com/
  • 安装 deepseek-r1:7b
# 该命令会自动下载并加载模型
ollama run deepseek-r1:7b

图片

Tips: 如果想使用云端 LLM(如 DeepSeek 的官方 API),需要获取并填写 API Key

访问 DeepSeek 官网(https://platform.deepseek.com)后注册账号并登录;在仪表盘中创建 API Key(通常在 “API Keys” 或 “Developer” 部分),复制生成的密钥(如 sk-xxxxxxxxxxxxxxxx)。

1.1.2 Deepseek 初步使用

启动 deepseek

执行 ollama run deepseek-r1:7b 直接进入交互模式

1.1.3 Deepseek 性能优化

直接在命令行设置参数:(参数单次生效)


OLLAMA_GPU_LAYERS=35 \
OLLAMA_CPU_THREADS=6 \
OLLAMA_BATCH_SIZE=128 \
OLLAMA_CONTEXT_SIZE=4096 \
ollama run deepseek-r1:7b

1.1.4 DeepSeek 使用

图片

显而易见:直接使用 deepseek 进行问答,返回的答案是不符合预期的,需要对知识进行修正

1.2 StarRocks 准备工作

1.2.1 集群部署

版本需求:3.4 及以上

1.2.2 配置设置

打开 vector index

ADMIN SET FRONTEND CONFIG ("enable_experimental_vector" = "true");

1.2.3 建库建表

建库:

create database knowledge_base;

建表:存储知识库向量

CREATE TABLE enterprise_knowledge (
    id  BIGINT AUTO_INCREMENT,
    content TEXT NOT NULL,
    embedding ARRAY<FLOAT> NOT NULL,
    INDEX vec_idx (embedding) USING VECTOR (
        "index_type" = "hnsw",
        "dim" = "3584",
        "metric_type" = "l2_distance",
        "M" = "16",
        "efconstruction" = "40"
    )
) ENGINE=OLAP
PRIMARY KEY(id)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES (
    "replication_num" = "1"
    );

Tips: DeepSeek 的 deepseek-r1:7b 模型(7B 参数版本)默认生成高维嵌入向量,通常是 3584 维

2

将文本转成向量

测试通过 deepseek 将文本转为 3584 维向量

curl -X POST http://localhost:11434/api/embeddings -d '{"model": "deepseek-r1:7b", "prompt": "产品保修期是一年。"}'

下面将转化的向量数据保存在 StarRocks 中

3

知识存储(存储向量到 StarRocks)

import pymysql
import requests

def get_embedding(text):
    url = "http://localhost:11434/api/embeddings"
    payload = {"model": "deepseek-r1:7b", "prompt": text}
    response = requests.post(url, json=payload)
    response.raise_for_status()
    return response.json()["embedding"]

try:
    content = "StarRocks 的愿景是能够让用户的数据分析变得更加简单和敏捷。"
    embedding = get_embedding(content)

    # 将 Python 列表转换为 StarRocks 的数组格式
    embedding_str = "[" + ",".join(map(str, embedding)) + "]"# 例如:[0.1,0.2,0.3]

    conn = pymysql.connect(
        host='X.X.X.X',
        port=9030,
        user='root',
        password='sr123456',
        database='knowledge_base'
    )
    cursor = conn.cursor()

    # 使用格式化的数组字符串
    sql = "INSERT INTO enterprise_knowledge (content, embedding) VALUES (%s, %s)"
    cursor.execute(sql, (content, embedding_str))
    conn.commit()
    print(f"Inserted: {content} with embedding {embedding[:5]}...")

except requests.RequestException as e:
    print(f"Embedding API error: {e}")
except pymysql.Error as db_err:
    print(f"Database error: {db_err}")
finally:
    if'cursor'in locals():
        cursor.close()
    if'conn'in locals():
        conn.close()

操作演示

图片

4

知识提取

import pymysql
import requests


# 获取嵌入向量的函数
def get_embedding(text):
    url = "http://localhost:11434/api/embeddings"
    payload = {"model": "deepseek-r1:7b", "prompt": text}
    response = requests.post(url, json=payload)
    response.raise_for_status()
    return response.json()["embedding"]


# 从 StarRocks 查询相似内容的函数
def search_knowledge_base(query_embedding):
    try:
        conn = pymysql.connect(
            host='39.98.110.249',
            port=9030,
            user='root',
            password='sr123456',
            database='knowledge_base'
        )
        cursor = conn.cursor()

        # 将查询向量转换为 StarRocks 的数组格式
        embedding_str = "[" + ",".join(map(str, query_embedding)) + "]"

        # 使用 L2 距离搜索最相似的记录
        sql = """
        SELECT content, l2_distance(embedding, %s) AS distance
        FROM enterprise_knowledge
        ORDER BY distance ASC
        LIMIT 1
        """
        cursor.execute(sql, (embedding_str,))
        result = cursor.fetchone()

        if result:
            return result[0]  # 返回最匹配的 content
        else:
            return"未找到相关信息。"

    except pymysql.Error as db_err:
        print(f"Database error: {db_err}")
        return"查询失败。"
    finally:
        if'cursor'in locals():
            cursor.close()
        if'conn'in locals():
            conn.close()

# 主流程
try:
    query = "StarRocks 的愿景是什么?"
    query_embedding = get_embedding(query)  # 将查询转化为向量
    answer = search_knowledge_base(query_embedding)  # 从知识库检索答案
    print(f"问题: {query}")
    print(f"回答: {answer}")

except requests.RequestException as e:
    print(f"Embedding API error: {e}")
except Exception as e:
    print(f"Error: {e}")

执行效果

图片

补充说明:到目前为止的流程仅依赖 StarRocks 进行向量检索,未利用 DeepSeek LLM 进行生成,导致回答生硬且缺乏上下文整合,影响自然性和准确性。为提升效果,应引入 RAG 机制,使检索结果与生成模型深度融合,从而优化回答质量并减少幻觉问题。

5

加入 RAG 增强

5.1 将查询知识库的结果,返回给 DeepSeek LLM ,优化回答质量

# 构造 RAG Prompt
def build_rag_prompt(query, retrieved_content):
    prompt = f"""
    [系统指令] 你是企业智能客服,基于以下知识回答用户问题:
    [知识上下文] {retrieved_content}
    [用户问题] {query}
    """
    return prompt

# 调用 DeepSeek 生成回答
def generate_answer(prompt):
    url = "http://localhost:11434/api/generate"
    payload = {"model": "deepseek-r1:7b", "prompt": prompt}

    try:
        response = requests.post(url, json=payload)
        response.raise_for_status()

        full_response = ""
        for line in response.text.splitlines():
            if line.strip():  # 过滤空行
                try:
                    json_obj = json.loads(line)
                    if"response"in json_obj:
                        full_response += json_obj["response"]  # 只提取答案
                    if json_obj.get("done", False):
                        break
                except json.JSONDecodeError as e:
                    print(f"JSON 解析错误: {e}, line: {line}")

        return clean_response(full_response.strip())  # 处理并去掉 <think>XXX</think>
    except requests.exceptions.RequestException as e:
        print(f"请求失败: {e}")
        return"生成失败。"

5.2 创建 RAG 过程表:

用于记录用户问题、检索结果和生成回答,保存上下文,方便进行长对话,至于长对话,用户可自行探索。

customer_service_log 表建表语句如下:

CREATE TABLE customer_service_log (
    id BIGINT AUTO_INCREMENT,
    user_id VARCHAR(50),
    question TEXT NOT NULL,
    question_embedding ARRAY<FLOAT> NOT NULL,
    retrieved_content TEXT,
    generated_answer TEXT,
    timestamp DATETIME NOT NULL,
    feedback TINYINT DEFAULT NULL
) ENGINE=OLAP
PRIMARY KEY(id)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES (
    "replication_num" = "1"
);

6

优化后的版本

6.1 知识提取代码

6.1.1 *知识提取*
import pymysql
import requests
import json
from datetime import datetime
import logging
import re


# 获取嵌入向量
def get_embedding(text):
    url = "http://localhost:11434/api/embeddings"
    payload = {"model": "deepseek-r1:7b", "prompt": text,"stream": "true"}
    response = requests.post(url, json=payload)
    response.raise_for_status()
    return response.json()["embedding"]


# 从 StarRocks 检索知识
def search_knowledge_base(query_embedding):
    try:
        conn = pymysql.connect(
            host='X.X.X.X',
            port=9030,
            user='root',
            password='sr123456',
            database='knowledge_base'
        )
        cursor = conn.cursor()
        embedding_str = "[" + ",".join(map(str, query_embedding)) + "]"
        sql = """
        SELECT content, l2_distance(embedding, %s) AS distance
        FROM enterprise_knowledge
        ORDER BY distance ASC
        LIMIT 3
        """
        cursor.execute(sql, (embedding_str,))
        results=cursor.fetchall()
        content=""
        for result in results:
            content+=result[0]
        return  content
    except pymysql.Error as db_err:
        print(f"Database error: {db_err}")
        return"查询失败。"
    finally:
        cursor.close()
        conn.close()

def build_rag_prompt(query, retrieved_content):
    prompt = f"""
    [系统指令] 你是企业智能客服,基于以下知识回答用户问题:
    [知识上下文] {retrieved_content}
    [用户问题] {query}
    """
    return prompt

# 调用 DeepSeek 生成回答
def generate_answer(prompt):
    url = "http://localhost:11434/api/generate"
    payload = {"model": "deepseek-r1:7b", "prompt": prompt}

    try:
        response = requests.post(url, json=payload)
        response.raise_for_status()

        full_response = ""
        for line in response.text.splitlines():
            if line.strip():  # 过滤空行
                try:
                    json_obj = json.loads(line)
                    if"response"in json_obj:
                        full_response += json_obj["response"]  # 只提取答案
                    if json_obj.get("done", False):
                        break
                except json.JSONDecodeError as e:
                    print(f"JSON 解析错误: {e}, line: {line}")

        return clean_response(full_response.strip())  # 处理并去掉 <think>XXX</think>
    except requests.exceptions.RequestException as e:
        print(f"请求失败: {e}")
        return"生成失败。"

# 记录对话日志
def log_conversation(user_id, question, question_embedding, retrieved_content, generated_answer):
    try:
        conn = pymysql.connect(
            host='X.X.X.X',
            port=9030,
            user='root',
            password='sr123456',
            database='knowledge_base'
        )
        cursor = conn.cursor()
        embedding_str = "[" + ",".join(map(str, question_embedding)) + "]"
        sql = """
        INSERT INTO customer_service_log (user_id, question, question_embedding, retrieved_content, generated_answer, timestamp)
        VALUES (%s, %s, %s, %s, %s, NOW())
        """
        cursor.execute(sql, (user_id, question, embedding_str, retrieved_content, generated_answer))
        conn.commit()
    except pymysql.Error as db_err:
        print(f"Database error: {db_err}")
    finally:
        cursor.close()
        conn.close()

def clean_response(text):
    # 去掉所有 <think>xxx</think> 结构
    return re.sub(r"<think>.*?</think>", "", text, flags=re.DOTALL).strip()

# 主流程
def rag_pipeline(user_id, query):
    try:
        logging.info(f"开始处理查询: {query}")

        query_embedding = get_embedding(query)
        logging.info("获取嵌入向量成功")

        retrieved_content = search_knowledge_base(query_embedding)
        logging.info(f"检索到内容: {retrieved_content[:50]}...")  # 只展示前50字符

        prompt = build_rag_prompt(query, retrieved_content)
        generated_answer = generate_answer(prompt)
        logging.info(f"生成回答: {generated_answer[:50]}...")

        log_conversation(user_id, query, query_embedding, retrieved_content, generated_answer)
        logging.info("日志记录完成")

        return generated_answer
    except Exception as e:
        logging.error(f"发生错误: {e}", exc_info=True)
        return"处理失败。"

# 测试
if __name__ == '__main__':

    logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")

    user_id = "user123"
    query = "StarRocks 的愿景是什么?"
    answer = rag_pipeline(user_id, query)
    print(f"问题: {query}")
    print(f"回答: {answer}")
*6.1.2 操作演示*

图片

总结一下 RAG 增强后的执行流程:

  • 输入:用户输入问题
  • 数据向量化:DeepSeek Embedding
  • StarRocks 向量索引,在 enterprise_knowledge 表中检索最相似的知识
  • 增强(Augmentation):将检索结果与问题组合成 Prompt,传递给 DeepSeek
  • 生成回答:调用 DeepSeek 生成增强后的回答
  • 记录日志:将问题、检索结果和生成回答存入 customer_service_log
  • 返回结果:将生成的回答返回给用户

6.2 加上 web 可视化界面

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能问答客服系统</title>
    <script>
        async functionaskQuestion() {
            let question = document.getElementById("question").value;
            let response = await fetch("/ask", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({ question: question })
            });
            let data = await response.json();
            document.getElementById("answer").innerText = data.answer;
        }
    </script>
</head>
<body>
    <h1>智能问答客服系统</h1>
    <input type="text" id="question" placeholder="请输入您的问题">
    <button onclick="askQuestion()">提问</button>
    <p id="answer"></p>
</body>
</html>

6.3 完整问答后台服务代码

6.3.1 代码结构如下
图片
6.3.2 知识存储代码
import pymysql
import requests

def get_embedding(text):
    url = "http://localhost:11434/api/embeddings"
    payload = {"model": "deepseek-r1:7b", "prompt": text}
    response = requests.post(url, json=payload)
    response.raise_for_status()
    return response.json()["embedding"]

try:
    content = "StarRocks 的愿景是能够让用户的数据分析变得更加简单和敏捷。"
    embedding = get_embedding(content)

    # 将 Python 列表转换为 StarRocks 的数组格式
    embedding_str = "[" + ",".join(map(str, embedding)) + "]"# 例如:[0.1,0.2,0.3]

    conn = pymysql.connect(
        host='X.X.X.X',
        port=9030,
        user='root',
        password='sr123456',
        database='knowledge_base'
    )
    cursor = conn.cursor()

    # 使用格式化的数组字符串
    sql = "INSERT INTO enterprise_knowledge (content, embedding) VALUES (%s, %s)"
    cursor.execute(sql, (content, embedding_str))
    conn.commit()
    print(f"Inserted: {content} with embedding {embedding[:5]}...")

except requests.RequestException as e:
    print(f"Embedding API error: {e}")
except pymysql.Error as db_err:
    print(f"Database error: {db_err}")
finally:
    if'cursor'in locals():
        cursor.close()
    if'conn'in locals():
        conn.close()
6.3.3 知识提取
import pymysql
import requests
import json
import logging
import re
from flask import Flask, request, jsonify, render_template

app = Flask(__name__)

# 配置日志
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")


# 获取嵌入向量
def get_embedding(text):
    url = "http://localhost:11434/api/embeddings"
    payload = {"model": "deepseek-r1:7b", "prompt": text, "stream": "true"}
    response = requests.post(url, json=payload)
    response.raise_for_status()
    return response.json()["embedding"]


# 从 StarRocks 检索知识
def search_knowledge_base(query_embedding):
    try:
        conn = pymysql.connect(
            host='X.X.X.X',
            port=9030,
            user='root',
            password='sr123456',
            database='knowledge_base'
        )
        cursor = conn.cursor()
        embedding_str = "[" + ",".join(map(str, query_embedding)) + "]"
        sql = """
        SELECT content, l2_distance(embedding, %s) AS distance
        FROM enterprise_knowledge
        ORDER BY distance ASC
        LIMIT 3
        """
        cursor.execute(sql, (embedding_str,))
        results=cursor.fetchall()
        content=""
        for result in results:
            content+=result[0]
        # result = cursor.fetchone()
        return  content
    except pymysql.Error as db_err:
        print(f"Database error: {db_err}")
        return"查询失败。"
    finally:
        cursor.close()
        conn.close()


# 构造 RAG Prompt
def build_rag_prompt(query, retrieved_content):
    return f"""
    [系统指令] 你是企业智能客服,基于以下知识回答用户问题:
    [知识上下文] {retrieved_content}
    [用户问题] {query}
    """


# 调用 DeepSeek 生成回答
def generate_answer(prompt):
    url = "http://localhost:11434/api/generate"
    payload = {"model": "deepseek-r1:7b", "prompt": prompt}

    try:
        response = requests.post(url, json=payload)
        response.raise_for_status()

        full_response = ""
        for line in response.text.splitlines():
            if line.strip():
                try:
                    json_obj = json.loads(line)
                    if"response"in json_obj:
                        full_response += json_obj["response"]
                    if json_obj.get("done", False):
                        break
                except json.JSONDecodeError as e:
                    logging.warning(f"JSON 解析错误: {e}, line: {line}")

        return clean_response(full_response.strip())  # 处理并去掉 <think>XXX</think>
    except requests.exceptions.RequestException as e:
        logging.error(f"请求失败: {e}")
        return"生成失败。"


# 记录对话日志
def log_conversation(user_id, question, question_embedding, retrieved_content, generated_answer):
    try:
        conn = pymysql.connect(
            host='X.X.X.X',
            port=9030,
            user='root',
            password='sr123456',
            database='knowledge_base'
        )
        cursor = conn.cursor()
        embedding_str = "[" + ",".join(map(str, question_embedding)) + "]"
        sql = """
        INSERT INTO customer_service_log (user_id, question, question_embedding, retrieved_content, generated_answer, timestamp)
        VALUES (%s, %s, %s, %s, %s, NOW())
        """
        cursor.execute(sql, (user_id, question, embedding_str, retrieved_content, generated_answer))
        conn.commit()
    except pymysql.Error as db_err:
        logging.error(f"数据库错误: {db_err}")
    finally:
        cursor.close()
        conn.close()


# 清理回答内容,去掉 <think>XXX</think>
def clean_response(text):
    return re.sub(r"<think>.*?</think>", "", text, flags=re.DOTALL).strip()


# RAG 处理流程
def rag_pipeline(user_id,query):
    try:
        logging.info(f"开始处理查询: {query}")

        query_embedding = get_embedding(query)
        logging.info("获取嵌入向量成功")

        retrieved_content = search_knowledge_base(query_embedding)
        logging.info(f"检索到内容: {retrieved_content[:50]}...")  # 只展示前50字符
        
        prompt = build_rag_prompt(query, retrieved_content)

        generated_answer = generate_answer(prompt)
        logging.info(f"生成回答: {generated_answer[:50]}...")

        log_conversation(user_id, query, query_embedding, retrieved_content, generated_answer)
        logging.info("日志记录完成")

        return generated_answer
    except Exception as e:
        logging.error(f"发生错误: {e}", exc_info=True)
        return"处理失败。"


# Flask API
@app.route("/")
def index():
    return render_template("index.html")  # 渲染前端页面

@app.route("/ask", methods=["POST"])
def ask():
    user_id="sr_01"
    data = request.json
    question = data.get("question", "")

    result=rag_pipeline(user_id,question)
    answer = f"问题:{question}。\n 回答:{result}"

    return jsonify({"answer": answer})


if __name__ == "__main__":
    user_id = "sr"
    app.run(host="0.0.0.0", port=9033, debug=True)
6.3.4 *效果演示*

图片

图片

如何零基础入门 / 学习AI大模型?

大模型时代,火爆出圈的LLM大模型让程序员们开始重新评估自己的本领。 “AI会取代那些行业?”“谁的饭碗又将不保了?”等问题热议不断。

不如成为「掌握AI工具的技术人」,毕竟AI时代,谁先尝试,谁就能占得先机!

想正式转到一些新兴的 AI 行业,不仅需要系统的学习AI大模型。同时也要跟已有的技能结合,辅助编程提效,或上手实操应用,增加自己的职场竞争力。

但是LLM相关的内容很多,现在网上的老课程老教材关于LLM又太少。所以现在小白入门就只能靠自学,学习成本和门槛很高

那么我作为一名热心肠的互联网老兵,我意识到有很多经验和知识值得分享给大家,希望可以帮助到更多学习大模型的人!至于能学习到多少就看你的学习毅力和能力了 。我已将重要的AI大模型资料包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来。

这份完整版的大模型 AI 学习资料已经上传优快云,朋友们如果需要可以微信扫描下方优快云官方认证二维码免费领取【保证100%免费】

👉 福利来袭优快云大礼包:《2025最全AI大模型学习资源包》免费分享,安全可点 👈

全套AGI大模型学习大纲+路线

AI大模型时代的学习之旅:从基础到前沿,掌握人工智能的核心技能!

read-normal-img

640套AI大模型报告合集

这套包含640份报告的合集,涵盖了AI大模型的理论研究、技术实现、行业应用等多个方面。无论您是科研人员、工程师,还是对AI大模型感兴趣的爱好者,这套报告合集都将为您提供宝贵的信息和启示。

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

👉学会后的收获:👈
• 基于大模型全栈工程实现(前端、后端、产品经理、设计、数据分析等),通过这门课可获得不同能力;

• 能够利用大模型解决相关实际项目需求: 大数据时代,越来越多的企业和机构需要处理海量数据,利用大模型技术可以更好地处理这些数据,提高数据分析和决策的准确性。因此,掌握大模型应用开发技能,可以让程序员更好地应对实际项目需求;

• 基于大模型和企业数据AI应用开发,实现大模型理论、掌握GPU算力、硬件、LangChain开发框架和项目实战技能, 学会Fine-tuning垂直训练大模型(数据准备、数据蒸馏、大模型部署)一站式掌握;

• 能够完成时下热门大模型垂直领域模型训练能力,提高程序员的编码能力: 大模型应用开发需要掌握机器学习算法、深度学习框架等技术,这些技术的掌握可以提高程序员的编码能力和分析能力,让程序员更加熟练地编写高质量的代码。

👉 福利来袭优快云大礼包:《2025最全AI大模型学习资源包》免费分享,安全可点 👈

img

这份完整版的大模型 AI 学习资料已经上传优快云,朋友们如果需要可以微信扫描下方优快云官方认证二维码免费领取【保证100%免费】

作为普通人,入局大模型时代需要持续学习和实践,不断提高自己的技能和认知水平,同时也需要有责任感和伦理意识,为人工智能的健康发展贡献力量。

DeepSeek本地部署详细指南 通过上述步骤,你可以在本地成功部署DeepSeek模型,并通过Ollama或Open Web UI与模型进行交互。本地部署不仅能够保护数据隐私,还能根据需求灵活调整模型参数,满足不同场景下的使用需求。如果你在部署过程中遇到任何问题,可以在评论区留言,我们将一起解决。希望这篇教程能帮助你顺利部署DeepSeek模型,开启高效开发的新旅程! 阅读详情

相关推荐

数据库语义查询编译器:让LLM原生理解SQL与业务知识

数据库作为企业核心数据资产,其结构化、强一致性、高安全性特征决定了AI赋能不能依赖外部向量检索或黑盒大模型封装。真正的智能应源于对Schema语义的深度理解与实时查询编译能力——即让自然语言提问自动转化为可审计、可追溯、带权限控制与质量校验的标准化SQL。该范式以语义图谱构建为基础,通过查询编译层(SQC)实现意图解析、Schema感知生成与执行态知识注入,并依托Model Context Protocol(MCP)保障调用可追踪、错误可定位、知识可版本化。它不迁移数据、不改造内核、不牺牲实时性,适用于Or

chouzu8463的博客 417

一文彻底整明白,基于Ollama工具的LLM大语言模型Web可视化对话机器人部署指南

在上一篇博文中,我们在本地部署了**Llama 3 8B**参数大模型,并用 Python 写了一个控制台对话客户端,基本能愉快的与 Llama 大模型对话聊天了。但控制台总归太技术化,体验不是很友好,我们希望能有个类似 ChatGPT 那样的 Web 聊天对话界面,本博文就安排起来……

老牛啊 1万+

LLM的MCP协议:初识MCP,搭建第一个MCP Server

MCP(Model Context Protocol),是一个开发的协议,标准化了应用程序如何为大模型提供上下文。MCP提供了一个标准的为LLM提供数据、工具的方式,使用MCP会更容易的构建Agent或者是基于LLM的复杂工作流。

Criss@陈磊 2万+

使用ollama在本地部署llama3-8b大模型

使用ollama在本地部署llama3-8b大模型

weixin_39945822的博客 1万+

大模型系列——RAG 实战用 StarRocks + DeepSeek 构建智能问答与企业知识库

RAG(Retrieval-Augmented Generation,检索增强生成)是一种结合外部知识检索与 AI 生成的技术,弥补了传统大模型知识静态、易编造信息的缺陷,使回答更加准确且基于实时信息。

2401_84052244的博客 191

win11本地部署openclaw实操第1集

OpenClaw 是一款开源、本地优先、可自托管的 AI 智能体(AI Agent)网关 / 自动化框架,核心是让 AI 从 “只聊天、给建议” 变成 “能在你电脑上真做事” 的数字助手。

weixin_44626085的博客 7129

【RAG 实战】用 StarRocks + DeepSeek 构建智能问答与企业知识库

RAG(Retrieval-Augmented Generation)是一种结合信息检索与生成式大语言模型(LLM)的技术框架,通过从外部知识库检索相关信息,并将检索结果作为上下文输入LLM,从而提升生成内容的准确性和相关性。其核心目标是解决大模型的知识局限性(如幻觉、时效性差、私有知识缺失等问题。

EnjoyEDU的博客 1598

一文说清STM32CubeMX中文汉化全流程(图解说明)

详细讲解STM32CubeMX中文汉化的完整流程,通过图文并茂的方式手把手教学,解决界面英文带来的使用障碍,让开发更高效。掌握stm32cubemx中文汉化技巧,提升嵌入式开发体验。

weixin_42499004的博客 6288

StarRocks Community Monthly Newsletter (May)

StarRocks近期发布多个版本更新与社区动态:3.5.0-RC01版本重点优化存算分离、数据湖分析功能,新增查询优化和安全管理特性;3.3.14版本修复了JSON处理、物化视图死锁等关键问题。社区贡献者开发了StarRocks查询预览工具和授权集成接口服务。技术文档新增异步物化视图支持索引等内容,并精选了多篇实践文章和视频教程。值得关注的是,StarRocks GitHub星标突破1万,举办了AI应用主题直播活动,同时表彰了5月社区答疑之星。相关资源可通过官方链接获取。

StarRocks的博客 1128

AIOps智能运维:从数据治理到故障自愈的实践指南

AIOps(智能运维)通过融合人工智能与运维管理,构建了感知-决策-执行的闭环体系。其核心技术包括多维度数据采集、机器学习算法和自动化执行,显著提升了告警治理、故障定位和容量预测的效率。在数据层,全量性、实时性的数据采集是基础,而算法层的异常检测和根因分析则依赖统计方法、孤立森林和LSTM等模型。AIOps尤其适用于处理告警风暴和复杂系统故障,如在电商大促中通过K-Means聚类减少92%的告警量。随着云原生和边缘计算的普及,AIOps正逐步实现与Service Mesh、Serverless等技术的深度集

weixin_30175731的博客 289

什么是深度展开网络?如何将迭代算法的每一次迭代展开成深度网络对应的一层?深度展开网络进行端对端训练,其中端对端是什么意思?

在深度学习和机器学习的背景下,“端到端”(End-to-end)训练指的是将输入数据直接映射到最终输出的过程,而不需要任何中间的手动数据预处理或特征工程。- **自然语言处理**:端到端自然语言处理系统可以将自然语言输入直接转化为计算机可理解的语言输出,而不需要对语言进行分解和转化。- **推荐系统**:通过使用深度神经网络,端到端推荐系统可以直接根据用户历史行为预测其未来的兴趣爱好,并推荐相应的产品或服务。4. **直接映射**:从输入到输出的直接映射,中间没有任何拆分或分解的过程。

m0_67897882的博客 5440

ChatBI + DeepSeek 学习

ChatBI 是一款基于大语言模型(LLM)打造的智能数据问答产品,提供意图识别、知识召回、问题理解、数据查询、可视化生成等能力。用户通过自然语言提问,便可获取数据分析结果,实现敏捷决策。有效解决了传统BI的灵活性和门槛问题;DeepSeek-R1模型通过强化学习提升推理能力,支持复杂任务处理,并且具有低成本和高效率等特点。

wangqiaowq的博客 1058

DDR为什么需要DQS信号?

本文根据相关书籍和个人经验,谈了一下对DDR中DQS信号作用的理解

weixin_41155581的博客 2万+

DB-GPT 完整上手:用一句自然语言查询搞定智能数据分析

周五下午五点,老板在群里丢来一句:"明天要各门店的月度销售分析,带趋势图。"你打开数据库,导了几张表,写 SQL 对到七点,再用 Python 清洗、画图、排版,凌晨一点才把第一版报告发出去。这样的"取数-加工-出图"循环,几乎每个数据同学都经历过。DB-GPT 就是想终结这种苦力的开源项目:它是一个智能代理 AI 数据助手,你用自然语言提问,它自己写 SQL、跑代码、生成图表和 HTML 报告,

gitblog_00247的博客 858

Multisim 11.0的安装破解汉化步骤

15:打开注册机,选择管理员运行,默认第一项,选择生成文件路径,这里不要随意选择,要找到你安装Multisim安装路径下Shard下的License Manager路径下,否则会报错,破解失败。14:后面会出现一个更新提示,选择否,然后选择重启电脑后,先不要选择重启电脑,在这里出现了问题(可能敲击回车,默认去重启电脑了),所以我说不要重启电脑,重启破解时右下角出现这,点击否。17:重启电脑,如果前面重启过,那可以跳过重启,应用程序下找到下图所示,启动。16:点击确认覆盖,路径下生成了该文件。

qq_53260940的博客 2377

避坑指南:Qgis等时圈分析中ORS插件Key申请与参数设置的常见错误

本文详细解析了QGIS等时圈分析中ORS插件从API密钥申请到参数优化的全流程避坑指南。针对密钥激活、出行模式选择、时空参数设置等七个高频故障点,提供了实用的调试方案和优化技巧,帮助用户高效完成空间可达性分析。

weixin_42546508的博客 304

DB-GPT 完整实战:接入你的数据库,用大白话提问,让 AI 替你写 SQL

DB-GPT 是一个开源的 AI 数据分析助手:把数据库或本地 Excel 文件接进来,用自然语言提问,它自己编写 SQL 和 Python 代码去查数、算指标,最后产出图表和报告。这篇文章带你走完从安装启动、接入数据源,到跑通第一次查询、再到部署上线的完整路线,顺带讲清楚它背后的沙箱和工作流引擎是怎么回事。 [![DB-GPT 开源 AI 数据分析助手整体架构](https://raw.git

gitblog_00330的博客 415

GEE 案例分析:利用Landsat数据进行FAI、NDVI及CHLA分析并统计平均值(巢湖为例)

浮游藻类指数(FAI)、归一化植被指数(NDVI)及叶绿素a(CHLA)是水体环境监测的重要指标。本文利用Google Earth Engine(GEE)平台,基于Landsat 5和Landsat 8数据,进行水体藻类及植被监测。

此星光明博客 1336

DB-GPT:用一句自然语言查数据库,AI 负责写 SQL、跑分析、出报告

DB-GPT 是一个开源的 AI 数据助手:你用自然语言描述业务问题,它负责写 SQL 查询、执行 Python 分析,最后把图表和报告交到你手上。它面向的是想查数据库、做数据分析,但不会写代码的业务人员、数据分析师和开发者。 [![DB-GPT AI 数据助手整体架构:从数据输入到自动化分析交付](https://raw.gitcode.com/GitHub_Trending/db/DB-GP

gitblog_00787的博客 368

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

腾讯音乐开源ChatBI + Headless BI平台SuperSonic全面使用指南

SuperSonic 开源AI+BI平台使用指南摘要 SuperSonic是腾讯音乐开源的下一代AI+BI平台,融合ChatBI(LLM驱动)与HeadlessBI(语义层驱动)两大范式。本指南涵盖从部署到应用的全流程: 核心架构 六层架构:前端层→API网关→聊天智能层→语义层→LLM集成→数据访问 双阶段查询:自然语言解析为S2SQL→语义层翻译为物理SQL执行 关键技术:Schema感知、RAG增强、自一致性投票优化 部署方式 Docker Compose(推荐):一键启动完整服务 Release包:

xyghehehehe的专栏 901

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

大模型入门实战:通过 HuggingFace 调用 Llama3

至此,我们成功演示了如何通过 Hugging Face 的 Transformers 调用 Llama 模型,并获取了模型的回答。但是如果你的需求只是简单地调用模型,而无需进行微调或复杂的部署,可以尝试使用 Ollama。它不仅操作更加便捷,还提供了开箱即用的 RESTful 接口,适合快速集成到生产环境中。下一篇,我将会讲解如何通过 Ollama 下载部署 Llama 模型并调用。

python12345_的博客 2604

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

上一篇: 吴恩达教授亲自力荐的大模型书籍,我想不出哪本书比这本更值得一读!
下一篇: RAG 与 MCP 如何以不同方式解决大模型的局限性
爱喝白开水a
博客等级 码龄3年 6793粉丝 763原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值