Axon is a full-stack AI workspace that lets users upload documents (PDFs, databases) and interact with them through an intelligent conversational agent. The backend combines Django REST Framework with LangGraph for multi-model AI orchestration, while the frontend features a modern React + TypeScript interface with smooth animations powered by GSAP and Framer Motion.
| Layer | Technologies |
|---|---|
| Backend | Django 5 Β· Django REST Framework Β· LangGraph Β· LangChain Β· Gemini Β· OpenAI Β· Tavily |
| Frontend | React 19 Β· Vite Β· TypeScript Β· TailwindCSS 4 Β· GSAP Β· Framer Motion Β· Monaco Editor |
| Database | SQLite (default) Β· PostgreSQL/MySQL (configurable) |
| Export | python-docx Β· openpyxl (DOCX/XLSX generation) |
| Deployment | Ansible Β· Gunicorn Β· Vercel (frontend) |
- Gemini 2.0 Flash (default) and GPT-4o support
- User-selectable model via settings
- Graceful fallback when API keys are missing
- PDF upload with automatic RAG (Retrieval Augmented Generation)
- Document context used in conversations
- Per-conversation document management (add/remove documents mid-chat)
- Connect to external SQL databases (PostgreSQL, MySQL)
- Upload SQLite files for analysis
- Interactive schema visualization with Mermaid diagrams
- Natural language to SQL query generation
- Query result export to XLSX
- Persistent chat history with message threading
- Message actions: copy, like, dislike, report
- Source citations for AI responses
- Export conversations to DOCX or ZIP (includes all attachments)
- Delete conversations with associated files
- Token-based authentication
- User registration, login, logout
- Password reset with email confirmation
- Profile management
- Animated dashboard with GSAP hero treatments
- Framer Motion for smooth transitions
- Monaco Editor for SQL queries
- Dark theme with blue accent (#2563eb)
- Responsive design
- Python 3.13+
- Node.js 18+ (LTS recommended)
- API Keys: Google AI (Gemini) and/or OpenAI, Tavily (for web search)
```bash git clone https://github.com/vedantlahane/Axon.git cd Axon ```
```bash cd backend python3 -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
cp .env.example .env
python manage.py migrate python manage.py collectstatic --noinput python manage.py runserver ```
```bash cd ../frontend npm install echo "VITE_API_BASE_URL=http://localhost:8000/api" > .env npm run dev ```
| Service | URL |
|---|---|
| Web App | http://localhost:5173 |
| API Root | http://localhost:8000/api/ |
| Django Admin | http://localhost:8000/admin/ |
| Health Check | http://localhost:8000/api/health/ |
```env
GOOGLE_API_KEY=your-gemini-api-key OPENAI_API_KEY=sk-... TAVILY_API_KEY=tvly-...
DJANGO_SECRET_KEY=your-secret-key DJANGO_DEBUG=True DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
FRONTEND_ORIGINS=http://localhost:5173,https://your-domain.com CSRF_TRUSTED_ORIGINS=http://localhost:5173,https://your-domain.com
DATABASE_URL=postgres://user:pass@host:5432/dbname
STATIC_ROOT=staticfiles MEDIA_ROOT=media ```
```env VITE_API_BASE_URL=http://localhost:8000/api ```
All endpoints are prefixed with `/api/`.
| Method | Endpoint | Description |
|---|---|---|
| POST | `/auth/register/` | User registration |
| POST | `/auth/login/` | User login |
| POST | `/auth/logout/` | User logout |
| GET | `/auth/me/` | Current user info |
| POST | `/auth/password/reset/` | Request password reset |
| POST | `/auth/password/change/` | Change password |
| PATCH | `/auth/profile/` | Update profile |
| Method | Endpoint | Description |
|---|---|---|
| GET | `/documents/` | List user documents |
| POST | `/documents/` | Upload document |
| DELETE | `/documents/{id}/` | Delete document |
| Method | Endpoint | Description |
|---|---|---|
| GET | `/conversations/` | List conversations |
| GET | `/conversations/{id}/` | Get conversation detail |
| DELETE | `/conversations/{id}/` | Delete conversation |
| POST | `/chat/` | Send message |
| GET | `/conversations/{id}/documents/` | List conversation docs |
| DELETE | `/conversations/{id}/documents/{doc_id}/` | Remove doc from conversation |
| GET | `/conversations/{id}/export/` | Export to DOCX |
| GET | `/conversations/{id}/export/zip/` | Export to ZIP |
| Method | Endpoint | Description |
|---|---|---|
| GET/POST | `/database/connection/` | Manage DB connection |
| POST | `/database/connection/test/` | Test connection |
| POST | `/database/upload/` | Upload SQLite file |
| GET | `/database/schema/` | Get database schema |
| POST | `/database/query/` | Execute SQL query |
| GET | `/database/query/suggestions/` | Get query suggestions |
| GET | `/database/export/` | Export results to XLSX |
| Method | Endpoint | Description |
|---|---|---|
| GET | `/models/` | List available models |
| POST | `/models/set/` | Set active model |
| GET | `/preferences/` | Get user preferences |
| PATCH | `/preferences/update/` | Update preferences |
| Method | Endpoint | Description |
|---|---|---|
| POST | `/messages/{id}/feedback/` | Submit feedback |
| DELETE | `/messages/{id}/feedback/delete/` | Remove feedback |
``` Axon/ βββ backend/ β βββ agent/ # Main Django app β β βββ models.py # Conversation, Message, Document, Feedback models β β βββ views.py # API endpoints (~2100 lines) β β βββ urls.py # URL routing β β βββ agent_new/ # LangGraph agent implementation β β βββ agent.py # Multi-model ReAct agent β β βββ pdf_tool.py # PDF RAG tool β β βββ sql_tool.py # SQL query tool β β βββ tavily_search_tool.py β βββ backend/ # Django project settings β βββ media/ # Uploaded files β βββ requirements.txt βββ frontend/ β βββ src/ β β βββ components/ β β β βββ AuthModal.tsx β β β βββ Canvas.tsx # SQL results & schema view β β β βββ ChatDisplay.tsx # Message rendering β β β βββ DatabaseConnectionModal.tsx β β β βββ InputSection.tsx # Chat input β β β βββ MainPanel.tsx # Main content area β β β βββ SchemaDiagram.tsx # Mermaid diagram β β β βββ Sidebar.tsx # Conversation list β β βββ services/ β β β βββ chatApi.ts # API client β β βββ App.tsx # Root component β βββ package.json βββ ansible/ # Infrastructure automation βββ playbooks/ βββ inventory/ ```
```bash
cd backend source venv/bin/activate python manage.py test agent
cd frontend npm run lint npm run build ```
- Backend: Add views in `agent/views.py`, URLs in `agent/urls.py`
- Frontend: Add components in `src/components/`, API calls in `services/chatApi.ts`
- AI Tools: Add new tools in `agent/agent_new/`
Axon uses Ansible for automated infrastructure provisioning and deployment.
Quick Deploy:
cd ansible
ansible-playbook -i inventory/hosts.ini playbooks/deploy_backend.yml --vault-password-file .vault_passwordComplete Documentation:
- π Deployment Guide - Comprehensive deployment instructions
- π Ansible README - Infrastructure automation & secrets management
- ποΈ Vault Setup - Secure API key management
The frontend is configured for Vercel deployment. Set VITE_API_BASE_URL in Vercel environment variables.
Frontend Setup:
- See frontend/README.md for development and build instructions
- Automatic deployments from main branch
- Environment variables managed in Vercel dashboard
| Document | Description |
|---|---|
| Deployment Guide | Complete production deployment instructions |
| Ansible README | Infrastructure automation & secrets management |
| Vault Setup | Secure API key encryption with Ansible Vault |
| Frontend README | Frontend development and deployment |
| Presentation Materials | Slides and scripts for project presentations |
Distributed under the MIT License. See LICENSE for more information.
Made with β€οΈ by Vedant Lahane


