An agentic AI tax advisor CLI chat app
Project description
Tax Advisor
Agentic CLI for tax Q&A, built around a tool-capable chat loop.
What this project is today
- Python CLI app (not a web service) in
src/tax_advisor/. - Entrypoints:
- Console script:
tax-advisor->tax_advisor.cli:main(pyproject.toml) - Module run:
python -m tax_advisor(src/tax_advisor/__main__.py)
- Console script:
- Current tooling includes
get_current_dateinsrc/tax_advisor/tools.py.
Quick start
uv sync
uv run tax-advisor
Alternative:
uv run python -m tax_advisor
Current architecture (implemented)
src/tax_advisor/cli.py(main) runs a REPL with slash commands (/quit,/clear,/model <name>).- User input is sent to
Agent.run(...)insrc/tax_advisor/agent.py. Agentcallschat_completion(...)insrc/tax_advisor/models.py(LiteLLM wrapper).- Streaming deltas are assembled in
Agent._handle_stream(...)and printed as tokens arrive. - Tool calls are executed via
execute_tool(...)insrc/tax_advisor/tools.py. - Tool outputs are appended as
{"role": "tool", ...}messages and the model loop continues. - Safety guard:
MAX_TOOL_ROUNDS = 10prevents runaway tool recursion.
Configuration
Environment-driven settings live in src/tax_advisor/config.py:
TAX_ADVISOR_MODEL(default:gpt-4o)TAX_ADVISOR_TEMPERATURE(default:0.3)TAX_ADVISOR_SYSTEM_PROMPT
Planned: document ingestion + RAG for tax documents
Goal: answer questions using uploaded tax documents while minimizing exposure of confidential data.
Target pipeline
- Ingest: load files (PDF/CSV/TXT/JSON initially) into a normalized document format.
- Extract: text extraction + metadata (
source,doc_type,tax_year, page/section). - Redact (mandatory): detect and mask sensitive fields before chunking/indexing.
- Chunk + Embed: create retrieval chunks and vector embeddings.
- Index: store vectors + sanitized metadata in a vector store.
- Retrieve: query-time retrieval by semantic similarity + metadata filters.
- Answer: ground responses on retrieved chunks with source references.
- Audit: log retrieval context and redaction events for traceability.
Confidential data redaction policy (must-have)
Redaction should run in at least two places:
- Pre-index redaction (required): no raw sensitive values are written to vector index.
- Pre-response redaction (required): final model output is scanned and masked before display.
Sensitive categories to redact:
- SSN (including partial patterns)
- Date of birth (DOB)
- Physical addresses
- Person names
Recommended behavior:
- Replace with stable placeholders like
[REDACTED_SSN],[REDACTED_DOB],[REDACTED_NAME]. - Keep minimal non-sensitive context so retrieval quality remains usable.
- Fail closed: if redaction/classification fails, do not index or return raw text.
Proposed module layout for RAG extension
src/tax_advisor/ingestion/loader.py- file readers and normalization.src/tax_advisor/ingestion/extract.py- text extraction and metadata.src/tax_advisor/privacy/redactor.py- PII detection/masking policies.src/tax_advisor/rag/chunking.py- chunk creation strategy.src/tax_advisor/rag/index.py- embedding + vector index adapter.src/tax_advisor/rag/retrieve.py- retrieval orchestration.src/tax_advisor/rag/pipeline.py- end-to-end ingest/query workflows.
Development commands
uv run ruff check .
Notes
- Keep OpenAI-style message schema compatibility (
role,content,tool_calls,tool_call_id). - Tool additions should update all three places in
src/tax_advisor/tools.py: definition, implementation, and registry.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tax_advisor-0.1.6.tar.gz.
File metadata
- Download URL: tax_advisor-0.1.6.tar.gz
- Upload date:
- Size: 733.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cae64958a2bd39900bd3c6cd247715da5cfc04817f059fa8506dc2e75df0b409
|
|
| MD5 |
1d716d2dffafda0c4f381c3b8164c08e
|
|
| BLAKE2b-256 |
afee83c6c7ba31ae52d6a8336f6a51d420d775a138da0722e76769eee6c5dba5
|
Provenance
The following attestation bundles were made for tax_advisor-0.1.6.tar.gz:
Publisher:
publish.yml on drajbanshi/tax-advisor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tax_advisor-0.1.6.tar.gz -
Subject digest:
cae64958a2bd39900bd3c6cd247715da5cfc04817f059fa8506dc2e75df0b409 - Sigstore transparency entry: 1137382226
- Sigstore integration time:
-
Permalink:
drajbanshi/tax-advisor@6f27e31f084ee26b5f472f5d57f5f9a7fe4e4207 -
Branch / Tag:
refs/tags/0.1.6 - Owner: https://github.com/drajbanshi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6f27e31f084ee26b5f472f5d57f5f9a7fe4e4207 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tax_advisor-0.1.6-py3-none-any.whl.
File metadata
- Download URL: tax_advisor-0.1.6-py3-none-any.whl
- Upload date:
- Size: 367.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc7f7a2e3a02cd4c82fff067b267316b6d8a79c00e7b5e2fc20c8f064426fe65
|
|
| MD5 |
34c1428554adb817721ee9314404e25f
|
|
| BLAKE2b-256 |
39a5e8f5bdc8c5f39a37f9ea349de9abf4ded8d1ca1d4758b90f7c5fc0a1f2c5
|
Provenance
The following attestation bundles were made for tax_advisor-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on drajbanshi/tax-advisor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tax_advisor-0.1.6-py3-none-any.whl -
Subject digest:
cc7f7a2e3a02cd4c82fff067b267316b6d8a79c00e7b5e2fc20c8f064426fe65 - Sigstore transparency entry: 1137382255
- Sigstore integration time:
-
Permalink:
drajbanshi/tax-advisor@6f27e31f084ee26b5f472f5d57f5f9a7fe4e4207 -
Branch / Tag:
refs/tags/0.1.6 - Owner: https://github.com/drajbanshi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6f27e31f084ee26b5f472f5d57f5f9a7fe4e4207 -
Trigger Event:
release
-
Statement type: