| description | Python SDK overview for Code-Graph-RAG programmatic access. |
|---|
The cgr package provides short imports for programmatic use of Code-Graph-RAG.
pip install code-graph-ragWith semantic code search:
pip install 'code-graph-rag[semantic]'from cgr import load_graph
graph = load_graph("graph.json")
print(graph.summary())
functions = graph.find_nodes_by_label("Function")
for fn in functions[:5]:
rels = graph.get_relationships_for_node(fn.node_id)
print(f"{fn.properties['name']}: {len(rels)} relationships")| Import | Purpose |
|---|---|
from cgr import load_graph |
Load and query exported graph data |
from cgr import MemgraphIngestor |
Query Memgraph with Cypher directly |
from cgr import CypherGenerator |
Generate Cypher from natural language |
from cgr import embed_code |
Semantic code search with UniXcoder |
from cgr import settings |
Configure providers programmatically |
from cgr import settings
settings.set_orchestrator("openai", "gpt-5.6-terra", api_key="sk-...")
settings.set_cypher("google", "gemini-3.5-flash-lite", api_key="your-key")See individual pages for detailed API usage:
