An intelligent Q&A agent with graph-based memory using pydantic_graph and Graphiti for adaptive learning and personalized question generation.
- π€ AI-powered question generation and answer evaluation
- π§ Temporal knowledge graph for long-term memory
- π Adaptive difficulty based on user performance
- π Session persistence and cross-session learning
- π Performance tracking with forgetting curves
- π‘οΈ Robust error handling and fallback strategies
The system integrates several key components:
- Question Graph Flow: Built with
pydantic_graphfor stateful Q&A interactions - Entity Extraction: Keyword-based and NLP-ready extraction pipeline
- Knowledge Graph: Graphiti integration for temporal relationship tracking
- Adaptive Learning: Mastery tracking with spaced repetition principles
- Python 3.10 or higher
- Neo4j database (for Graphiti backend)
- OpenAI API key
# Clone the repository
git clone https://github.com/yourusername/question-graph-agent.git
cd question-graph-agent
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# For development
pip install -r requirements-dev.txt# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and setup
git clone https://github.com/yourusername/question-graph-agent.git
cd question-graph-agent
# Install dependencies
uv pip install -r requirements.txt
# For development
uv pip install -r requirements-dev.txt# Install in editable mode
pip install -e .
# With all optional dependencies
pip install -e ".[all]"- Copy the example environment file:
cp .env.example .env- Edit
.envwith your configuration:
OPENAI_API_KEY=your-api-key
NEO4J_URI=bolt://localhost:7687
NEO4J_PASSWORD=your-password- Start Neo4j database:
# Using Docker
docker run -d \
--name neo4j \
-p 7474:7474 -p 7687:7687 \
-e NEO4J_AUTH=neo4j/your-password \
neo4j:latestuv run -m question_graph mermaiduv run -m question_graph continuousuv run -m question_graph cli [answer]question-graph-agent/
βββ question_graph.py # Main application flow
βββ graphiti_entities.py # Entity models for knowledge graph
βββ graphiti_relationships.py # Relationship models with temporal tracking
βββ entity_extraction.py # Entity extraction and classification
βββ extraction_pipeline.py # Batch processing pipelines
βββ extraction_errors.py # Error handling framework
βββ pyproject.toml # Project configuration and dependencies
βββ requirements.txt # Core dependencies
βββ requirements-dev.txt # Development dependencies
βββ .env.example # Example environment configuration
pytest# Run tests in containers (requires OrbStack on macOS)
./run-tests-orbstack.sh
# Run specific test file
./run-tests-orbstack.sh tests/test_enhanced_nodes.pyFor detailed OrbStack setup and performance benefits, see OrbStack Testing Documentation.
black .
isort .mypy .flake8
pylint question_graph- Changelog - Detailed version history and release notes
- OrbStack Testing - Containerized testing guide
- CLAUDE.md - Project guidelines and implementation status
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please follow the Conventional Commits specification for commit messages.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with pydantic for data validation
- Uses pydantic_graph for graph workflows
- Integrates Graphiti for temporal knowledge graphs
- Powered by OpenAI for AI capabilities