Obsidian Vault를 위한 Personal Knowledge Graph
Obsidian vault의 MD 파일들에서 LLM으로 엔티티 + 관계를 자동 추출 → Neo4j에 지식 그래프로 저장 → Obsidian graph view처럼 interactive하게 엔티티를 클릭/추적/탐색하는 시스템
이건 “개인 지식 그래프(Personal Knowledge Graph)” + GraphRAG의 실전 버전으로, 현재 가장 잘 맞는 오픈소스 스택입니다. (2026년 3월 기준)
1. 가장 추천: CocoIndex (MD 파일 → Neo4j KG 자동화 최고)
CocoIndex는 Markdown 파일 전용으로 설계된 오픈소스 ETL 프레임워크입니다. LLM으로 구조화된 엔티티/관계를 추출하고, 파일 변경 시 자동 증분 업데이트까지 됩니다.
장점
- MD 폴더 전체를 source로 지정 → 자동 처리
- LLM이 Pydantic dataclass로 구조화된 출력 (엔티티 중복 제거 자동)
- Neo4j에 Document / Entity 노드 + RELATIONSHIP / MENTION 관계로 저장
- Obsidian vault와 완벽 호환 (파일 경로 기반)
설치 & 사용 흐름 (5분 안에 시작 가능)
pip install cocoindex
# PostgreSQL (증분 처리용) + Neo4j Desktop 설치
cocoindex initPython 코드 예시 (docs_to_kg_flow.py)
from cocoindex import *
@flow_def(name="ObsidianKG")
def obsidian_kg(flow_builder: FlowBuilder, data_scope: DataScope):
data_scope["docs"] = flow_builder.add_source(
LocalFile(path="/path/to/your/obsidian/vault",
included_patterns=["**/*.md"]))
# LLM으로 summary + 관계 추출 (Ollama나 OpenAI/Grok 사용 가능)
# ... (DocumentSummary, Relationship dataclass 정의 후 ExtractByLlm)
# Neo4j export (Document, Entity, MENTION, RELATIONSHIP)실행
cocoindex update → 변경된 MD만 처리확인
Neo4j Browser에서 다음 Cypher 쿼리로 바로 그래프 확인:
MATCH p=()-->() RETURN p LIMIT 50시각화
- Neo4j Browser / Bloom / Neo4j Desktop 기본 graph view (Obsidian과 매우 비슷한 force-directed + 클릭 탐색)
2. LlamaIndex PropertyGraphIndex + Neo4j (GraphRAG와 가장 잘 연동)
이전 GraphRAG 대화에서 말씀드린 LlamaIndex를 그대로 사용하면 됩니다. 가장 유연하고 성숙한 솔루션입니다.
특징
SimpleDirectoryReader로 Obsidian vault 전체 MD 로드SchemaLLMPathExtractor또는SimpleLLMPathExtractor로 LLM 엔티티 추출 (커스텀 스키마 가능: PERSON, CONCEPT, PROJECT 등)Neo4jPropertyGraphStore로 바로 Neo4j에 Property Graph 저장 (노드 라벨 + 속성 + 관계)- 나중에 GraphRAG retriever로도 바로 사용 가능
간단 코드 예시
from llama_index.core import SimpleDirectoryReader, PropertyGraphIndex
from llama_index.graph_stores.neo4j import Neo4jPropertyGraphStore
from llama_index.core.indices.property_graph import SchemaLLMPathExtractor
documents = SimpleDirectoryReader("/path/to/vault").load_data()
graph_store = Neo4jPropertyGraphStore(
username="neo4j", password="password", url="bolt://localhost:7687"
)
kg_extractor = SchemaLLMPathExtractor(...) # 원하는 엔티티/관계 스키마 지정
index = PropertyGraphIndex.from_documents(
documents,
property_graph_store=graph_store,
kg_extractors=[kg_extractor],
embed_kg_nodes=True # 벡터 검색도 가능
)시각화
Neo4j Browser에서 Cypher로 바로 Obsidian-style 그래프 확인:
MATCH (n:Entity)-[r]->(m) RETURN n, r, m팁: 노드 클릭 → 연결된 MD 파일 내용까지 바로 볼 수 있게 MENTION 관계 추가 추천
3. 가장 쉬운 노코드 옵션: Neo4j LLM Knowledge Graph Builder
- 온라인: https://llm-graph-builder.neo4jlabs.com/ 또는 Docker로 로컬 실행
- MD 파일(또는 여러 문서) 업로드 → LLM(OpenAI/Gemini/Claude/Llama3 등) 자동으로 chunk + entity + relationship 추출
- Neo4j에 Document-Chunk-Entity 그래프 자동 구축
- UI 내에서 그래프 미리보기 제공
단점
- 폴더 전체 자동 sync는 안 되고, 수동 업로드 or S3 연동 필요
시각화: “Obsidian graph UI처럼” 만드는 방법
| 방법 | Obsidian 느낌 | 난이도 | 추천 상황 |
|---|---|---|---|
| Neo4j Browser / Bloom | ★★★★★ (force-directed, 클릭 탐색, zoom) | ★☆☆ | 가장 추천 (기본 제공) |
| Obsidian Neo4j Graph View 플러그인 (구 버전) | ★★★★★ (Obsidian 안에서 바로) | ★★☆ | Obsidian 안에서 보고 싶을 때 (Cypher 지원, 태그/폴더 스타일링) |
| Juggl (신규 플러그인) | ★★★★ | ★☆☆ | Neo4j 없이도 고급 그래프 원할 때 (하지만 커스텀 엔티티는 제한) |
| NVL (Neo4j Visualization Library) | ★★★★ | ★★★ | 웹 앱으로 직접 만들고 싶을 때 |
실전 팁
- Obsidian vault를 그대로 두고, 위 파이프라인으로 별도 KG DB를 유지하세요.
- 엔티티 노드에 source_file 또는 MENTION 관계를 반드시 넣으면 → 엔티티 클릭 시 어떤 MD 노트에서 나온 건지 바로 추적 가능.
- LLM은 Ollama (로컬) + Llama3.1 70B나 Grok, Claude 추천 (프롬프트 잘 주면 정확도 ↑).
Related
- GraphRAG Overview: 2026-03-29-graphrag-overview
- Obsidian Graph Visualization (Cosma, Quartz): 2026-03-29-obsidian-graph-visualization
- CocoIndex: https://github.com/yourusername/cocoindex (구체적인 링크는 추가 확인 필요)
- LlamaIndex: https://docs.llamaindex.ai/
- Neo4j LLM Graph Builder: https://llm-graph-builder.neo4jlabs.com/
Source: 정석님 공유 (2026-03-29)