This project automates the categorization and resolution of financial transactions using AI-powered classification with the OllamaLLM model. It processes transaction data, categorizes cases, determines resolution status, and executes a workflow using a graph-based approach.
Ensure you have the following installed before running the script:
- Python (>=3.8)
- pip (>=21.0)
- Clone the repository:
git clone <repository_url> cd <repository_folder>
- Install dependencies:
Ensure
pip install -r requirements.txt
requirements.txtincludes:pandas chardet langchain langgraph langchain_ollama - Create necessary directories:
mkdir -p uploads/not_found_sys_b uploads/processed uploads/pending uploads/resolved
Ollama is required to run the LLM. Install it using:
curl -fsSL https://ollama.com/install.sh | shTo use the Mistral model with Ollama, run:
ollama pull mistralTo check if Ollama is running and the Mistral model is installed, execute:
ollama listThis should display mistral as an available model.
Modify the script to specify the correct paths for input files:
recon_data_reply.csvrecon_data_raw.csv
These CSV files should contain transaction data with necessary columns such as Transaction ID, Comments, recon_status, etc.
Execute the script with:
python script.py- Categorized transaction files saved in
uploads/ - Processed logs stored in
process.log - Resolved and unresolved transactions moved to corresponding directories
- AI-generated recommendations for unresolved transactions
All execution logs are stored in process.log, which helps track errors and process flow.
- Ensure input CSV files exist and have the correct column headers.
- Check
process.logfor any error messages. - Ensure
OllamaLLMis correctly installed and running. - Verify that the Mistral model is available by running
ollama list.
Feel free to submit issues or pull requests to enhance the project!
This project is licensed under the MIT License.