A complete web application that converts PDFs, PPTX files, and text documents into interactive knowledge trees, summaries, flashcards, mind maps, and provides an AI-powered tutor experience.
- Document Upload: Support for PDF, PPTX, and text files
- Multi-Agent AI Processing: 7 specialized AI agents for different tasks
- Knowledge Tree Visualization: Interactive React Flow-based knowledge graphs
- Smart Summaries: 1-page, 5-page, and chapter-based summaries
- Flashcard Generation: Intelligent Q&A pairs with difficulty levels
- AI Tutor: Interactive chat-based learning assistant
- Assessment Tools: Quizzes, MCQs, and adaptive testing
- Next.js 14 - React framework with App Router
- React 18 - Modern React with hooks
- TailwindCSS - Utility-first CSS framework
- React Flow - Interactive node-based graphs
- Lucide React - Beautiful icons
- FastAPI - High-performance Python web framework
- Python 3.12 - Latest Python with type hints
- pdfplumber - PDF text extraction
- python-pptx - PowerPoint processing
- Mistral AI - Advanced language model integration
The application features a modern dark theme inspired by JoyCode's design language:
- Primary Colors: Deep blues and purples
- Accent Colors: Bright gradients (blue to pink)
- Typography: Clean, modern fonts
- Layout: Responsive grid-based design
- Extraction Agent - Extracts chapters, sections, concepts, and definitions
- Simplifier Agent - Rewrites complex concepts into simple explanations
- Knowledge Tree Agent - Creates hierarchical knowledge structures
- Summary Agent - Generates various types of summaries
- Flashcard Agent - Creates Q&A pairs for learning
- Tutor Agent - Provides interactive explanations and guidance
- Assessment Agent - Generates quizzes and evaluations
POST /upload- Upload and process documentsPOST /generate/graph- Generate knowledge treePOST /generate/summary- Create summariesPOST /generate/flashcards- Generate flashcardsPOST /tutor- Interactive tutoringPOST /generate/quiz- Create assessments
- Python 3.12+
- Node.js 18+
- npm or yarn
-
Clone the repository
git clone <repository-url> cd pathtree/backend
-
Install Python dependencies
# Using conda/micromamba (recommended) micromamba install -c conda-forge fastapi uvicorn python-multipart pdfplumber python-pptx mistralai aiofiles pillow nltk scikit-learn pandas -y # Or using pip pip install fastapi uvicorn python-multipart pdfplumber python-pptx mistralai python-dotenv aiofiles Pillow nltk scikit-learn pandas
-
Set up environment variables
# Create .env file echo "MISTRAL_API_KEY=your_mistral_api_key_here" > .env
-
Start the backend server
python main.py
Server will run on
http://localhost:8000
-
Navigate to frontend directory
cd ../frontend -
Install Node.js dependencies
npm install
-
Start the development server
npm run dev
Frontend will run on
http://localhost:3000
- Navigate to the dashboard
- Click the upload area or drag & drop files
- Supported formats: PDF, PPTX, TXT
- After upload, click "Generate Knowledge Tree"
- View interactive node-based visualization
- Click nodes to explore details
- Access the Summaries page
- Choose from 1-page, 5-page, or detailed summaries
- Export or share summaries
- Visit the Flashcards page
- Flip cards to reveal answers
- Mark cards as learned
- Shuffle for random practice
- Open the Tutor Chat page
- Ask questions about your documents
- Get explanations, examples, and practice problems
cd backend
python -m pytest tests/cd frontend
npm test# Start both servers
cd backend && python main.py &
cd frontend && npm run dev &
# Test upload functionality
curl -X POST http://localhost:8000/upload -F "file=@test_document.pdf"pathtree/
βββ backend/
β βββ agents/ # AI agent implementations
β β βββ extraction_agent.py
β β βββ simplifier_agent.py
β β βββ knowledge_tree_agent.py
β β βββ summary_agent.py
β β βββ flashcard_agent.py
β β βββ tutor_agent.py
β β βββ assessment_agent.py
β βββ utils/ # Utility functions
β β βββ mistral_client.py
β β βββ document_processor.py
β β βββ text_chunker.py
β βββ uploads/ # Uploaded files storage
β βββ main.py # FastAPI application
β βββ requirements.txt # Python dependencies
βββ frontend/
β βββ src/
β β βββ app/ # Next.js app directory
β β βββ components/ # React components
β β βββ lib/ # Utility functions
β βββ public/ # Static assets
β βββ package.json # Node.js dependencies
β βββ tailwind.config.js # Tailwind configuration
βββ test_document.txt # Sample test file
βββ README.md # This file
MISTRAL_API_KEY=your_mistral_api_key_here
UPLOAD_DIR=./uploads
MAX_FILE_SIZE=50MBNEXT_PUBLIC_API_URL=http://localhost:8000- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Mistral AI for providing the language model API
- React Flow for the knowledge graph visualization
- FastAPI for the high-performance backend framework
- Next.js for the modern React framework
- TailwindCSS for the utility-first CSS framework
-
Module not found errors
- Ensure all dependencies are installed
- Check Python path and virtual environment
-
API connection issues
- Verify Mistral API key is set correctly
- Check network connectivity
-
File upload failures
- Ensure file size is under limit
- Check file format is supported
-
Frontend build errors
- Clear node_modules and reinstall
- Check Node.js version compatibility
- Open an issue on GitHub
- Check the documentation
- Review the troubleshooting guide
PathTree - Transform your documents into interactive learning experiences! π³β¨