Ingatini is a lightweight Retrieval-Augmented Generation (RAG) application that allows users to upload documents and ask questions about them using AI.
Current Status: Phase 3 ✅ Complete RAG query engine (vector search, LLM augmentation)
- Docker & Docker Compose
- Python 3.13+ (for local development)
- Gemini API key (or configure alternative LLM)
- Git
cd ingatini/
# Copy environment template
cp .env.example .env
# Edit .env and add your Gemini API key
nano .env # or your favorite editor# Option A: Using our dev helper
./dev start
# Option B: Using docker compose directly
docker compose up
# Option C: Using the shell script
bash start.sh# Check API health
curl http://localhost:8000/api/health
# Open API documentation
http://localhost:8000/docscd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Setup environment
cp .env.example .env
# Edit .env with your API keysYou'll need PostgreSQL with pgvector extension running:
# Using Docker for just the database
docker run -d \
--name ingatini_postgres \
-e POSTGRES_USER=user \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=ingatini_db \
-p 5432:5432 \
pgvector/pgvector:pg15# From backend directory
uvicorn main:app --reloadThe API will be available at http://localhost:8000
# View all commands
./dev
# Common commands
./dev start # Start development server
./dev stop # Stop all containers
./dev rebuild # Rebuild and restart
./dev logs # View live logs
./dev shell # Access backend bash shell
./dev test # Run tests
./dev format # Format code (black, isort)
./dev lint # Lint code (flake8)# Start services
docker compose up --build
# View logs
docker compose logs -f backend
# Access backend shell
docker compose exec backend bash
# Stop services
docker compose down
# Clean up everything
docker compose down -vingatini/
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── core/ # Config & database
│ │ ├── api/ # Route handlers
│ │ ├── schemas/ # Pydantic models
│ │ ├── models/ # Database models
│ │ └── services/ # Business logic
│ ├── main.py # Entry point
│ ├── requirements.txt
│ ├── .env.example
│ ├── Dockerfile
│ └── README.md
├── frontend/ # React/Vue frontend (TODO)
├── docker-compose.yml # Dev environment
├── GETTING_STARTED.md # Setup guide
├── IMPLEMENTATION.md # Progress tracking
├── README.md # Project overview
└── dev # Development helper script
GET /api/health# Create user
POST /api/users/
{
"username": "john_doe",
"email": "john@example.com"
}
# Get user
GET /api/users/{user_id}
# List users
GET /api/users/?skip=0&limit=10# Upload document
POST /api/documents/upload?user_id=1
Content-Type: multipart/form-data
[file content]
# List documents
GET /api/documents/{user_id}
# Get document
GET /api/documents/{doc_id}
# Delete document
DELETE /api/documents/{doc_id}# Query documents
POST /api/query/
{
"user_id": 1,
"query_text": "What is the main topic?"
}Key configuration in .env:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/ingatini_db
# Gemini API
GEMINI_API_KEY=your_key_here
GEMINI_EMBEDDING_MODEL=models/embedding-001
GEMINI_LLM_MODEL=gemini-pro
# Application
DEBUG=True
LOG_LEVEL=INFO
CORS_ORIGINS=["http://localhost:3000", "http://localhost:5173"]
# Server
BACKEND_HOST=0.0.0.0
BACKEND_PORT=8000# Health check
curl http://localhost:8000/api/health
# Create user
curl -X POST http://localhost:8000/api/users/ \
-H "Content-Type: application/json" \
-d '{
"username": "testuser",
"email": "test@example.com"
}'
# Upload document
curl -X POST http://localhost:8000/api/documents/upload?user_id=1 \
-F "file=@/path/to/document.txt"Visit http://localhost:8000/docs to interact with the API through the web interface.
- Phase 2: Implement embedding pipeline (document parsing, text chunking, Gemini embeddings)
- Phase 3: Complete RAG query engine (vector search, LLM augmentation)
- Phase 4: Build frontend (React/Vue upload and chat UI)
- Phase 5: Deploy to free hosting (Render, Railway, Vercel)
See IMPLEMENTATION.md for detailed progress tracking.
# Containers won't start
docker compose down -v
docker compose up --build
# Permission denied
sudo chmod +x dev start.sh
# Port already in use
docker compose down# Connect to database
docker compose exec postgres psql -U user -d ingatini_db
# Check tables
\dt
# View pgvector extension
\dx# View backend logs
docker compose logs backend
# Restart backend
docker compose restart backend
# Full rebuild
docker compose up --build --force-recreateTo avoid Gemini costs, use Ollama for local embeddings:
- Install Ollama
- Pull model:
ollama pull mistral - Update
requirements.txtto use LangChain's local embeddings - Set
GEMINI_API_KEYto empty string
PostgreSQL data is stored in a Docker volume (postgres_data). To clear:
docker compose down -vFrontend and backend run on different ports. CORS origins are configured in .env:
CORS_ORIGINS=["http://localhost:3000", "http://localhost:5173"]See individual component README files:
backend/README.md: Backend developmentfrontend/README.md: Frontend developmentIMPLEMENTATION.md: Progress and architecture
MIT