Skip to main content

Add your description here

Project description

TaxMeMate

A Retrieval-Augmented Generation (RAG) CLI assistant for tax reduction strategies. Feed it your local PDFs and TXTs of tax forms, regulations, and guidelines—TaxMeMate will index the content and let you ask natural-language questions to discover tax-saving opportunities.


Features

  • ETL Pipeline: Extracts, cleans, and deduplicates headers from PDF/TXT documents.
  • Chunking: Splits text into overlapping 512-token windows for context continuity.
  • Vector Indexing: Embeds chunks with Sentence-Transformers and indexes via FAISS for sub-second retrieval.
  • RAG Chat: Combines retrieved context with Mistral-3B-Instruct (default) or OpenAI GPT to generate concise, actionable tax advice.
  • Fine-Tuning: Supervised fine-tuning pipeline via Unsloth + TRL’s SFTTrainer to specialize responses on custom Q&A datasets.
  • Multi-Backend: Supports CUDA, Apple MPS, or CPU for local inference, plus optional OpenAI API fallback.

Installation

# Clone the repo
git clone https://github.com/yourusername/taxmemate.git
cd taxmemate

# Create and activate a Python 3.12+ virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install from PyPI
pip install taxmemate

(Or install directly from source: pip install .)


Commands

All commands are available under the taxmemate entry point:

# Show global help
taxmemate --help

Clean

Extract and clean raw documents into a JSONL corpus.

taxmemate clean <input_dir> <output_file>
# e.g.:
taxmemate clean ./raw_pdfs cleaned.jsonl

Chunk

Tokenize and split cleaned text into overlapping passages.

taxmemate chunk cleaned.jsonl chunks.jsonl [--model MODEL]
# default MODEL: mistralai/Mistral-3B-Instruct-v0.1

Index

Embed chunks and build a FAISS index plus metadata.

taxmemate index chunks.jsonl faiss.index meta.pkl [--embed-model EMBED_MODEL]

Train-SFT

Fine-tune the base LLM on your own Q&A dataset.

taxmemate train-sft sft_data.jsonl sft_model_dir [--model MODEL]

Chat

Interactively ask tax questions with RAG-driven generation.

taxmemate chat faiss.index meta.pkl [--rag-model MODEL] [--openai-model MODEL] [--openai-api-key KEY]

Usage Example

# 1. Clean source PDFs
 taxmemate clean ./raw_pdfs cleaned.jsonl

# 2. Chunk into passages
 taxmemate chunk cleaned.jsonl chunks.jsonl

# 3. Build the FAISS index
 taxmemate index chunks.jsonl faiss.index meta.pkl

# 4. (Optional) Fine-tune on your Q&A
 taxmemate train-sft my_sft.jsonl fine_tuned_model/

# 5. Chat for tax advice
 taxmemate chat faiss.index meta.pkl

Tip: For snappier responses, use the OpenAI backend: taxmemate chat faiss.index meta.pkl --openai-model gpt-3.5-turbo --openai-api-key $OPENAI_API_KEY


Configuration

  • DEFAULT_MODEL: Override by passing --model or --rag-model flags.

  • Environment Variables:

    • TRANSFORMERS_CACHE, HF_HOME, HF_DATASETS_CACHE for cache location.
    • OPENAI_API_KEY for OpenAI chat backend.

Development & Contributing

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/XYZ)

  3. Install dev dependencies:

    pip install -e .[dev]
    
  4. Run tests & linters:

    pytest && flake8
    
  5. Submit a pull request


License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

taxmemate-0.5.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

taxmemate-0.5.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file taxmemate-0.5.0.tar.gz.

File metadata

  • Download URL: taxmemate-0.5.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for taxmemate-0.5.0.tar.gz
Algorithm Hash digest
SHA256 6c072cc1278544cf12396b29464382f6813bb690020654bde78cf306aceebc0b
MD5 304b35fa45972fad1a8d9371c774887f
BLAKE2b-256 e30c16c2c13e773593f9c2db05f4ad7e3773bcda43969e4a3bfa8bd82c40be60

See more details on using hashes here.

File details

Details for the file taxmemate-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: taxmemate-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for taxmemate-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7d69e4402416a14d8bad8f6693f6676cffa958fd819e9959c96cbf77f2073a8
MD5 401da390db6dfda9c7118abd4ac8699c
BLAKE2b-256 067942d0ec72106397bcc788846171ce194c514c6da648d1dde126062f238b3a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page