AI Document Intelligence & Automation Platform
Turn Documents Into Actions.
Askwiseo is an AI-powered document intelligence system that helps users turn business documents into searchable knowledge, grounded answers, and actionable insights. The platform ingests PDFs, extracts document content, indexes it for semantic retrieval, and answers user questions with source-aware responses grounded in the uploaded material.
Askwiseo is positioned as a document intelligence and knowledge platform, not merely a PDF chatbot. It combines retrieval-augmented generation, user-scoped indexing, conversation memory, and document-aware AI answers to help users work with large volumes of business content more effectively.
Traditional document workflows often require people to:
- read large documents manually
- search for specific information repeatedly
- extract key points across multiple files
- compare and summarize business content
- re-ask the same questions across many PDFs
Askwiseo addresses this by building a retrieval pipeline around uploaded documents. PDF files are parsed, chunked, embedded, and indexed into a vector store. When a user asks a question, the system retrieves the most relevant document chunks, passes them to Gemini, and returns a grounded answer with source references.
This project is designed as a practical AI engineering application with a real backend, frontend, cloud services integration, and vector-search workflow.
PDF Document
↓
Text Extraction (PyMuPDF)
↓
Chunking + Overlap
↓
Gemini Embeddings
↓
Pinecone Vector Store
↓
Semantic Retrieval
↓
Gemini Answer Generation
↓
Response + Source Metadata
↓
User Knowledge / Action
The repository also includes a lightweight memory layer for conversation summaries and persistent memory extraction under the authenticated user profile.
- PDF upload and validation
- document text extraction with PyMuPDF
- page counting and document metadata capture
- chunk-based document indexing
- Gemini embeddings for document chunks
- Pinecone vector search
- user-scoped namespace isolation
- context retrieval by user and optional document
- grounded answer generation using uploaded material
- Gemini-based Q&A over document context
- citation-like source metadata from matched chunks
- document summaries and topic extraction
- SQL-like structured insight generation for document metadata
- Firebase Authentication integration
- Firebase Admin SDK for backend verification
- Firestore-backed user document and chat records
- user-level data isolation
- chat history persistence in Firestore
- conversation summary tracking
- persistent user memory extraction from chat activity
- plan-based usage and question limits
- PayPal and Razorpay service integrations are present in the backend
ASKWISEO
│
Next.js Frontend
│
Firebase Auth
│
▼
FastAPI API
│
┌─────────────┼─────────────┐
│ │ │
▼ ▼ ▼
Firestore Pinecone Gemini
│ │ │
User Data + Vector Search Embeddings / Gen
Chat Records + Retrieval responses
│ │
└──────┬──────┴──────┐
▼
PDF + Q&A Flow
│
▼
User
The frontend is a Next.js application using App Router and TypeScript. It includes authentication-related screens, a landing page, dashboard-oriented views, pricing, and supporting app pages. The app uses Firebase client SDK for auth and communicates with the backend via API rewrites and environment configuration.
The backend is a FastAPI application. It exposes upload, chat, document, metrics, and health endpoints. It validates user tokens through Firebase, stores document metadata in Firestore, embeds document chunks, and queries Pinecone for retrieval.
The AI layer uses Google GenAI (Gemini) for:
- document summarization
- chat generation
- embeddings for retrieval
The vector layer uses Pinecone with per-user namespaces for data isolation.
- Firestore stores document records, chat history, user plan data, and memory data
- Cloudinary is optionally used for uploaded PDF storage when credentials are configured
- Pinecone stores vector embeddings and metadata
This repository implements a practical RAG stack.
The upload flow follows this pattern:
- PDF file is uploaded through
/api/upload - the file is validated and checked for PDF headers and size limits
- text is extracted with PyMuPDF
- text is chunked into overlapping windows
- each chunk is embedded using Gemini
- embeddings are upserted to Pinecone under a user-specific namespace
- user questions are embedded and similarity-searched against the same namespace
- relevant chunks are injected into the Gemini prompt
- Gemini returns a grounded answer with source metadata
The configured embedding model in the code is:
models/text-embedding-004
The embedding call sets output_dimensionality = 768, and the Pinecone index is initialized with dimension 768 and cosine similarity metric.
Pinecone is used as the semantic retrieval layer. The backend:
- initializes the index if needed
- stores vectors with metadata including
document_id,user_id,filename,chunk_index, andtext - queries by
user_idand optionaldocument_id - keeps retrieval results limited by
MAX_RETRIEVED_CHUNKS
Gemini receives:
- the retrieved document context
- conversation history
- optional conversation summary / persistent memory
- the current user question
A system prompt enforces answer grounding and instructs the model to answer only with available context.
The system returns source information for each retrieved chunk, including:
- filename
- document_id
- chunk_index
- score
- excerpt
This allows the frontend to surface citations or source references without fabricating claims.
The backend is implemented in backend/ and uses FastAPI.
Key backend modules include:
backend/main.pybackend/config.pybackend/auth.pybackend/routers/upload.pybackend/routers/chat.pybackend/services/ai_service.pybackend/services/vector_store.pybackend/services/pinecone_service.pybackend/services/db_service.pybackend/services/pdf_service.py
The backend verifies Firebase-issued bearer tokens through get_current_user(). User requests are restricted by Firebase UID, and document/chat access is read and written using the authenticated user identity.
The upload pipeline:
- validates PDF type and contents
- checks duplicate uploads by MD5 hash
- checks free-plan upload limits
- extracts text from the PDF
- chunks the text
- summarizes the document via Gemini
- stores Firestore metadata
- indexes chunks in Pinecone
The chat route accepts:
question- optional
document_id - optional
conversation_id include_history
It checks plan quotas, loads recent chat history, fetches memory context, runs the RAG pipeline, stores the message, and triggers background memory extraction.
The project includes:
- HTTP 400/401/403/422/500 responses
- CORS configuration
- Prometheus metrics endpoint
- Sentry integration when configured
- rate limiting with SlowAPI
The frontend lives at the repository root and is built with Next.js + React + TypeScript.
The app includes:
- landing page
- auth flows
- dashboard-oriented sections
- pricing and document-related views
- support pages and app shell patterns
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS
- Firebase client SDK
- Radix UI and utility components
The Next.js app uses rewrites defined in next.config.mjs to proxy /api/* requests to the FastAPI backend. Browser calls are also configured through NEXT_PUBLIC_API_URL and API_PROXY_URL.
This project uses practical application-level controls and cloud services rather than enterprise compliance claims.
- Firebase Authentication for user identity
- Firebase UID-based document and chat access
- Pinecone namespace isolation by
user_id - server-side API configuration through environment variables
- CORS enabled in FastAPI
- rate limiting on sensitive routes
- security headers on backend responses
The repository does not contain evidence of formal compliance certifications or enterprise security attestations. These are intentionally not claimed.
| Layer | Technology |
|---|---|
| Frontend | Next.js, React 19, TypeScript, Tailwind CSS |
| Backend | FastAPI, Python 3.11 |
| Authentication | Firebase Auth, Firebase Admin SDK |
| Database | Firestore |
| Storage | Cloudinary (optional), Firebase Storage integration |
| LLM | Gemini via Google GenAI (gemini-2.5-flash) |
| Embeddings | Gemini embedding model (models/text-embedding-004) |
| Vector DB | Pinecone |
| PDF Processing | PyMuPDF |
| Monitoring | Sentry, Prometheus |
| Deployment | Vercel, Render, Docker Compose |
| Billing | Razorpay, PayPal |
| API / Rate Limiting | SlowAPI |
askwiseo/
├── app/
│ ├── (auth)/
│ ├── dashboard/
│ ├── contact/
│ ├── pricing/
│ ├── terms-privacy/
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx
├── components/
├── contexts/
├── hooks/
├── lib/
├── public/
├── scripts/
├── styles/
├── utils/
├── backend/
│ ├── main.py
│ ├── auth.py
│ ├── config.py
│ ├── memory/
│ ├── routers/
│ ├── services/
│ ├── requirements.txt
│ ├── Dockerfile
│ └── render.yaml
├── .env.example
├── docker-compose.yml
├── next.config.mjs
├── package.json
├── render.yaml
├── vercel.json
├── README.md
├── LICENSE
└── ...
Important directories:
app/contains the Next.js application and major pagescomponents/contains user-facing UI and reusable blocksbackend/routers/contains FastAPI endpointsbackend/services/contains document processing, AI, DB, and Pinecone logicbackend/memory/contains conversation summary and memory logicscripts/anddocker-compose.ymlare used for local orchestration and developer workflows
- Node.js 20+
- npm or pnpm
- Python 3.11
- Firebase project credentials
- Gemini API key
- Pinecone API key and index configuration
git clone https://github.com/Arunkumar158/Askwiseo.git
cd Askwiseonpm install
npm run devThe app starts in local development mode and proxies API requests to the backend.
cd backend
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --host 127.0.0.1 --port 8000 --reloaddocker-compose up --buildCreate a frontend .env.local file and a backend backend/.env file.
NEXT_PUBLIC_FIREBASE_API_KEY=your_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
NEXT_PUBLIC_API_URL=http://127.0.0.1:8000
API_PROXY_URL=http://127.0.0.1:8000GEMINI_API_KEY=your_key
FIREBASE_SERVICE_ACCOUNT_JSON={"type":"service_account",...}
PINECONE_API_KEY=your_key
PINECONE_INDEX_NAME=askwiseo
PINECONE_ENVIRONMENT=us-east-1
# or alternatively:
# PINECONE_CLOUD=aws
# PINECONE_REGION=us-east-1
ALLOWED_ORIGINS=["http://localhost:3000","https://askwiseo.vercel.app"]
FRONTEND_URL=https://askwiseo.vercel.app
ENVIRONMENT=development
SENTRY_DSN=
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
PAYPAL_CLIENT_ID=
PAYPAL_SECRET=| Variable | Purpose | Required |
|---|---|---|
GEMINI_API_KEY |
Gemini access for generation and embeddings | Yes |
FIREBASE_SERVICE_ACCOUNT_JSON |
Firebase admin initialization | Yes for backend auth/storage |
PINECONE_API_KEY |
Pinecone API access | Yes for vector search |
PINECONE_INDEX_NAME |
Pinecone index name | Yes |
PINECONE_ENVIRONMENT |
Pinecone environment | Yes unless cloud/region pair is used |
PINECONE_CLOUD |
Pinecone serverless cloud | No |
PINECONE_REGION |
Pinecone serverless region | No |
NEXT_PUBLIC_FIREBASE_* |
Frontend Firebase config | Yes for login/UI integration |
NEXT_PUBLIC_API_URL |
Browser API target | Yes in production |
API_PROXY_URL |
Local API proxy target | Recommended for local dev |
ALLOWED_ORIGINS |
Backend CORS allowlist | Recommended |
FRONTEND_URL |
Backend app URL config | Recommended |
SENTRY_DSN |
Error monitoring | No |
RAZORPAY_KEY_ID / RAZORPAY_KEY_SECRET |
Billing integration | No |
PAYPAL_CLIENT_ID / PAYPAL_SECRET |
Billing integration | No |
| Method | Endpoint | Purpose | Authentication |
|---|---|---|---|
POST |
/api/upload |
Upload and index a PDF | Required |
POST |
/api/chat |
Ask a question against uploaded documents | Required |
GET |
/api/chat/history |
Load chat history | Required |
GET |
/healthz |
Service health check | No |
GET |
/metrics |
Prometheus metrics | No |
curl -X POST "http://127.0.0.1:8000/api/upload" \
-H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN" \
-F "file=@document.pdf"Example response:
{
"success": true,
"document": {
"id": "doc_123",
"filename": "report.pdf",
"status": "ready"
},
"chunk_count": 18,
"page_count": 42
}curl -X POST "http://127.0.0.1:8000/api/chat" \
-H "Authorization: Bearer YOUR_FIREBASE_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{"question":"What are the key risks mentioned in this document?","document_id":"doc_123"}'Example response:
{
"answer": "The document identifies three main risks: ...",
"sources": [
{
"filename": "report.pdf",
"document_id": "doc_123",
"chunk_index": 3,
"score": 0.87,
"excerpt": "..."
}
],
"chat_id": "chat_456"
}PDF
↓
Text Extraction
↓
Chunking
↓
Gemini Embeddings
↓
Pinecone
↓
User Question
↓
Query Embedding
↓
Semantic Retrieval
↓
Relevant Chunks
↓
Gemini
↓
Answer + Source Metadata
This is the core AI architecture implemented in the repository. It is a working retrieval-based Q&A pipeline rather than a generic demonstration.
The repository includes a memory layer in backend/memory/ and uses it during chat generation.
- conversation summary generation
- durable memory extraction from recent messages
- user-scoped memory storage under Firestore collections
- memory context injected into the Gemini prompt
This memory layer is not a full long-term agent memory system yet, but it is an actual implementation present in the codebase.
No n8n workflow automation was found in the repository. The codebase does include billing and usage controls, but a verified automated workflow engine or orchestration layer was not identified.
Askwiseo follows the product direction:
Document → Understanding → Knowledge → Intelligence → Action
The long-term goal is to reduce repetitive, document-heavy workflows by combining:
- retrieval-augmented generation
- AI-powered document understanding
- structured insight extraction
- user-scoped knowledge layers
- workflow-aware automation
This is consistent with the current repository implementation, which focuses on the knowledge and intelligence stages of that flow.
- PDF upload and validation
- PDF text extraction
- chunking and indexing
- Gemini embeddings
- Pinecone vector retrieval
- chat answers grounded in document context
- Firebase auth and Firestore persistence
- conversation history
- memory extraction and summary support
- plan-based question limits
- billing integration scaffolding
- product refinement and UX consistency
- memory quality tuning and summarization improvement
- feature maturity around document intelligence and workflow usability
- advanced document intelligence workflows
- richer structured extraction across business documents
- deeper knowledge analysis and summarization features
- expanded automation actions beyond the current document Q&A flow
- team workspaces and multi-user collaboration
- more enterprise-oriented integrations
Askwiseo demonstrates practical engineering work across:
- GenAI application design
- RAG architecture
- semantic search
- vector databases
- API-driven backend development
- cloud deployment patterns
- authentication and access isolation
- document processing workflows
- product thinking around AI-infused workflows
It is structured as a production-minded AI application rather than a simple demo project.
- Production-oriented FastAPI backend
- Next.js frontend with modern App Router architecture
- Firebase authentication and persistence
- Gemini-powered generation and embeddings
- Pinecone vector retrieval with user isolation
- document-aware grounded answers
- modular service architecture
- environment-driven configuration
- structured error handling and metrics
- support for local and deployment-based orchestration
No verified live demo URL or screenshot assets were identified in the repository. This section is intentionally left as a placeholder to avoid broken links or fabricated product claims.
The repository includes Vercel deployment config:
vercel.json- Next.js build pipeline
- environment-based frontend configuration
The repository includes Render configuration:
render.yaml- Docker-based backend deployment
- health check endpoint at
/healthz
Production settings are expected to be configured using environment variables, but no live deployment URL was verified from the repo itself.
Testing coverage is currently being expanded.
The repository includes backend validation scripts such as:
backend/test_full_upload.pybackend/test_firestore.pybackend/test_chroma.pybackend/test_default_bucket.pybackend/test_models.py
These appear to be validation and smoke-test scripts rather than a comprehensive CI-backed test suite. No verified production-grade test pipeline was found.
No license file was found in the repository. This README does not assume or invent a license.
Contributions are welcome. If you are working on the product, documentation, or AI pipeline, open a pull request with a clear explanation of the change and the validation performed.
Author: Arun Kumar
AI Developer / Product Builder
LinkedIn: [Add LinkedIn]
Portfolio: [Add Portfolio]
For GitHub, the repository slug should remain:
askwiseo
This keeps the project naming consistent and professional in the repository header and portfolio context.
Askwiseo is a real document intelligence and retrieval system implemented with a modern AI stack:
- Next.js frontend
- FastAPI backend
- Firebase auth/data
- Gemini AI generation
- Pinecone retrieval
- document processing with PyMuPDF
The project is best presented as an AI document intelligence platform built around a working RAG system and practical cloud integrations, rather than a simple PDF chatbot.