Skip to content

LightRAG MCP

Server:user-daniel_lightrag_mcp / daniel_lightrag_mcp
底层服务:Serve · LightRAG

跨会话知识库,承担工作流 P0 检索P2.5 存储P3 里程碑入库

日常工具

工具阶段说明
query_textP0mode: hybrid默认 only_need_context: true
insert_textP2.5/P3正文首部 [tags: …] [type: …] [date: …]
insert_textsP2.5批量;每项 title + content + 可选 metadata
get_track_statusP2.5/P3里程碑入库必须 track 确认
check_entity_existsP2.5「记住 / 更新决策」时可选检查

query_text 参数

参数推荐值说明
query从用户输入提取关键词自然语言问句
modehybrid实体局部 local,全局 global,简单 naive
only_need_contexttrue(必须显式传)只取上下文;用户要求直接回答时传 false

insert_text 正文格式

[tags: decision,api] [type: decision] [date: 2026-06-10]
<决策正文>

里程碑 tags

必须 track可跳过 track
decision, api, preference, plan, ui, architecturebrainstorming, debug, note, wip

upload_document 一律必须 track。

按需工具

工具何时用
upload_document文件入库
get_documents / get_documents_paginated浏览文档列表
get_document_status_counts运维统计
get_knowledge_graph / get_graph_labels结构审查
scan_documents触发扫描
get_health连续 2 次失败后诊断;非每会话
get_pipeline_status流水线状态
update_entity / update_relation改图谱(需 ID);改正文用新 insert_text
delete_document / delete_entity / delete_relation运维清理(须用户确认)
query_text_stream长回答场景

显式触发(硬门闩)

用户消息含 知识库 / LightRAG / daniel_lightrag第一步 query_text,先于读代码、P1、实现。

故障诊断

同任务内 query_text / insert_text 连续 2 次失败get_health → 仍失败则跳过知识库步骤。

使用示例

text
按知识库实现用户登录 API
text
记住:项目数据库使用 PostgreSQL,端口 5432
text
查一下我们之前关于 page-structure 的决策

相关