Skip to content

Add Real-World Project: Turn a Folder of PDFs, Configs, and SQL Schemas Into a Queryable Knowledge Graph - #279

Open
abderrahim-lectures wants to merge 1 commit into
mainfrom
add-folder-knowledge-graph
Open

Add Real-World Project: Turn a Folder of PDFs, Configs, and SQL Schemas Into a Queryable Knowledge Graph#279
abderrahim-lectures wants to merge 1 commit into
mainfrom
add-folder-knowledge-graph

Conversation

@abderrahim-lectures

Copy link
Copy Markdown
Owner

What's included

  • Lessondocs/projects/folder-knowledge-graph/index.md: a no-LLM, no-API-key walkthrough teaching that heterogeneous folders are a knowledge-graph problem, not a search problem. Covers config-key extraction (tomllib/configparser), SQL schema parsing with regexes, PDF text extraction with pypdf, two-pass networkx graph building, pyvis visualization, and graph queries.
  • Exampleexamples/folder-knowledge-graph/: build_graph.py CLI (graph build + pyvis HTML + canonical queries + --query routing), make_pdf_data.py (deterministic ~60-line pure-Python PDF writer), committed sample folder data/sample/ (3 SQL schemas, 3 config files, 3 tiny hand-crafted PDFs), a self-contained notebook.ipynb that recreates all sample files inline, pyproject.toml + uv.lock (pypdf, networkx, pyvis), .gitignore, .python-version.
  • Registration — inserted as the first entry/card in src/data/projects.ts, docs/projects/index.mdx, and src/pages/index.tsx.

Verification

  • npm run typecheck — passes.
  • npm run build — passes for all 4 locales (en/ar/es/fr). The only warnings are pre-existing broken anchors in the docs-qa-bot translation, unrelated to this PR.
  • Example smoke test — uv run python build_graph.py data/sample builds a 30-node / 54-edge graph, answers both canonical queries ("which configs reference table users?", "list all entities that mention auth"), and writes an interactive graph.html. pypdf successfully reads back all three hand-crafted sample PDFs.

Closes #278

Walk a folder of mixed PDFs, configs, and SQL schemas with pypdf and the
standard library, extract the hidden references between them, and build a
queryable networkx knowledge graph with pyvis visualization — no API key, no
LLM. Adds the lesson, a runnable example with a committed sample folder and a
deterministic pure-Python PDF generator, and a self-contained notebook.

Closes #278

Co-authored-by: deepseek-v4-flash-free <noreply@opencode.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Real-World Project: Turn a Folder of PDFs, Configs, and SQL Schemas Into a Queryable Knowledge Graph

1 participant