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.1.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.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: taxmemate-0.5.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c6bf43fbdb352f5b3268193f1388f1a5612377789429730c2052793549c19a62
MD5 7dbe41bb8b95ecc4c90e80e090764cca
BLAKE2b-256 c5bd0058f19e500dcf09f31e36b5c1eda730829e600c7205f2d9b0a7f29f1e94

See more details on using hashes here.

File details

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

File metadata

  • Download URL: taxmemate-0.5.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec4c6800f99247fd863f475194ea16d23bdb57ffca8e9257ffa27a9d0bbba29f
MD5 5b2edd9d438cd8acf39e5f30173944d6
BLAKE2b-256 28aaeeeddcaac9612f56a25e6b00997a832737eb5a4854623ff4de5c0d49ece4

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