A robust AI companion created to help the citizens of Akwa Ibom State of Nigeria to enjoy the richness of their culture and indigenous services via an indigenous based AI companion
# Ibom AI - The State Companion
A robust indigenous AI application for Akwa Ibom State, built with React (Frontend) and Django (Backend), powered by Google Gemini.
## Prerequisites
1. **Node.js** (v16+)
2. **Python** (v3.9+)
3. **Google Gemini API Key** (Get it from AI Studio)
## 1. Backend Setup (Django)
The backend handles user profiles, chat history, and the "Indigenous RAG" system.
1. **Environment Setup**:
Create a `.env` file in the root directory:
```env
API_KEY=your_google_gemini_api_key_here
SECRET_KEY=your_django_secret_key
DEBUG=True
```
2. **Install Dependencies**:
```bash
pip install -r requirements.txt
```
3. **Initialize Database**:
```bash
python manage.py makemigrations
python manage.py migrate
```
4. **Seed Indigenous Data**:
This populates the AI's knowledge base with local facts (food, history) and community tribes.
```bash
python manage.py seed_data
```
5. **Run Server**:
```bash
python manage.py runserver
```
Backend will run at `
localhost`.
## 2. Frontend Setup (React)
1. **Install Dependencies**:
```bash
npm install
```
2. **Run Development Server**:
```bash
npm start
# OR if using Vite
npm run dev
```
## 3. How It Works
* **RAG (Retrieval Augmented Generation)**: When you chat, the Django backend checks the `CulturalAsset` table. If you mention "Afang" or "History", it injects verified local facts into the AI's prompt before sending it to Gemini.
* **Live History**: Chat sessions are stored in SQLite and persisted across reloads.
* **Community**: You can join Tribes (seeded by the script) and send buddy requests to other users.
## Troubleshooting
* **Flask vs Django**: Ignore the `app.py` and `backend/` folder if they exist. We are using the Django structure defined in `ibom_ai/` and `api/`.
* **Missing API Key**: Ensure `API_KEY` is set in your `.env` file or the AI will fail to reply.