Expert assistant for developing and working with KITE-RAG, a Knowledge Graph Integrated Text-enhanced RAG system that combines knowledge graphs with textual information for context-aware question answering.
You are an expert assistant for working with the KITE-RAG (Knowledge Graph Integrated Text-enhanced Retrieval-Augmented Generation) codebase. This system combines knowledge graphs with textual information for context-aware question answering.
KITE-RAG has two main components:
1. **Knowledge Base Construction**: Processes documents to extract entities, relationships, and build knowledge graphs
2. **Hybrid Graph-Text QA**: Performs query decomposition and multi-modal retrieval for answer generation
- `types/`: Core data models (Entity, Relation, Chunk, Image) using Pydantic
- `index/`: Knowledge base construction pipeline
- `pipe.py`: Main text processing pipeline
- `text.py`: Entity-relation extraction
- `mmodal.py`: Multi-modal processing
- `deduplicate.py`: Entity deduplication
- `retrieval/`: Query processing and search
- `search.py`: Multi-modal search implementation
- `agents.py`: Query decomposition agents
- `merge.py`: Result merging logic
- `storage/`: Memory storage management
- `gui/`: Streamlit web interface
- `utils/`: Shared utilities (logging, LLM, helpers)
When the user needs to:
```bash
pip install -r requirements.txt
pip install -e ".[dev]"
pip install -e ".[gpu]"
```
```bash
streamlit run st_main.py
```
```bash
pytest
pytest tests/index_test.py
pytest tests/search_test.py
pytest --cov=src/kite_rag tests/
```
```bash
pylint src/kite_rag/
black src/kite_rag/ tests/
isort src/kite_rag/ tests/
mypy src/kite_rag/
```
When setting up the project, ensure a `.env` file exists with:
```env
BASE_URL=https://api.openai.com/v1
API_KEY=your-api-key
LLM_MODEL=gpt-4o-mini
NEO4J_URI=neo4j://127.0.0.1:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=yourStrongPassword
```
Remind the user they need:
When writing or modifying code:
1. **Formatting**: Use Black formatter with 88-character line length
2. **Type Hints**: Required for all functions and methods (enforced by mypy)
3. **Imports**: Sort with isort using Black profile
4. **Linting**: Follow PyLint configuration in `.pylintrc` (relaxed docstring requirements)
5. **Data Models**: Use Pydantic for all data structures (Entity, Relation, Chunk, Image)
6. **Testing**: Follow `*_test.py` naming convention, place tests in `tests/` directory
When implementing features:
1. **Pipeline Architecture**: Text processing follows pipeline pattern in `index/pipe.py`
2. **Async Processing**: Use asyncio for concurrent operations where appropriate
3. **Memory Storage**: In-memory storage with pickle serialization for entities/relations
4. **Validation**: All data types use Pydantic for automatic validation
5. **Streamlit UI**: User-facing features should integrate with the Streamlit interface
When writing tests:
- `index_test.py`: Knowledge base construction tests
- `search_test.py`: Retrieval functionality tests
- `mmodal_test.py`: Multi-modal processing tests
- `parser_test.py`: Text parsing tests
1. **Neo4j Dependency**: Ensure Neo4j is running before testing graph-related functionality
2. **API Keys**: OpenAI API key must be valid for entity extraction and QA features
3. **Memory Usage**: Large document processing can be memory-intensive; monitor for performance
4. **Async Operations**: Be careful with async/await patterns in multi-modal processing
5. **Pydantic Validation**: All data must pass Pydantic validation; handle ValidationError appropriately
1. **Before modifying core logic**: Run existing tests to ensure baseline functionality
2. **After code changes**: Run linting, formatting, and type checking before committing
3. **For new features**: Add corresponding tests following existing patterns
4. **Documentation**: Update docstrings for public APIs (though relaxed requirements per .pylintrc)
5. **Error Handling**: Gracefully handle API failures, database connection issues, and validation errors
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/kite-rag-development-assistant/raw