A comprehensive AI-powered team productivity platform featuring HR knowledge management, personalized skill development, and team collaboration tools. Built with FastAPI backend and React frontend.
- RAG-powered HR Manual Search: Query company policies and procedures using hybrid search (BM25 + FAISS)
- Intelligent Citations: Accurate source references with page numbers
- Real-time Chat Interface: Modern, responsive chat UI with message history
- Example Questions: Pre-built queries to help users get started
- Personal Development Plans (PDP): AI-generated personalized skill development programs
- User-Specific Recommendations: Based on individual skills, position, and goals
- Progressive Loading States: Engaging user experience with humorous loading messages
- HTML-Rich Content: Comprehensive PDPs with structured learning paths
- Coming Soon: Advanced team collaboration and memory management features
- Future Integration: Planned features for team knowledge sharing and project management
- Hybrid Search Engine: BM25 (keyword) + FAISS (semantic) with Reciprocal Rank Fusion
- AI Response Generation: GPT-4o-mini for intelligent content creation
- User Authentication: Token-based authentication with team member management
- RESTful API: Clean, documented endpoints with automatic OpenAPI docs
- Modern UI: Tailwind CSS with responsive design
- State Management: React Context API with comprehensive state handling
- Tab-based Navigation: Clean, intuitive user interface
- Real-time Updates: Dynamic content updates and loading states
- FastAPI: Modern Python web framework
- OpenAI GPT-4o-mini: AI language model for content generation
- FAISS: Vector similarity search
- BM25: Keyword-based search
- PyMuPDF: PDF processing
- Pydantic: Data validation and serialization
- React 18: Modern React with hooks
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first CSS framework
- Vite: Fast build tool and dev server
- Axios: HTTP client for API communication
- Lucide React: Beautiful icon library
- Docker and Docker Compose
- OpenAI API key
- Git
git clone <repository-url>
cd test-chat
cp env.template .envEdit .env file with your credentials:
OPENAI_API_KEY=your_openai_api_key_here
API_TOKEN=your_api_token_herechmod +x start-docker-dev.sh
./start-docker-dev.sh- Main App: http://localhost:80
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
- API Docs: http://localhost:8080/docs
test-chat/
βββ app/ # FastAPI backend
β βββ main.py # Main application and API endpoints
β βββ models.py # Pydantic data models
β βββ auth.py # Authentication logic
β βββ response_generator.py # AI response generation
β βββ retrieval.py # Hybrid search implementation
β βββ index_manager.py # Index management
β βββ config.py # Configuration management
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β β βββ KnowledgeQA.tsx # HR manual chat interface
β β β βββ SkillSmith.tsx # PDP generation interface
β β β βββ TeamMemoryAgent.tsx # Team collaboration (coming soon)
β β β βββ TabNavigation.tsx # Navigation component
β β βββ contexts/ # React context providers
β β βββ services/ # API client
β β βββ types/ # TypeScript type definitions
β βββ package.json # Frontend dependencies
βββ scripts/ # Data processing scripts
β βββ ingest.py # PDF ingestion and indexing
β βββ pdf_processor.py # PDF text extraction
β βββ text_chunker.py # Text chunking logic
β βββ index_builder.py # Index creation
βββ data/ # Data directory
β βββ HR_Manual.pdf # Source HR manual
β βββ team.json # Team member data
β βββ index/ # Generated search indexes
βββ docker-compose.yml # Docker configuration
βββ requirements.txt # Python dependencies
βββ README.md # This file
| Variable | Default | Description |
|---|---|---|
OPENAI_API_KEY |
Required | OpenAI API key for AI features |
API_TOKEN |
Optional | Bearer token for API security |
CHAT_MODEL |
gpt-4o-mini |
OpenAI chat completion model |
EMBEDDING_MODEL |
text-embedding-3-large |
OpenAI embedding model |
DATA_DIR |
/var/data |
Data storage directory |
INDEX_DIR |
/var/data/index |
Index storage directory |
Team members are configured in data/team.json with:
- Personal information (name, position, birth date)
- Skills (hard skills and soft skills)
- Authentication tokens
- Notion workspace URLs
POST /validate-user-token- Validate user ID token and return user dataGET /team- Get team member information
POST /ask- Query HR manual with hybrid searchGET /healthz- Health check endpoint
POST /generate-course- Generate personalized development plan
POST /ingest- Rebuild indexes from PDF file
Ask questions about company policies:
- "What is the vacation policy?"
- "How do I request time off?"
- "What are the working hours?"
- "What is the dress code policy?"
Generate personalized development plans:
- "I want to improve my technical skills"
- "Help me develop leadership capabilities"
- "Create a plan for career advancement"
The system uses token-based authentication:
- Users authenticate with their ID token
- Tokens are validated against
team.json - User data is loaded and displayed in the UI
- All API requests include the token in the Authorization header
docker-compose -f docker-compose.dev.yml up --builddocker-compose up --buildMultiple Docker Compose files available:
docker-compose.dev.yml- Development environmentdocker-compose.full.yml- Full production setupdocker-compose.render.yml- Render.com deployment
- BM25 Retrieval: Keyword-based search using Okapi BM25
- FAISS Retrieval: Semantic search using HNSW index
- Reciprocal Rank Fusion: Merges results with RRF score calculation
- Citation Generation: Automatic source references with page numbers
- GPT-4o-mini: Used for both HR Q&A and PDP generation
- Temperature: 0.1 for consistent, factual responses
- Context Management: User-specific context for personalized content
- Response Validation: Structured output with error handling
- PDF Processing: PyMuPDF for text extraction
- Chunking: 800-1200 token chunks with 100 token overlap
- Metadata Preservation: Headings, page numbers, and structure
- Index Management: Automatic index loading and caching
# Install dependencies
pip install -r requirements.txt
# Run development server
uvicorn app.main:app --host 0.0.0.0 --port 8080 --reloadcd frontend
npm install
npm run devpython scripts/ingest.py --pdf data/HR_Manual.pdf- Search Latency: < 1 second for most queries
- AI Generation: 5-15 seconds for PDP generation
- Concurrent Users: Supports multiple simultaneous users
- Caching: Response caching for improved performance
- Token Authentication: Secure user authentication
- CORS Configuration: Proper cross-origin resource sharing
- Input Validation: Pydantic models for request validation
- Error Handling: Comprehensive error handling and logging
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is proprietary software developed for internal team use.
For technical support or questions:
- Check the API documentation at
/docs - Review the health check at
/healthz - Examine logs for debugging information
Cheatix Team Assistance - Empowering teams with AI-driven productivity tools.