pycodekg

Convert a Python codebase into a hybrid SQLite and LanceDB knowledge graph.

1|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/Flux-Frontiers/doc_kg --skill pycodekg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pycodekg
Source: https://github.com/Flux-Frontiers/doc_kg/tree/main/.claude/skills/pycodekg
Command: npx skills add https://github.com/Flux-Frontiers/doc_kg --skill pycodekg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

PyCodeKG eliminates the guesswork of navigating large Python codebases by turning source code into a deterministic, queryable hybrid knowledge graph.

Core Features & Use Cases

  • Codebase indexing into a hybrid graph: Builds a structure-first SQLite knowledge graph plus a LanceDB vector index so semantic search is grounded in real code relationships.
  • MCP tools for structural code understanding: Exposes tools to explore the graph, retrieve relevant implementation snippets, explain nodes, and rank structurally important components.
  • Use cases: Find where features are implemented, trace call paths and dependencies, generate architecture/health analyses, and snapshot codebase evolution across commits.

Quick Start

Use the pycodekg skill to explain and configure PyCodeKG for your Python repo, then run a full graph build so your agent can query and pack grounded code snippets.

Frequently Asked Questions about pycodekg

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a code knowledge graph from a Python codebase for agent queries?

To build a code knowledge graph, you use a Poetry-based setup to index your Python codebase into a hybrid SQLite relational graph and LanceDB vector index. This grounds semantic search in real code structure so agents can reliably query implementation evidence.

Can I configure a code knowledge graph as an MCP server for structural code search?

Yes, you can configure a code knowledge graph as an MCP server by setting up per-repo JSON configurations like .mcp.json with absolute paths. This exposes MCP tools for structural code search, allowing agents to query the graph and retrieve relevant implementation snippets.

What is the best way to trace dependencies and call paths in a large Python project?

The best way to trace dependencies and call paths is by utilizing a deterministic code knowledge graph. After building SQLite and LanceDB indexes, you can use specific graph tools to trace callers, explain nodes, and map structural relationships throughout the codebase.

Does PyCodeKG require Poetry to install and build SQLite and LanceDB indexes?

Yes, PyCodeKG requires a Poetry-based setup to correctly install dependencies and execute graph build commands. You must run specific build commands with flags like build-sqlite and build-lancedb with --sqlite to generate the hybrid indexes.

How do I generate an architecture analysis and snapshot codebase evolution across commits?

To generate an architecture analysis and snapshot codebase evolution, you execute specific CLI and MCP workflows like architecture and snapshot. These tools analyze graph centrality and structural importance to track how your codebase changes over time.