cortex / core /graph.py
cortex-deploy
Deploy 5c5fcc1 from claude/neo4j-vs-falkordb
ac156d2
Raw History Blame Contribute Delete
523 Bytes
"""FalkorDB connection and graph names."""
import os
from functools import lru_cache
from falkordb import FalkorDB
KG = "cortex_kg" # knowledge graph built from the PDFs
OPS = "cortex_ops" # operational graph (customers, accounts, transactions)
SANDBOX_PREFIX = "sandbox_" # one isolated graph per upload session
@lru_cache(maxsize=1)
def db():
return FalkorDB(host=os.getenv("FALKOR_HOST", "localhost"), port=int(os.getenv("FALKOR_PORT", "6379")))
def graph(name=KG):
return db().select_graph(name)