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
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's included
docs/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 withpypdf, two-passnetworkxgraph building,pyvisvisualization, and graph queries.examples/folder-knowledge-graph/:build_graph.pyCLI (graph build + pyvis HTML + canonical queries +--queryrouting),make_pdf_data.py(deterministic ~60-line pure-Python PDF writer), committed sample folderdata/sample/(3 SQL schemas, 3 config files, 3 tiny hand-crafted PDFs), a self-containednotebook.ipynbthat recreates all sample files inline,pyproject.toml+uv.lock(pypdf, networkx, pyvis),.gitignore,.python-version.src/data/projects.ts,docs/projects/index.mdx, andsrc/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 thedocs-qa-bottranslation, unrelated to this PR.uv run python build_graph.py data/samplebuilds a 30-node / 54-edge graph, answers both canonical queries ("which configs reference tableusers?", "list all entities that mentionauth"), and writes an interactivegraph.html. pypdf successfully reads back all three hand-crafted sample PDFs.Closes #278