A personalized AI assistant (FroggyTalk Prototype) built with FastAPI and GPT to provide immigrants and the African diaspora with warm, actionable, and location-specific relocation advice and action plans.
# FroggyTalk Prototype
## Overview
This is a prototype for FroggyTalk, a personalized AI assistant designed to help users (with a focus on African diaspora experiences) with purposes like immigration, job search, education, visa renewal, or general inquiries. It collects user data via a simple React frontend, stores it in a SQLite database, generates personalized responses using an LLM (OpenAI or fallback), and supports a "training" mechanism via synthetic examples and few-shot prompting.
The prototype fulfills the take-home assignment requirements:
- User data collection and storage.
- Personalized LLM responses with base and trained models.
- Synthetic training examples generation.
- API endpoints for collection, generation, training, and health checks.
- Minimal frontend with form, model selection, and response display.
The project is structured into two main folders:
- **backend/**: Contains the Python/FastAPI server, database logic, LLM integration, and training script.
- **frontend/**: Contains the React application for the user interface.
## Architecture
- **Frontend (frontend/ folder)**: Built with React (using Vite for build tooling and `react-lottie-player` for animations). Key files:
- `src/App.jsx`: Main component with tabs for "Create Profile" (form to collect user data), "Generate Response" (input user ID, select model, generate), and "History" (view past responses).
- Form fields for full name, countries, purpose, language, and additional info.
- Model selection (base or trained) via clickable cards.
- Displays formatted responses (parses markdown for bold, lists).
- `src/assets/`: Lottie animations (frog-success.json, frog-wave.json).
- Quick-select for saved users and a fun frog animation.
- Communicates with backend via fetch to `/collect`, `/generate`, etc.
- Other files: `index.html`, `main.jsx`, `App.css`, `index.css`, `.gitignore`, `eslint.config.js`, `package.json`, `vite.config.js`.
- **Backend (backend/ folder)**: FastAPI application. …