Download core/graph.py from sk-aiu/cortex: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/spaces/sk-aiu/cortex/resolve/main/core/graph.py
- Command line
-
hf download hf://spaces/sk-aiu/cortex/core/graph.py
-
curl -L -o graph.py https://huggingface.co/spaces/sk-aiu/cortex/resolve/main/core/graph.py
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 | |
| 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) | |