惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
WordPress大学
WordPress大学
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
博客园 - 司徒正美
J
Java Code Geeks
博客园 - 叶小钗
美团技术团队
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Cloudflare Blog
腾讯CDC
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
I
InfoQ
博客园 - 【当耐特】
大猫的无限游戏
大猫的无限游戏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
博客园_首页
D
Docker
U
Unit 42
Attack and Defense Labs
Attack and Defense Labs
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
P
Privacy & Cybersecurity Law Blog
Simon Willison's Weblog
Simon Willison's Weblog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Help Net Security
A
About on SuperTechFans
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
P
Privacy International News Feed
P
Proofpoint News Feed
F
Full Disclosure
G
Google Developers Blog
小众软件
小众软件
Security Latest
Security Latest
The GitHub Blog
The GitHub Blog
T
The Exploit Database - CXSecurity.com
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog
Vercel News
Vercel News

博客园 - lightsong

Micro Frontends extending the microservice idea to frontend development What is Nx? Smart Monorepo Build System & CI WizMap AI Code Review Claude Code Awesome Claude Agents - 26-agent AI Development Team (open source) WezTerm Herdr Zellij playwright-cli branch vs worktree Ralph Loop Browserbase Skills The Complete Beginner's Guide to GSD (Get Shit Done) Framework for Claude Code A Claude Code Skills Stack: How to Combine Superpowers, gstack, and GSD Without the Chaos Casdoor Harness engineering for coding agent users The 8 Levels of Agentic Engineering assistant-ui vs copilotkit vs tambo Apache Casbin Agentic AI-Powered HR Automation Instant CV Intelligence for Modern Hiring Teams Python + LangGraph + FastAPI langfuse contextvars Agent Skills Temporal + LangGraph: A Two-Layer Architecture for Multi-Agent Coordination Building Generative AI Services with FastAPI DeepAgent vs LangGraph Plan-and-Execute AI-Native Software Delivery 动态表单EAV模型(Entity-Attribute-Value模型)和JSON字段 ClickHouse® is a real-time analytics database management system GRAPH RAG 数仓建模——维度表详细讲解 涌现能力 The 5W2H Problem-Solving Method 前端如何直接上传文件夹 docker状态混乱修复(如果出现容器stop不了问题,报Permission denied) Ducky - BPMN 工作流管理系统
Build and Query Knowledge Graphs with LLMs
lightsong · 2026-06-21 · via 博客园 - lightsong

Build and Query Knowledge Graphs with LLMs

https://towardsdatascience.com/build-query-knowledge-graphs-with-llms/

 Neo4j — Graph Database + Vector Store

Neo4j powers the knowledge graph layer and also stores vector embeddings for semantic search. The core of Neo4j is Cypher, the query language needed to interact with a Neo4j Database. Some of the key other features from Neo4j that are used in this project are:

  • GraphDB: To store structured relationships between entities and concepts.
  • VectorDB: Embedding support allows similarity search and hybrid queries.
  • Python SDK: Neo4j offers a python driver to interact with its instance and wrap around it. Thanks to the python driver, knowing Cypher is not mandatory to interact with the code in this repo. Thanks to the SDK, we are able to use other python graph data science libraries as well, such as networkx or python-louvain.

 LangChain — Agent Framework for LLM Workflows

LangChain is used to coordinate how LLMs interact with tools like the vector index and the entities in the Knowledge Graphs, and of course with the user input.

  • Used to define custom agents and toolchains.
  • Integrates with retrievers, memory, and prompt templates.
  • Makes it easy to swap in different LLM backends.

 Streamlit — Frontend UI for Interactions & Demos

I have written a small demo app using Streamlit, a python library that allows developers to build minimal frontend layers without writing any HTML or CSS, just pure python.

In this demo app you will see how to

  • Ingest your documents into Neo4j under a Graph-based representation.
  • Run live demos of the graph-based querying, showcasing key differences between various querying strategies.

Streamlit’s main advantages is that it’s super lightweight, fast to deploy, and doesn’t require a separate frontend framework or backend. Its features make it the perfect fit for demos and prototypes such as this one.

This is what an app looks like in Streamlit

https://github.com/fanqingsong/knowledge-graphs/blob/main/docs/answering-strategies.md

https://microsoft.github.io/graphrag/

https://github.com/microsoft/graphrag

Figure 1: LLM-generated knowledge graph built from a private dataset using GPT-4 Turbo.

Figure 1: An LLM-generated knowledge graph built using GPT-4 Turbo.

GraphRAG is a structured, hierarchical approach to Retrieval Augmented Generation (RAG), as opposed to naive semantic-search approaches using plain text snippets. The GraphRAG process involves extracting a knowledge graph out of raw text, building a community hierarchy, generating summaries for these communities, and then leveraging these structures when perform RAG-based tasks.

出处:http://www.cnblogs.com/lightsong/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。