An AI agent for technical document analysis. Upload engineering manuals, datasheets, and compliance standards — then ask questions, compare specifications, detect contradictions, and run compliance checks across all documents simultaneously.
Unlike basic RAG applications, EngiQuery uses an agent loop where the LLM decides which tool to use based on your question. It also integrates with Gmail to automatically email analysis reports.
- Multi-document Q&A with source citations
- Cross-document specification comparison
- Contradiction detection across documents
- Compliance gap checking against standards
- Automatic email delivery of reports via Gmail
- Conversation memory within sessions
- Supports PDF, DOCX, and TXT files
| Layer | Technology |
|---|---|
| Backend | FastAPI, Python |
| LLM | Groq API (Llama 3.3 70B) — free tier |
| Embeddings | sentence-transformers (all-MiniLM-L6-v2) — local |
| Vector DB | ChromaDB — local |
| PDF Parsing | pdfplumber + PyMuPDF fallback |
| Gmail SMTP | |
| Frontend | HTML, CSS, JavaScript |
engiquery/
├── backend/
│ ├── main.py # FastAPI routes + email workflow
│ ├── database.py # ChromaDB setup + document registry
│ ├── ingestion.py # Parse, chunk, embed, store pipeline
│ ├── query.py # Agent loop + conversation memory
│ ├── llm.py # Groq client + prompt templates
│ ├── tools.py # Agent tool definitions and executors
│ ├── utils.py # File parsers (PDF, DOCX, TXT)
│ ├── .env # API keys (not committed)
│ └── requirements.txt
└── frontend/
├── index.html # Document upload page
├── chat.html # Agent chat interface
├── analysis.html # Contradiction and compliance tools
├── style.css
└── app.js
git clone https://github.com/yourusername/engiquery.git
cd engiquerycd backend
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txtCreate a .env file inside the backend folder:
GROQ_API_KEY=your_groq_api_key_here
GMAIL_SENDER=youremail@gmail.com
GMAIL_APP_PASSWORD=your_gmail_app_password
Getting credentials:
- Groq API key: console.groq.com (free)
- Gmail App Password: myaccount.google.com/apppasswords (requires 2-step verification enabled)
cd backend
venv\Scripts\activate
uvicorn main:appBackend runs at http://localhost:8000
Open a second terminal:
cd frontend
python -m http.server 3000Open http://localhost:3000 in your browser.
Go to the Documents page and drag and drop any PDF, DOCX, or TXT file. The agent will parse, chunk, embed, and store it automatically.
Go to the Chat page and type any question. The agent automatically selects the right tool:
- Factual questions trigger document search
- Comparison questions trigger cross-document comparison
- Questions about conflicts trigger contradiction detection
- Questions about requirements trigger compliance checking
Enter an email address in the Chat page and click Send + Email. The agent answers in chat and simultaneously sends the full report to the provided address.
Go to the Analysis page for:
- Contradiction detection across selected documents on a specific topic
- Compliance gap checking between a design document and a standard
| Method | Endpoint | Description |
|---|---|---|
| GET | /documents | List uploaded documents |
| POST | /documents/upload | Upload a document |
| DELETE | /documents/{doc_id} | Delete a document |
| POST | /query | Ask the agent a question |
| POST | /compliance | Run a compliance check |
| POST | /workflow/email | Query and email the report |
| DELETE | /memory/{session_id} | Clear conversation memory |
| GET | /health | Health check |
| Variable | Description |
|---|---|
| GROQ_API_KEY | Groq API key for LLM inference |
| GMAIL_SENDER | Gmail address to send reports from |
| GMAIL_APP_PASSWORD | Gmail app password (not your account password) |
- All embeddings and vector storage are local — no data leaves your machine except LLM inference calls to Groq and emails sent via Gmail.
- ChromaDB stores data in a
chroma_storefolder inside the backend directory. - Document metadata is stored in
doc_registry.jsoninside the backend directory. - Conversation memory is in-memory only and resets when the server restarts.