Graphiti 설치와 빠른 시작

Graphiti 설치와 빠른 시작

Graphiti를 자기 환경에 붙이는 방법을 볼게요. 파이썬 버전과 그래프 데이터베이스, LLM API 키가 필요해요.

요구 사항

  • Python 3.10 이상
  • 그래프 DB 중 하나: Neo4j 5.26 / FalkorDB 1.1.2 / Amazon Neptune / Kuzu 0.11.2(deprecated)
  • OpenAI API 키 — 기본값으로 OpenAI를 LLM 추론·임베딩에 사용 (Anthropic·Gemini·Groq도 선택 가능)

주의할 점은, Graphiti는 Structured Output을 지원하는 LLM 서비스(OpenAI, Anthropic, Gemini 등)에서 가장 잘 동작해요. 작은 모델에서는 출력 스키마가 어긋나 섭취가 실패할 수 있어요.

설치

pip install graphiti-core
# or with uv
uv add graphiti-core[falkordb]

선택적 LLM 프로바이더는 extras로 추가해요.

pip install graphiti-core[anthropic]
pip install graphiti-core[groq]
pip install graphiti-core[google-genai]
pip install graphiti-core[falkordb,anthropic,google-genai]

첫 실행

그래프 드라이버를 만들고 Graphiti에 주입한 뒤, 인덱스를 한 번 구축하면 돼요.

from graphiti_core import Graphiti
from graphiti_core.driver import FalkorDriver

driver = FalkorDriver(...)  # 접속 정보 필요
graphiti = Graphiti(graph_driver=driver)
await graphiti.build_indices_and_constraints()

build_indices_and_constraints()는 멱등이라 시작할 때마다 호출해도 안전해요. FalkorDriver 클래스는 graphiti_core.driver.falkordb_driver에 있어요.

주요 팁

  • 응답 중 Markdown 코드 펜스(```json)로 감싸진 것은 자동으로 제거돼요.
  • SEMAPHORE_LIMIT을 낮게 유지하세요 — 로컬 서버나 일부 프로바이더는 동시성 제한이 있어요.
  • 텔레메트리는 옵트아웃 방식으로 켜져 있는데, 비활성화하려면 GRAPHITI_TELEMETRY_ENABLED=false 환경변수를 쓰면 돼요.

더 알아보기