Skip to content

Releases: bossenbroek-ai-photo/quickExpense-rag

T4002 Database v2025.10.28 - 100% PDF Coverage

Choose a tag to compare

@manonja manonja released this 29 Oct 21:21
4dd9894

T4002 Database v2025.10.28 - 100% PDF Coverage

Overview

This release expands T4002 PDF coverage from 60% to 100%, now covering all 113 pages of the CRA T4002 Business and Professional Income Guide.

Key Improvements

  • Coverage: 60% → 100% (+67% pages, now pages 1-113)
  • Database items: 289 → 662 (+129% growth)
  • Database size: 2.02 MB → 2.59 MB (+28.2%)
  • Search quality: 100% improvement (5/5 test queries improved or maintained)

What's New

Expanded Content Coverage

  • Chapter 4: Capital cost allowance (CCA) - pages 69-91
  • Chapter 5: Additional income and expenses - pages 92-94
  • Chapter 6: Disposing of capital property - pages 95-113

Improved Search Results

Queries about CCA, farm losses, and capital gains now return dedicated sections instead of generic cross-references:

  • "capital cost allowance" → P77 (dedicated "What is CCA" section)
  • "CCA depreciation" → P84 (CCA classes rule)
  • "farm losses" → P92 (dedicated farm losses section)
  • "capital gains" → P95 (dedicated capital gains section)

Technical Details

  • Schema version: 1.0 (unchanged)
  • Data version: 2024.12
  • Embedding model: BAAI/bge-small-en-v1.5 (384 dimensions)
  • Content types: RULE, DEFINITION, PRINCIPLE, TABLE
  • Deduplication: 31.3% duplicate removal (301/963 items)
  • Database SHA256: 5111f17b4f59835c1bc1aafad839c8ec7a42192ac7b28f9ae79fbba801ee86de

Files in This Release

  • t4002_pdf_v4.db - SQLite database (2.59 MB)
  • manifest.json - Database metadata with integrity checksum

Breaking Changes

None - fully backward compatible with existing v2024.12 schema.

Installation

import qe_tax_rag as qe

# Library will auto-download this version
qe.init()  # Downloads latest v2024.12 database

Upgrading from v2025.10.23

The library automatically downloads the latest database. If you have cached the old version:

# Clear cache and re-initialize
rm -rf ~/.cache/qe_tax_rag/
import qe_tax_rag as qe
qe.init()  # Downloads v2025.10.28 automatically

Full Changelog

See PDF_PHASE4_RESULTS.md for detailed technical documentation.

Cost & Performance

  • Extraction cost: ~$0.50 (33 Gemini 2.0 Flash API calls)
  • Extraction time: ~8 minutes
  • Build time: ~55 seconds (embedding generation)
  • Database efficiency: 2× content with only 28% size increase

Validation

All test queries passed with 100% success rate:

  • ✅ capital cost allowance
  • ✅ CCA depreciation
  • ✅ farm losses
  • ✅ capital gains
  • ✅ business income

No regressions detected - existing v3 queries maintain quality.

CRA Tax Rules Database MVP - October 2025

Choose a tag to compare

@manonja manonja released this 24 Oct 21:54
6568dec

Production SQLite database with CRA business expense rules.

Database Statistics

  • Total Chunks: 63 searchable expense rules
  • Schema Version: 1.0
  • Data Version: 2025.10.23
  • Embedding Model: BGE-small-en-v1.5 (384 dimensions)
  • Source Documents: CRA T4002 Business and Professional Income Guide
  • Source Files: t4002-5.html
  • Lineage Coverage: 100% (classic parser + adjudicator)
  • Expense Types: 16 unique categories
  • Search Indices: FTS5 full-text + sqlite-vec semantic search

File Verification

SHA256 Checksum:


960601b0e7a1b73e59ce8f857b603516382341ba22729da9d90858bbf0f6125b

Verify download:

shasum -a 256 cra_rules.db
# Should match: 960601b0e7a1b73e59ce8f857b603516382341ba22729da9d90858bbf0f6125b

Usage

Install the library:

pip install qe-tax-rag

The database will be downloaded automatically on first use:

import qe_tax_rag as qe

# Downloads database from this GitHub Release
qe.init()

# Search expense rules
results = qe.search(
    query="restaurant meals for client meetings",
    province="BC",
    expense_types=["meals"]
)

Quality Validation

This database has been validated through comprehensive testing:

  • Search Success Rate: 10/10 queries (100% - exceeds 70% threshold)
  • Lineage Traceability: 100% coverage with source document tracking
  • Integrity Checks: All database constraints verified
  • Embedding Quality: All 63 chunks have valid 384-dim vectors

See PR #44 and
PR #45 for full validation
reports.

Distribution Model

  • Code: Distributed via PyPI (pip install qe-tax-rag)
  • Database: Downloaded from GitHub Releases on first use
  • Versioning: Schema version + data version stored in database metadata
  • Integrity: SHA256 checksums verified on download

Disclaimer

⚠️ IMPORTANT: NOT FINANCIAL OR TAX ADVICE

This software is provided for informational purposes only and is not a substitute for
professional financial or tax advice. Always consult with a qualified tax professional
before making financial decisions.

Support