| title | Docwise API |
|---|---|
| emoji | 📄 |
| colorFrom | blue |
| colorTo | green |
| sdk | docker |
| app_port | 7860 |
| pinned | false |
DocWise lets you upload PDF documents and have a conversation with them using AI. Ask questions across multiple documents at once, compare them side by side, or search semantically across your entire library. Every answer cites its source document.
Upload multiple PDFs. Each one is chunked, embedded, and indexed into a per-user vector store. Document records persist across sessions via PostgreSQL.
Chat with your documents with full conversation memory. Follow-up questions work correctly — "explain that more" and "what did you mean by X" understand context from previous turns.
Search for a concept across your entire document library. Results ranked by similarity score with source attribution.
Ask the same question across two or more documents simultaneously. Useful for comparing contracts, research papers, or policy documents.
Every answer includes which document it came from. No silent hallucination.
Upload returns immediately. PDF processing runs as a background task. Poll the status endpoint to check when your document is ready to query.
┌──────────────────────────────────────────────────────┐
│ Streamlit Frontend │
│ Upload · Chat · Search · Compare │
└───────────────────────┬──────────────────────────────┘
│ HTTP
┌───────────────────────▼──────────────────────────────┐
│ FastAPI Backend — HuggingFace Spaces │
│ Upload · Ingest · Chat · Search · Compare │
└──────────┬────────────────────────────┬──────────────┘
│ │
┌──────────▼──────────┐ ┌───────────---▼---─────────────┐
│ PostgreSQL │ │ RAG Layer │
│ Neon (cloud) │ │ LangChain + ChromaDB │
│ Document records │ │ Google Gemini 3.1 Flash Lite │
│ Upload status │ │ HuggingFace Embeddings │
└─────────────────────┘ └──────────────-----────────────┘
Ingestion workflow:
- User uploads PDF via Streamlit
- FastAPI saves file and creates DB record with status
processing - Background task chunks PDF → generates embeddings → stores in ChromaDB
- DB record updated to
ready - User polls status endpoint, then starts chatting
| Layer | Technology |
|---|---|
| Frontend | Streamlit |
| Backend | FastAPI |
| Database | PostgreSQL (Neon) |
| ORM | SQLAlchemy |
| AI model | Google Gemini 3.1 Flash Lite |
| RAG framework | LangChain |
| Vector store | ChromaDB |
| Embeddings | HuggingFace sentence-transformers |
| Backend deploy | HuggingFace Spaces (Docker) |
| Frontend deploy | Streamlit Cloud |
Health check.
{ "app": "DocWise", "status": "running", "version": "1.0.0" }Upload a PDF document and start asynchronous ingestion.
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | Unique identifier for the user uploading the document |
multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
| file | PDF File | Yes | Document to upload and index |
{
"doc_id": "a1b2c3d4",
"status": "processing"
}Clear conversation memory for a session.
Prerequisites: Python 3.11+, Neon account from neon.tech
git clone https://github.com/subata24/Docwise
cd Docwise
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtCreate .env in the root:
GOOGLE_API_KEY
GOOGLE_MODEL
DATABASE_URL=postgresql://user:pass@localhost/docwise
CHROMA_PERSIST_DIR=./chroma_db
UPLOAD_DIR=./uploadsRun backend:
uvicorn backend.main:app --reload --port 7860
# API docs at http://localhost:7860/docsRun frontend:
streamlit run frontend/app.pyDocwise/
├── backend/
│ ├── main.py # FastAPI routes
│ ├── ingest.py # PDF chunking + ChromaDB indexing
│ ├── rag.py # LangChain RAG + conversation memory
│ ├── models.py # SQLAlchemy database models
│ ├── database.py # DB connection setup
│ └── schemas.py # Pydantic request/response shapes
├── frontend/
│ └── app.py # Streamlit UI
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
- Per-user ChromaDB collections — users only retrieve from their own documents
- MMR retrieval (Maximal Marginal Relevance) returns diverse chunks, not repetitive ones
- ConversationBufferWindowMemory keeps last 6 turns — follow-up questions work correctly
- Async background ingestion — no request timeouts on large PDFs
- Document status tracking in PostgreSQL — client polls until ready
- Source attribution on every answer
- Dockerized and deployed on HuggingFace Spaces free tier — no credit card required
Subata Khan — AI Engineer & LLM Systems Developer