About pygraphistry-ai
pygraphistry-ai is a skill for using PyGraphistry’s graph-AI features. It guides workflows for embedding, clustering, semantic search, and consistent projections on new data, with practical notes on engines and sampling.
Key features
- 01Graph feature and embedding workflows
- 02UMAP projection and batch transforms
- 03DBSCAN clustering and semantic search
- 04Guidance on engines and sampling
Use cases
- 01Explore patterns in graph features
- 02Search text-derived graph embeddings
- 03Project new batches consistently
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ graphistry/ graphistry-skills --skill pygraphistry-aiAfter installing, type/pygraphistry-aiin Claude Code to confirm it loaded.
Details
From the project READMEPyGraphistry AI
Doc routing (local + canonical)
- First route with
../pygraphistry/references/pygraphistry-readthedocs-toc.md. - Use
../pygraphistry/references/pygraphistry-readthedocs-top-level.tsvfor section-level shortcuts. - Only scan
../pygraphistry/references/pygraphistry-readthedocs-sitemap.xmlwhen a needed page is missing. - Use one batched discovery read before deep-page reads; avoid
cat *and serial micro-reads. - In user-facing answers, prefer canonical
https://pygraphistry.readthedocs.io/en/latest/...links.
Typical workflow
- Build graph from nodes/edges.
- Run feature/embedding method (
umap,embed, optionaldbscan). - Inspect derived columns/features and visualize.
- Iterate on feature columns and sampling strategy.
Baseline examples
# Similarity embedding / projection
g2 = graphistry.nodes(df, 'id').umap(X=['f1', 'f2', 'f3'])
g2.plot()
# Fit/transform flow for consistent projection on new batches
g_train = graphistry.nodes(df_train, 'id').umap(X=['f1', 'f2'])
g_batch = g_train.transform_umap(df_batch, return_graph=True)
g_batch.plot()
# Semantic search over embedded features
g2 = graphistry.nodes(df, 'id').umap(X=['text_col'])
results_df, query_vector = g2.search('suspicious login pattern')
# Text-first workflow: featurize then search/cluster
g2 = graphistry.nodes(df, 'id').featurize(kind='nodes', X=['title', 'body']).umap(kind='nodes').dbscan()
hits, qv = g2.search('credential stuffing campaign')
# Precomputed embedding columns
embedding_cols = [c for c in df.columns if c.startswith('emb_')]
g2 = graphistry.nodes(df, 'id').umap(X=embedding_cols)
g_new = g2.transform_umap(df_new, return_graph=True)
Practical guardrails
- Start with small/representative samples before full runs.
- Keep explicit feature lists (
X=...) for reproducibility. - Track engine/dataframe type for CPU vs GPU behavior. Polars input is supported; use
engine='polars'/'polars-gpu'for GFQL row/traversal work when preserving a Polars result matters. - UMAP, hypergraph, layout, and other whole-graph analytics are not native Polars operations. Under a Polars GFQL engine, use the default bridge knowingly or set
call_mode='strict'to reject off-engine execution. - For anomaly workflows, document thresholds and false-positive assumptions.
- For graph ML tasks, route deeper model workflows to RGCN/link-prediction references.
- For text workflows, prefer
featurize(...).umap(...).search(...)when queries are natural language. - If users already have embeddings, reuse them via explicit embedding column lists (
X=[...]) before recomputing. - When user asks for a concise workflow snippet, prefer one short code block and avoid long narrative wrappers.
Canonical docs
- GFQL + AI combos: https://pygraphistry.readthedocs.io/en/latest/gfql/combo.html
- API AI reference: https://pygraphistry.readthedocs.io/en/latest/api/ai.html
- AI notebook index: https://pygraphistry.readthedocs.io/en/latest/notebooks/ai.html
- Example RGCN notebook: https://pygraphistry.readthedocs.io/en/latest/demos/more_examples/graphistry_features/embed/simple-ssh-logs-rgcn-anomaly-detector.html
Comments
Markdown supported