This system provides AI-powered analysis of parliamentary meeting minutes using a combination of knowledge graph and vector storage technologies (GraphRAG).
- Parliamentary Meeting Minutes Analysis with GraphRAG
- 📊 Parliamentary data loading and preprocessing
- 🔍 Named Entity Recognition using GLiNER
- 🕸️ Knowledge graph construction and visualization
- 🔠 Vector embeddings for semantic search
- 🧠 GraphRAG query processing combining graph and vector search
- 🖥️ Interactive web interface with Streamlit
- 🔄 Flexible vector storage with Qdrant and ChromaDB fallback
GraphRAG combines the power of knowledge graphs with vector similarity search to provide more accurate answers:
- Knowledge Graph: Captures relationships between entities in parliamentary data
- Vector Storage: Enables semantic similarity search across meeting content
- Hybrid Search: Combines graph traversal with vector similarity for enhanced retrieval
- LLM Integration: Uses Ollama for context-aware response generation
- Python 3.10+
- Conda (for virtual environment management)
- Ollama (for local LLM support)
This project uses a conda virtual environment. To set up and activate the environment:
# Create the environment
conda create -n mentor360 python=3.10
# Activate the environment
conda activate mentor360
# Install dependencies
pip install -r requirements.txt- Install Ollama by following the instructions at https://ollama.ai/
- Pull the required model:
ollama pull llama3
- Ensure the Ollama service is running before starting the application:
# On Windows ollama serve # On macOS/Linux sudo systemctl start ollama
The application uses a configuration system that can be customized:
- Default configuration is loaded from
src/utils/config.py - You can override settings by creating a
config.jsonfile in the project root - Environment variables can also override configuration settings
Example config.json:
{
"ollama": {
"base_url": "http://localhost:11434",
"model_name": "qwq",
"embedding_dim": 4096
},
"vector_store": {
"primary": "qdrant",
"fallback": "chroma"
}
}To run the GraphRAG demo script that shows the core functionality:
conda activate mentor360
python src/demo/graphrag_demo.pyThis will demonstrate:
- Loading parliamentary data
- Extracting entities
- Building a knowledge graph
- Performing queries using graph mode, vector mode, and hybrid mode
To run the Streamlit web interface:
conda activate mentor360
streamlit run src/web/app.pyThen open your browser to the URL displayed in the console (typically http://localhost:8501).
src/data/: Data loading and preprocessingsrc/models/: Core models including NER, knowledge graph, and GraphRAGsrc/services/: External service integrations (e.g., Ollama)src/storage/: Vector storage implementationsrc/utils/: Utility functions for logging, configuration, etc.src/web/: Streamlit web applicationsrc/demo/: Demo scriptstests/: Unit and integration testsdata/: Sample and processed data filesconfig/: Configuration files
If you encounter errors related to the Ollama service:
- Ensure Ollama is installed and running
- Check that you have pulled the required model (
ollama pull qwq) - The application will attempt to initialize the Ollama service automatically if not provided
If you encounter an error about embedding_dimensions, ensure your Ollama configuration in config.json uses embedding_dim instead:
{
"ollama": {
"base_url": "http://localhost:11434",
"model_name": "llama3",
"embedding_dim": 4096
}
}If you encounter errors with the Streamlit application:
- Ensure you have the correct version of Streamlit installed (specified in requirements.txt)
- Try clearing the Streamlit cache:
streamlit cache clear - Check your Python version (3.9 recommended)
Parliamentary meeting minutes should be in a CSV format with columns for date, speaker, and content.
Sample data format:
date,speaker,content
2023-01-15,John Smith,"Mr. Speaker, I rise today to discuss the importance of..."
2023-01-15,Jane Doe,"I would like to respond to the honorable member's point about..."
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the terms of the MIT license.
