An advanced system for automating invoice analysis and providing intelligent querying capabilities using Large Language Models (LLMs) and vector databases.
- Automated Invoice Analysis: Process PDF invoices against company reimbursement policies
- Intelligent Data Storage: Store analysis results in a vector database for efficient retrieval
- Smart Querying: Natural language chatbot interface for querying invoice information
- Policy Compliance: Automated comparison of invoices against company policies
- Processes PDF invoices and company policies
- Uses LLM for intelligent analysis
- Determines reimbursement status (Fully/Partially Reimbursed or Declined)
- Stores results in vector database
- Natural language query interface
- Context-aware responses
- Intelligent retrieval of invoice information
- Support for metadata filtering
- Clone the repository:
git clone https://github.com/Sibikrish3000/invoice-reimbursement-system.git
cd invoice-reimbursement-system- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
Create a
.envfile in the root directory with:
OPENAI_API_KEY=your_api_key_here
OPENAI_BASE_URL=your_endpoint_url
- Start the server:
uvicorn app.main:app --reload- Access the API documentation at
http://localhost:8000/docs
- POST
/api/v1/analyze-invoice- Input: PDF files (policy and invoices), employee name
- Output: Analysis results with reimbursement status
- POST
/api/v1/chat- Input: Natural language query
- Output: Markdown formatted response
- Framework: FastAPI
- LLM Integration: LangChain with OpenAI
- Vector Store: ChromaDB
- Embedding Model: Sentence Transformers
- Document Processing: PyPDF
- Modular design with separate services for invoice processing and querying
- Vector database for efficient similarity search
- RAG implementation for context-aware responses
invoice-reimbursement-system/
├── app/
│ ├── main.py
│ ├── api/
│ │ ├── routes/
│ │ └── models/
│ ├── core/
│ │ ├── config.py
│ │ └── security.py
│ ├── services/
│ │ ├── invoice_processor.py
│ │ ├── vector_store.py
│ │ └── chatbot.py
│ └── utils/
│ ├── pdf_processor.py
│ └── embeddings.py
├── tests/
├── requirements.txt
└── README.md
Apache License 2.0
To build and run your container:
docker build -t invoice-reimbursement-system .
docker run -p 8000:8000 --env-file .env invoice-reimbursement-system