Skip to content

feat(notebook): add GraphRAG knowledge extraction from scratch#251

Open
abdelhadi703 wants to merge 1 commit intomistralai:mainfrom
abdelhadi703:feat/graphrag-knowledge-extraction
Open

feat(notebook): add GraphRAG knowledge extraction from scratch#251
abdelhadi703 wants to merge 1 commit intomistralai:mainfrom
abdelhadi703:feat/graphrag-knowledge-extraction

Conversation

@abdelhadi703
Copy link
Copy Markdown

Description

This notebook adds a complete GraphRAG pipeline built from scratch using only the Mistral AI SDK — no external graph databases required.

What's included:

  • Entity & relationship extraction using Mistral Large structured outputs (Pydantic models)
  • Knowledge graph construction with NetworkX DiGraph
  • Visualization of the entity relationship graph
  • Hybrid retrieval combining FAISS vector search + BFS graph traversal
  • Side-by-side comparison of standard RAG vs GraphRAG on multi-hop questions

Stack:

mistralai + networkx + faiss-cpu + pydantic + matplotlib

Why this matters:

The existing camel_graph_rag.ipynb requires CAMEL + Neo4j, making it hard to run on Colab. This notebook provides a lightweight, self-contained alternative that demonstrates GraphRAG concepts without external dependencies.

Tested locally with mistral-large-latest and mistral-embed.

Checklist

  • Follows cookbook conventions (badge, getpass, structured sections)
  • All cells run sequentially
  • README updated
  • No API keys in code

Build a complete GraphRAG pipeline using only Mistral AI SDK:
- Entity/relationship extraction with Pydantic structured outputs
- Knowledge graph construction with NetworkX
- Hybrid retrieval combining FAISS vector search and graph traversal
- Comparison of standard RAG vs GraphRAG on multi-hop questions
@abdelhadi703 abdelhadi703 force-pushed the feat/graphrag-knowledge-extraction branch from e315f89 to d8d18c8 Compare March 3, 2026 10:55
@abdelhadi703
Copy link
Copy Markdown
Author

Hi @mistralai/team,

Bumping this GraphRAG notebook for review. It demonstrates knowledge graph extraction using Mistral models.

Looking forward to your feedback. Thanks!

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.

1 participant