Thunaivan is a multilingual AI chatbot designed to provide intelligent, helpful, and natural conversations across knowledge, education, programming, science, mathematics, technology, writing, and creative tasks.
Thunaivan means "Companion" in Tamil.
The goal of this project is to build an AI companion that can understand user questions, maintain conversation context, retrieve useful information, and provide clear and helpful responses.
Thunaivan is currently being developed as a Flask-based AI chatbot and is planned to evolve into a RAG-powered intelligent assistant with a custom knowledge base, semantic search, conversation memory, multimodal capabilities, and voice interaction.
- ๐ฌ AI-powered conversations
- ๐ Multilingual communication
- ๐ฌ๐ง English
- ๐ฎ๐ณ Tamil
- ๐ฎ๐ณ Hindi
- ๐ฎ๐ณ Telugu
- ๐ฎ๐ณ Kannada
- ๐ฎ๐ณ Malayalam
- ๐ง Context-aware conversations
- ๐ General knowledge assistance
- ๐ Educational assistance
- ๐ป Programming assistance
- ๐ข Mathematics and problem solving
- ๐ฌ Science explanations
- ๐ Writing assistance
- ๐ก Creative ideas
- ๐ Galaxy-themed user interface
- ๐ฑ Responsive web interface
- โก Flask backend
- ๐ Environment-based API key configuration
Thunaivan is designed to help users with:
- General questions
- Programming and coding
- Computer science
- Artificial intelligence
- Machine learning
- Mathematics
- Science
- Education
- Technology
- Writing
- Summarization
- Explanation of difficult concepts
- Problem solving
- Creative brainstorming
- Project ideas
- Learning assistance
The chatbot attempts to respond in the same language as the user whenever possible.
One of the main future upgrades for Thunaivan is Retrieval-Augmented Generation (RAG).
Traditional AI systems depend mainly on the knowledge available inside the model. RAG allows Thunaivan to retrieve relevant information from an external knowledge base before generating an answer.
User Question
โ
Question Processing
โ
Semantic Search
โ
Relevant Documents
โ
Context Construction
โ
AI Model
โ
Grounded Answer
โ
Sources
RAG can help Thunaivan provide more relevant and knowledge-grounded responses.
The future Thunaivan knowledge base can contain:
- Educational materials
- Programming documentation
- Computer science notes
- AI/ML resources
- Mathematics resources
- Science materials
- Project documentation
- PDFs
- Text files
- Markdown files
- Personal notes
- Technical documentation
- Trusted reference materials
The knowledge base can be continuously expanded as new information is added.
PDF / TXT / MD / Documentation
โ
Knowledge Base
Documents will be cleaned and divided into smaller chunks.
Document
โ
Text Extraction
โ
Cleaning
โ
Chunking
Each text chunk can be converted into a numerical vector using an embedding model.
Text Chunk
โ
Embedding Model
โ
Vector
The vectors can be stored in a vector database such as:
- FAISS
- Chroma
- Pinecone
- Qdrant
- Weaviate
When a user asks a question, Thunaivan searches for the most relevant information.
Question
โ
Query Embedding
โ
Vector Search
โ
Top Relevant Chunks
The retrieved information is provided to the AI model along with the user's question.
Question + Retrieved Context
โ
AI Model
โ
Final Answer
Future versions will focus on improving response quality using:
- Better prompt engineering
- RAG
- Semantic search
- Hybrid search
- Query rewriting
- Query expansion
- Document reranking
- Context compression
- Relevant document selection
- Source citations
- Conversation context
- Response evaluation
- Knowledge freshness
- Hallucination reduction
The goal is to retrieve useful information, not simply retrieve a large amount of information.
A future version will include improved conversation memory.
Example:
User:
What is Python?
Thunaivan:
Python is a high-level programming language.
User:
What are its advantages?
Thunaivan:
Python has several advantages...
The second question can use the context of the previous conversation.
Planned memory features:
- Short-term conversation memory
- Conversation summaries
- Long-term memory
- User preferences
- Conversation history
- Memory controls
- Conversation search
RAG can allow Thunaivan to provide references for retrieved information.
Example:
Thunaivan:
Python is a high-level programming language...
Sources:
- Python Documentation
- Programming Knowledge Base
- Custom Learning Materials
This can make responses easier to verify and improve trust in knowledge-based answers.
Thunaivan is designed to support multiple languages.
- English
- Tamil
- Hindi
- Telugu
- Kannada
- Malayalam
More Indian and international languages can be added as the project develops.
The system should detect the user's language and respond appropriately whenever possible.
โโโโโโโโโโโโโโโโโ
โ User โ
โโโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโ
โ Web UI โ
โโโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโ
โ Flask Backend โ
โโโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโ
โ AI API โ
โโโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโ
โ AI Response โ
โโโโโโโโโโโโโโโโโ
User
โ
Web UI
โ
Flask Backend
โ
Query Processing
โ
โโโโโโโโโโโโโโโโโโโ
โ Semantic Search โ
โโโโโโโโโโฌโโโโโโโโโ
โ
Knowledge Base
โ
Relevant Context
โ
AI Model
โ
Final Answer
โ
Sources
- Python
- Flask
- OpenAI API
- HTML
- CSS
- JavaScript
- Embedding Models
- Vector Databases
- Semantic Search
- RAG Pipeline
- Document Processing
- Reranking
- Git
- GitHub
- VS Code
- Python Virtual Environment
Thunaivan/
โ
โโโ app.py
โโโ requirements.txt
โโโ README.md
โโโ .env
โโโ .gitignore
โ
โโโ templates/
โ โโโ index.html
โ
โโโ static/
โ โโโ css/
โ โ โโโ style.css
โ โโโ js/
โ โโโ script.js
โ
โโโ rag/
โ โโโ document_loader.py
โ โโโ chunker.py
โ โโโ embeddings.py
โ โโโ retriever.py
โ โโโ pipeline.py
โ
โโโ knowledge_base/
โ โโโ documents/
โ โโโ processed/
โ
โโโ tests/
โโโ test_chat.py
โโโ test_rag.py
- RAG-based question answering
- Improved reasoning
- Better contextual understanding
- Query rewriting
- Response verification
- Multiple AI model support
- Model selection
- Hallucination reduction
- PDF upload
- Document ingestion
- Vector database
- Semantic search
- Hybrid search
- Source citations
- Knowledge updates
- Document management
- Conversation history
- Long-term memory
- Conversation summaries
- User preferences
- Memory controls
- Conversation search
Future versions may include:
- Speech-to-text
- Text-to-speech
- Voice conversations
- Voice commands
- Multilingual voice support
๐ค User
โ
Speech-to-Text
โ
Thunaivan AI
โ
Text-to-Speech
โ
๐ Thunaivan
Planned support for:
- Image understanding
- Image questions
- PDF analysis
- Screenshot analysis
- OCR
- Diagram understanding
- Document analysis
Future features may include:
- Code generation
- Code explanation
- Debugging
- Error analysis
- Code optimization
- Documentation generation
- Git/GitHub assistance
- Multiple programming languages
Possible features:
- Step-by-step explanations
- Study plans
- Quiz generation
- Practice questions
- Flashcards
- Exam preparation
- Summaries
- Personalized learning
A future version may optionally retrieve current information from trusted online sources.
Possible capabilities:
- Web search
- Documentation search
- Current information lookup
- News retrieval
- Source citations
Future interface improvements include:
- Responsive mobile design
- Dark/light themes
- Animated galaxy background
- Message animations
- Markdown rendering
- Code syntax highlighting
- Copy response button
- Regenerate response
- Stop generation
- Chat history
- Conversation search
- File upload
- Voice controls
Security will be an important part of future development.
Planned protections:
- Secure API key management
- Environment variables
- Input validation
- Rate limiting
- Authentication
- Secure file uploads
- Access control
- User data protection
- Conversation privacy
- Safe document processing
Never commit API keys or secrets to GitHub.
Example .env:
OPENAI_API_KEY=your_api_key_hereExample .gitignore:
.env
venv/
.venv/
__pycache__/
*.pyc
Future development will include automated testing.
Testing areas:
- Chat functionality
- API endpoints
- RAG retrieval
- Document processing
- Multilingual responses
- Conversation memory
- Error handling
- Security
- Performance
Possible evaluation metrics:
Retrieval
โ Precision
โ Recall
โ Recall@K
โ MRR
โ NDCG
Generation
โ Relevance
โ Correctness
โ Groundedness
โ Completeness
โ Citation Accuracy
- Flask backend
- Web interface
- AI API integration
- Basic conversation
- Galaxy-themed UI
- Chat history
- Markdown support
- Code highlighting
- Regenerate response
- Better error handling
- Mobile optimization
- Document ingestion
- Text chunking
- Embeddings
- Vector database
- Semantic retrieval
- Context-aware generation
- Source citations
- Conversation summaries
- Long-term memory
- User preferences
- Memory controls
- Conversation search
- Image understanding
- PDF analysis
- OCR
- Screenshot analysis
- Document understanding
- Speech-to-text
- Text-to-speech
- Voice conversations
- Multilingual voice
- Authentication
- Database
- Rate limiting
- Monitoring
- Automated testing
- Deployment
- Performance optimization
git clone https://github.com/YOUR_USERNAME/Thunaivan.git
cd ThunaivanWindows:
python -m venv venv
venv\Scripts\activateLinux/macOS:
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate .env:
OPENAI_API_KEY=your_api_key_herepython app.pyOpen:
http://127.0.0.1:5000
๐ง Thunaivan is currently under active development.
The current version provides the foundation for an AI chatbot. RAG, vector search, advanced memory, multimodal AI, voice interaction, and production infrastructure are planned future improvements.
Features marked as planned are not necessarily available in the current version.
The long-term vision of Thunaivan is to become a versatile AI companion that can:
Understand
โ
Retrieve
โ
Reason
โ
Explain
โ
Remember
โ
Assist
The project aims to combine conversational AI with reliable external knowledge, multilingual communication, useful tools, and an intuitive user experience.
Contributions and ideas are welcome.
Future contributions can focus on:
- RAG
- AI evaluation
- UI/UX
- Multilingual support
- Voice interaction
- Document processing
- Security
- Testing
- Performance
- Accessibility
This project is currently under development.
A suitable open-source license can be added before public distribution.
If you find Thunaivan interesting:
โญ Star the repository ๐ Report bugs ๐ก Suggest features ๐ง Contribute improvements ๐ Contribute knowledge sources
Built with Python, Flask, AI, and a vision for a smarter digital companion. ๐๐ค