Skip to content
Arunkumar158Public

About

Askwiseo is an AI-powered tool that transforms PDFs into interactive knowledge bases—just upload a document and start asking questions like you're chatting with an expert.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

65 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Askwiseo

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.

Next.js TypeScript Python FastAPI Firebase Gemini Pinecone Vercel Render

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.


Product Overview

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.


Core Product Flow

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.


Key Features

Document Intelligence

  • PDF upload and validation
  • document text extraction with PyMuPDF
  • page counting and document metadata capture
  • chunk-based document indexing

Retrieval-Augmented Generation

  • 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

AI Answers

  • 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

Authentication & Data Access

  • Firebase Authentication integration
  • Firebase Admin SDK for backend verification
  • Firestore-backed user document and chat records
  • user-level data isolation

Conversation & Memory

  • chat history persistence in Firestore
  • conversation summary tracking
  • persistent user memory extraction from chat activity

Billing / Access Controls

  • plan-based usage and question limits
  • PayPal and Razorpay service integrations are present in the backend

Technical Architecture

                         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

Frontend

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.

Backend

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.

AI Layer

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.

Storage & Persistence

  • 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

AI / GenAI Engineering

This repository implements a practical RAG stack.

Retrieval-Augmented Generation

The upload flow follows this pattern:

  1. PDF file is uploaded through /api/upload
  2. the file is validated and checked for PDF headers and size limits
  3. text is extracted with PyMuPDF
  4. text is chunked into overlapping windows
  5. each chunk is embedded using Gemini
  6. embeddings are upserted to Pinecone under a user-specific namespace
  7. user questions are embedded and similarity-searched against the same namespace
  8. relevant chunks are injected into the Gemini prompt
  9. Gemini returns a grounded answer with source metadata

Embeddings

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.

Vector Search

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, and text
  • queries by user_id and optional document_id
  • keeps retrieval results limited by MAX_RETRIEVED_CHUNKS

Prompt Engineering

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.

Grounding / Citations

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.


Backend

The backend is implemented in backend/ and uses FastAPI.

API Structure

Key backend modules include:

  • backend/main.py
  • backend/config.py
  • backend/auth.py
  • backend/routers/upload.py
  • backend/routers/chat.py
  • backend/services/ai_service.py
  • backend/services/vector_store.py
  • backend/services/pinecone_service.py
  • backend/services/db_service.py
  • backend/services/pdf_service.py

Authentication

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.

Document Processing

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

Chat Endpoint

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.

Error Handling

The project includes:

  • HTTP 400/401/403/422/500 responses
  • CORS configuration
  • Prometheus metrics endpoint
  • Sentry integration when configured
  • rate limiting with SlowAPI

Frontend

The frontend lives at the repository root and is built with Next.js + React + TypeScript.

User Experience

The app includes:

  • landing page
  • auth flows
  • dashboard-oriented sections
  • pricing and document-related views
  • support pages and app shell patterns

Frontend Stack

  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS
  • Firebase client SDK
  • Radix UI and utility components

API Communication

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.


Data & Security

This project uses practical application-level controls and cloud services rather than enterprise compliance claims.

Verified mechanisms

  • 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

Important note

The repository does not contain evidence of formal compliance certifications or enterprise security attestations. These are intentionally not claimed.


Tech Stack

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

Project Structure

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 pages
  • components/ contains user-facing UI and reusable blocks
  • backend/routers/ contains FastAPI endpoints
  • backend/services/ contains document processing, AI, DB, and Pinecone logic
  • backend/memory/ contains conversation summary and memory logic
  • scripts/ and docker-compose.yml are used for local orchestration and developer workflows

Local Development

Prerequisites

  • Node.js 20+
  • npm or pnpm
  • Python 3.11
  • Firebase project credentials
  • Gemini API key
  • Pinecone API key and index configuration

Clone

git clone https://github.com/Arunkumar158/Askwiseo.git
cd Askwiseo

Frontend

npm install
npm run dev

The app starts in local development mode and proxies API requests to the backend.

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 --reload

Docker

docker-compose up --build

Environment Variables

Create a frontend .env.local file and a backend backend/.env file.

Frontend

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:8000

Backend

GEMINI_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

API

Core endpoints

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

Example: Upload PDF

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
}

Example: Ask a question

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"
}

RAG Pipeline

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.


AI Memory

The repository includes a memory layer in backend/memory/ and uses it during chat generation.

Implemented behaviors

  • 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.


Automation

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.


Product Vision

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.


Roadmap

Completed

  • 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

In Progress

  • product refinement and UX consistency
  • memory quality tuning and summarization improvement
  • feature maturity around document intelligence and workflow usability

Planned

  • 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

Why This Project

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.


Engineering Highlights

  • 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

Demo / Screenshots

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.


Deployment

Frontend

The repository includes Vercel deployment config:

  • vercel.json
  • Next.js build pipeline
  • environment-based frontend configuration

Backend

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

Testing coverage is currently being expanded.

The repository includes backend validation scripts such as:

  • backend/test_full_upload.py
  • backend/test_firestore.py
  • backend/test_chroma.py
  • backend/test_default_bucket.py
  • backend/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.


License

No license file was found in the repository. This README does not assume or invent a license.


Contributing

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 / Contact

Author: Arun Kumar

AI Developer / Product Builder

LinkedIn: [Add LinkedIn]
Portfolio: [Add Portfolio]


Repository Header Recommendation

For GitHub, the repository slug should remain:

askwiseo

This keeps the project naming consistent and professional in the repository header and portfolio context.


Final Note

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.

About

Askwiseo is an AI-powered tool that transforms PDFs into interactive knowledge bases—just upload a document and start asking questions like you're chatting with an expert.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages