Add FalkorDB Knowledge Graph with GraphRAG for LEGI, JADE, and BOFIP#22
Closed
Copilot wants to merge 2 commits into
Closed
Add FalkorDB Knowledge Graph with GraphRAG for LEGI, JADE, and BOFIP#22Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: yawo <981127+yawo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add FalkorDB setup with GraphRAG and knowledge graph
Add FalkorDB Knowledge Graph with GraphRAG for LEGI, JADE, and BOFIP
Mar 16, 2026
Author
I don't have the ability to close pull requests directly. You can close it from the GitHub UI by clicking "Close pull request" at the bottom of the PR page. |
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.
Adds FalkorDB as a graph database to build a Knowledge Graph over processed legal data (LEGI, JADE, BOFIP), with GraphRAG SDK integration for entity-aware Q&A.
Design decision: Option B — parallel population during processing
Graph nodes and relationships are written to FalkorDB in the same pass as PostgreSQL inserts, while the raw XML is being parsed. This avoids a second ETL pass and preserves structural metadata (e.g. LIENS cross-references) only available at parse time. All graph ops are wrapped in
try/except— FalkorDB unavailability never interrupts the main pipeline.Infrastructure
docker-compose.yml: Addfalkordbservice (falkordb/falkordb:v4.4.4) with healthcheck, named volume, port 6379, and Airflow depends_on..env.example/config/config.py/config/__init__.py: AddFALKORDB_HOST,FALKORDB_PORT,FALKORDB_USERNAME,FALKORDB_PASSWORD,FALKORDB_GRAPH_NAME.pyproject.toml: Addfalkordb==1.6.0andgraphrag-sdk==0.8.2.Graph ontology (
database/graph_manage.py)LegalTextJudicialDecisionTaxGuidanceLegalCodeMinistryJurisdictionChunkRelationships:
BELONGS_TO_CODE,ISSUED_BY,REFERENCES(from LIENS metadata),DECIDED_BY,PART_OF.Key functions
init_graph_schema()— creates FalkorDB indexesupsert_{legi,jade,bofip}_{node,chunk}()— parallel-population upsertspopulate_graph_from_postgres()— streaming back-fill from existing PostgreSQL data (server-side cursors)build_graphrag_knowledge_graph()— instantiates agraphrag_sdk.KnowledgeGraphwith the full ontology for entity extraction / Q&AProcessing pipeline (
files_processing.py)Graph upserts added after each PostgreSQL insert for LEGI and JADE handlers. Added a new
BOFIPTEXT*.xmlhandler (matching the existing DILA XML pattern) and a"bofip"type branch inprocess_data()to handle the BOFIP tgz archives.BOFIP PostgreSQL table
Added
BOFIPtable schema todatabase_manage.py(mirrors the LEGI/JADE pattern withchunk_id,doc_id,nature,category,title,date,text,chunk_text, vector embedding column).Airflow DAG (
airflow_config/dags/knowledge_graph.py)New
KNOWLEDGE_GRAPHDAG with two tasks:init_graph_schema → populate_graph_from_postgres, for bootstrapping or back-filling existing deployments.Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.