Build your own personalized AI assistant with custom models, RAG, and conversation memory
[πΈ Screenshot Coming Soon]
A modular framework for building personalized AI assistants from scratch. Supports custom model training, retrieval-augmented generation (RAG), conversation memory, and extensible plugin architecture.
Perfect for:
- Learning how AI assistants work under the hood
- Building custom AI solutions for personal use
- Experimenting with different AI models and techniques
- Privacy-focused AI with local processing
- π€ Custom AI Engine - Integrate any model (HuggingFace, OpenAI, Ollama)
- πΎ Conversation Memory - Persistent context across sessions
- π RAG Support - Retrieval-augmented generation for knowledge bases
- π Plugin Architecture - Extensible with custom tools and skills
- π― CLI Interface - Simple command-line interaction
- π‘οΈ Privacy-First - Local processing option, no data leaks
- βοΈ Modular Design - Easy to customize and extend
- Python 3.8 or higher
- pip package manager
- (Optional) Ollama for local AI models
-
Clone and navigate:
cd personal-ai -
Create virtual environment:
python3 -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Run the CLI:
python src/cli.py
$ python src/cli.py
π€ Personal AI - Ready to chat!
Type 'exit' to quit, 'clear' to reset conversation
You: Hello! What can you do?
AI: I'm your personal AI assistant. I can help with...
You: Tell me about Python
AI: Python is a high-level programming language...personal-ai/
βββ src/
β βββ core/
β β βββ ai_engine.py # Core AI model integration
β β βββ memory.py # Conversation memory manager
β β βββ embeddings.py # Text embeddings for RAG
β βββ models/
β β βββ base.py # Base model interface
β β βββ ollama.py # Ollama integration
β β βββ openai.py # OpenAI integration
β βββ data/
β β βββ processor.py # Data preprocessing
β β βββ vectorstore.py # Vector database
β βββ utils/
β β βββ config.py # Configuration management
β β βββ logger.py # Logging utilities
β βββ cli.py # Command-line interface
β βββ main.py # Main application
βββ tests/ # Unit tests
βββ docs/ # Documentation
βββ config/
β βββ default.yaml # Default configuration
βββ data/ # User data & documents
βββ models/ # Downloaded model files
βββ logs/ # Application logs
from src.core.ai_engine import AIEngine
engine = AIEngine(model="ollama/llama2")
response = engine.chat("What is machine learning?")
print(response)from src.core.ai_engine import AIEngine
from src.core.memory import ConversationMemory
memory = ConversationMemory()
engine = AIEngine(memory=memory)
engine.chat("My name is John")
engine.chat("What's my name?") # AI remembers contextfrom src.core.ai_engine import AIEngine
from src.data.vectorstore import VectorStore
vectorstore = VectorStore()
vectorstore.add_documents(["path/to/docs"])
engine = AIEngine(vectorstore=vectorstore)
response = engine.chat("Summarize the documentation")Edit config/default.yaml:
ai:
provider: ollama # Options: ollama, openai, huggingface
model: llama2
temperature: 0.7
max_tokens: 500
memory:
enabled: true
max_history: 10
rag:
enabled: false
chunk_size: 500
overlap: 50# For OpenAI (if using)
export OPENAI_API_KEY=your_key_here
# For HuggingFace (if using)
export HUGGINGFACE_TOKEN=your_token_here- Language: Python 3.8+
- AI Integration: HuggingFace Transformers, OpenAI API, Ollama
- Embeddings: Sentence Transformers
- Vector Store: ChromaDB / FAISS
- CLI: Click / argparse
- Testing: pytest
- Project structure and architecture
- Configuration system
- Logging utilities
- Core AI engine (IN PROGRESS)
- Conversation memory
- RAG implementation
- CLI interface
- Plugin system
- Web interface
- Documentation
- Implement AI engine with model loading
- Add basic conversation memory
- Create functional CLI
- RAG with document ingestion
- Plugin architecture
- Multiple model support
- Web interface
- Model fine-tuning tools
- Comprehensive documentation
source .venv/bin/activate
python src/cli.py --debugpytest tests/ -vblack src/
flake8 src/Import errors:
source .venv/bin/activate
pip install -r requirements.txtModel loading slow:
- First load downloads models (can take time)
- Models are cached for subsequent runs
- Use smaller models for faster startup
Memory issues:
- Reduce max_tokens in config
- Use quantized models
- Clear conversation history regularly
Contributions welcome! This project is actively being developed.
Areas needing work:
- Core AI engine implementation
- RAG system
- Additional model integrations
- Documentation
- Tests
MIT License - Free to use and modify!
- HuggingFace Transformers
- Ollama Documentation
- LangChain - Inspiration for architecture
- ChromaDB - Vector database