Illume is an AI-powered learning assistant designed to help students understand complex topics during research. It leverages advanced language models to provide clear, contextual explanations and insights.
- AI-powered learning assistance
- Complex topic explanation
- Research support
- Interactive learning experience
Illume is structured to provide an intuitive and powerful learning experience:
The project implements a focused RAG (Retrieval-Augmented Generation) architecture:
The core module that handles AI interactions through Google's Gemini model:
-
Model Interface
models/gemini_client.py: Manages Google Gemini API interactions- Handles connection lifecycle and resource cleanup
- Implements text generation capabilities
-
Core Operations (
models/operations.py)create_word_explanation(keyword: str, data: str) -> str: Generates contextual word definitionscreate_questions(keyword: str, text: str) -> str: Generates relevant assessment questionscreate_answers(questions: str) -> str: Produces detailed answers with explanationscreate_initial_summary(data: str) -> str: Summarizes input contextcreate_new_questions(wrong_questions: str, keyword: str, text: str) -> str: Generates new questions based on incorrect answerscreate_summary_adjustment(keyword: str, new_questions: str, new_answers: str) -> str: Creates an adjusted summary based on new Q&A- Each operation implements specific prompting strategies
-
Infrastructure Layer (
infrastructure/)clean_wiki_content(): Preprocesses Wikipedia text data- Manages data loading and cleaning operations
- Handles file I/O for test data
The following functions are available in llm_engineering/models/operations.py:
-
create_initial_summary(data: str) -> str
- Purpose: Creates an initial summary of the provided data
- Parameters:
data: The text content to summarize
- Returns: A string containing the generated summary
-
create_questions(keyword: str, text: str) -> str
- Purpose: Generates 4 assessment questions about a specific keyword
- Parameters:
keyword: The topic to generate questions abouttext: The context text to base questions on
- Returns: A string containing 4 formatted questions (multiple choice, true/false, fill-in-blank)
-
create_answers(questions: str) -> str
- Purpose: Generates answers and explanations for provided questions
- Parameters:
questions: The questions to answer
- Returns: A string containing answers and explanations for each question
-
create_new_questions(wrong_questions: str, keyword: str, text: str) -> str
- Purpose: Generates new questions focusing on previously incorrect answers
- Parameters:
wrong_questions: Questions that were answered incorrectlykeyword: The topic to focus ontext: The context text
- Returns: A string containing 4 new questions focusing on reinforcement
-
create_word_explanation(keyword: str, data: str) -> str
- Purpose: Creates a detailed explanation of a keyword in context
- Parameters:
keyword: The word to explaindata: The article context
- Returns: A string containing the word's meaning and contextual explanation
-
create_summary_adjustment(keyword: str, new_questions: str, new_answers: str) -> str
- Purpose: Creates an adjusted explanation based on new Q&A
- Parameters:
keyword: The topic being explainednew_questions: The new questions generatednew_answers: The answers to the new questions
- Returns: A string containing the adjusted explanation
- PabloAI Class (
actions.py)- Orchestrates the RAG workflow
- Implements error handling and logging
- Manages the conversation flow:
- Data cleaning
- Word explanation generation
- Question generation
- Answer creation
-
Clean Architecture
- Clear separation between model operations and application logic
- Infrastructure layer handles data processing independently
- Modular design with well-defined responsibilities
-
Error Handling
- Comprehensive try-except blocks in PabloAI
- Graceful client cleanup in finally blocks
- Clear error messaging for debugging
-
Development Tools (as defined in
pyproject.toml)- pytest for testing
- black for code formatting (line length standardization)
- isort for import organization
The examples/ directory contains sample implementations showing how to use Illume:
runningPabloAI.py: Demonstrates basic usage and integration- Additional examples show different use cases and features
- Python 3.9 or higher
- Poetry for dependency management
- Google AI API access (for Google's Generative AI)
- Clone the repository:
git clone https://github.com/yourusername/illume.git
cd illume- Install dependencies using Poetry:
poetry install- Set up your environment variables:
Create a
.envfile in the root directory with your Google AI API key:
GOOGLE_API_KEY=your_api_key_here
poetry run python examples/runningPabloAI.pyThis section is intended for developers who will be working on or extending the Illume project.
illume/
├── llm_engineering/ # Core implementation
├── examples/ # Usage examples
├── tests/ # Test suite
└── pyproject.toml # Project configuration
- Follow the installation steps above
- Install development dependencies:
poetry install --with devThe project uses several development tools to maintain code quality:
pytest: For running testsblack: For code formattingisort: For import sorting
- Follow PEP 8 standards
- Use type hints for function parameters and return values
- Write docstrings for all public functions and classes
- Keep functions focused and single-purpose
- Write unit tests for new features
poetry run black .
poetry run isort .This project is licensed under the terms specified in the LICENSE file.
Pablo Leyva
- LinkedIn: Pablo Leyva
- AI Partner Solutions at Apple
- Email: pleyva2004@gmail.com