Skip to content

Enable Oregon Law Help RAG tool for family law queries#351

Open
pschipitsch wants to merge 3 commits into
codeforpdx:mainfrom
pschipitsch:feature/oregon-law-tool
Open

Enable Oregon Law Help RAG tool for family law queries#351
pschipitsch wants to merge 3 commits into
codeforpdx:mainfrom
pschipitsch:feature/oregon-law-tool

Conversation

@pschipitsch
Copy link
Copy Markdown
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Infrastructure
  • Maintenance

Description

Activates the retrieve_oregon_law_help RAG tool backed by the oregon-law-help-search-2026 Vertex AI datastore. The tool was previously defined but commented out of the registry. When VERTEX_AI_DATASTORE_OREGON_LAW_HELP is set, the agent will use it to answer family law questions (divorce, child custody, child support, domestic relations) alongside the existing housing law tool.

Changes:

  • Updated retrieve_oregon_law_help tool description to cover housing and family law
  • Registered tool in RAG_TOOL_REGISTRY (auto-activates via env var, no-op if unset)
  • Expanded system prompt scope to include family law; added family law search trigger
  • Updated .env.example with staging datastore ID reference

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

  1. Set VERTEX_AI_DATASTORE_OREGON_LAW_HELP=oregon-law-help-search-2026_1775704132316 in backend/.env
  2. Start the app and ask a family law question (e.g. "Can I be forced to pay child support?")
  3. Confirm retrieve_oregon_law_help appears in LangSmith traces
  4. Confirm housing law questions still work as before

Note: retrieve_city_state_laws may also fire on family law questions due to the city law trigger in the system prompt — known behavior.

Added/updated tests?

  • Yes — added test_get_active_rag_tools_returns_all_configured_datastores
  • No, and this is why: please replace this line with details on why tests have not been included
  • I need help with writing tests

Documentation

  • If this PR changes the system architecture, Architecture.md has been updated

[optional] Are there any post deployment tasks we need to perform?

Set VERTEX_AI_DATASTORE_OREGON_LAW_HELP in staging environment.

Copy link
Copy Markdown
Contributor

@yangm2 yangm2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this "quickly enable Family Law" on staging got a little complicated.

Comment thread Architecture.md
## Overview

Tenant First Aid is a chatbot application that provides legal information related to housing and eviction in Oregon. The system uses a Retrieval-Augmented Generation (RAG) architecture to provide accurate, contextual responses based on Oregon housing law documents. The LangChain framework is used to abstract models and agents.
Tenant First Aid is a chatbot application that provides legal information related to housing, eviction, and family law in Oregon. The system uses a Retrieval-Augmented Generation (RAG) architecture to provide accurate, contextual responses based on Oregon housing law documents. The LangChain framework is used to abstract models and agents.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want this change if the environment variable ENV == staging since we don't want to enable this behavior for TFA on prod.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed that we have an inconsistency in how ENV is defined for GitHub environments (staging or prod) and how it is defined in the .env.example file (dev)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we intend to set ENV VAR for VERTEX_AI_DATASTORE_OREGON_LAW_HELP in both Staging and Prod?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh, when it was just the tenant law pages in that datastore, it would have been for both staging and prod, but right now since it also has family law, it doesn't make sense to turn it on for Prod.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to switch on the existence of VERTEX_AI_DATASTORE_OREGON_LAW_HELP for this feature as opposed to ENV == staging? That way, if this does eventually go to PROD, we would need only set VERTEX_AI_DATASTORE_OREGON_LAW_HELP for that environment, avoiding a code change.


**Hard constraints:**
- Only answer questions about housing law in Oregon; do not answer questions about other states or topics unrelated to housing law.
- Only answer questions about housing law or family law in Oregon; do not answer questions about other states or topics unrelated to these areas.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the system prompt needs to be conditional on ENV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants