AEVA is an intelligent study assistant that combines document processing with AI-powered chat capabilities. It allows users to upload PDF documents, ask questions about the content, and get AI-generated responses based on the uploaded materials or real-time web search.
- Document Processing: Upload and process PDF documents for intelligent querying
- AI-Powered Chat: Get contextual responses based on uploaded documents
- Web Search Integration: Real-time web search capabilities for current information
- Modern UI: Clean, responsive interface built with React and Tailwind CSS
- Fast API Backend: High-performance backend built with FastAPI
- Vector Database: Efficient document storage and retrieval using ChromaDB
aeva/
βββ backend/ # FastAPI backend
β βββ app/
β β βββ logics/ # Business logic modules
β β βββ routers/ # API route handlers
β β βββ main.py # FastAPI application entry point
β βββ requirements.txt # Python dependencies
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom React hooks
β βββ package.json # Node.js dependencies
βββ README.md # This file
- FastAPI: Modern, fast web framework for building APIs
- ChromaDB: Vector database for document embeddings
- Sentence Transformers: For document embedding generation
- Groq API: High-performance AI model inference
- Serper API: Web search capabilities
- React 18: Modern React with hooks and concurrent features
- TypeScript: Type-safe JavaScript development
- Vite: Fast build tool and development server
- Tailwind CSS: Utility-first CSS framework
- Shadcn/ui: High-quality React components
- Axios: HTTP client for API communication
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- npm or yarn or bun
- pip or conda
git clone <repository-url>
cd aevaThe project uses environment variables for configuration. Follow these steps:
# Copy the main environment template
cp env.example .env
# Copy backend environment templates
cp backend/env.development backend/.env.development
cp backend/env.production backend/.env.production
# Copy frontend environment templates
cp frontend/env.development frontend/.env.development
cp frontend/env.production frontend/.env.productionEdit the .env files and add your API keys:
Required API Keys:
- Groq API Key: Get from Groq Console
- Serper API Key: Get from Serper.dev
Example .env configuration:
# Backend Configuration
GROQ_API_KEY=your_groq_api_key_here
X-API-KEY=your_serper_api_key_here
GROQ_MODEL=llama3-8b-8192
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8080,http://localhost:5173
# Frontend Configuration
VITE_API_URL=http://localhost:8000
VITE_APP_NAME=AEVA Study Assistantcd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Download spaCy model (required for text processing)
python -m spacy download en_core_web_sm
# Start the development server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000The backend API will be available at http://localhost:8000
cd frontend
# Install dependencies
npm install
# or
yarn install
# or
bun install
# Start the development server
npm run dev
# or
yarn dev
# or
bun devThe frontend will be available at http://localhost:5173
aeva/
βββ env.example # Main environment template
βββ backend/
β βββ env.development # Backend development config
β βββ env.production # Backend production config
βββ frontend/
βββ env.development # Frontend development config
βββ env.production # Frontend production config
GROQ_API_KEY: API key for Groq AI model accessX-API-KEY: API key for Serper web searchGROQ_MODEL: AI model selection (default: llama3-8b-8192)ALLOWED_ORIGINS: CORS allowed originsPORT: Server port (default: 8000)HOST: Server host (default: 0.0.0.0)CHROMA_DB_PATH: ChromaDB storage pathLOG_LEVEL: Logging level (INFO/DEBUG)
VITE_API_URL: Backend API base URLVITE_APP_NAME: Application nameVITE_APP_VERSION: Application versionVITE_ENABLE_FILE_UPLOAD: Enable file upload featureVITE_ENABLE_WEB_SEARCH: Enable web search featureVITE_MAX_FILE_SIZE: Maximum file size in bytesVITE_MAX_FILES: Maximum number of filesVITE_DEBUG: Enable debug mode
- Debug logging enabled
- Hot reload enabled
- Localhost origins allowed
- Development-specific features enabled
- Optimized logging
- Security-focused settings
- Production domain origins
- Performance optimizations
- Click the file upload area or drag and drop PDF files
- Supported format: PDF
- Maximum file size: 10MB (configurable)
- Maximum files: 5 (configurable)
- Select "PDF Mode" to ask questions about uploaded documents
- The AI will search through your documents and provide contextual answers
- View source information and page numbers for responses
- Select "Web Mode" to search the internet for current information
- Get real-time answers based on web search results
- View source links and metadata
Once the backend server is running, you can access:
- Interactive API Docs:
http://localhost:8000/docs - ReDoc Documentation:
http://localhost:8000/redoc
POST /upload/
Content-Type: multipart/form-data
POST /chat/
Content-Type: application/json
{
"message": "Your question here",
"n_results": 5,
"search_mode": "study_material" // or "web_search"
}
- API Keys: Never commit API keys to version control
- Environment Files: Keep
.envfiles secure and out of version control - CORS: Configure allowed origins properly for production
- File Uploads: Implement proper file validation and size limits
- Rate Limiting: Consider implementing rate limiting for production
# Backend tests
cd backend
python -m pytest
# Frontend tests
cd frontend
npm test# Backend linting
cd backend
flake8 app/
black app/
# Frontend linting
cd frontend
npm run lint
npm run format- Set up production environment variables
- Use a production WSGI server (Gunicorn)
- Configure reverse proxy (Nginx)
- Set up proper logging and monitoring
- Build the production bundle:
npm run build - Deploy to static hosting (Vercel, Netlify, etc.)
- Configure environment variables for production
- Set up proper CORS origins
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues:
- Check the Issues page
- Review the environment configuration
- Ensure all dependencies are properly installed
- Check the API documentation at
/docs
To update the project:
# Backend updates
cd backend
pip install -r requirements.txt --upgrade
# Frontend updates
cd frontend
npm updateNote: Make sure to replace placeholder values in environment files with your actual API keys and configuration before running the application.