Personal Information Tool - Financial Advisor Intake
Overview
The Personal Information Tool enables the AI to capture and store user personal details that are relevant for financial advisory services. This creates a comprehensive user profile similar to what a traditional financial advisor would gather during an intake interview.Key Features
- Implicit Information Capture: The AI automatically detects and stores personal information mentioned during natural conversation
- No Permission Required: Information is stored silently without asking for permission, similar to how a human advisor would remember details
- Separate Database Table: Personal information is stored in a dedicated
user_personal_infotable with full audit trail - Comprehensive Data Model: Covers demographics, residence, employment, financial profile, and tax information
- Type-Safe Schema: Uses PostgreSQL CHECK constraints to enforce data integrity
- Row-Level Security: Each user can only access their own personal information
Database Schema
Table: user_personal_info
Location: See docs/user-personal-info-schema.sql for complete SQL migration
Key Fields:
Basic Demographics
date_of_birth(DATE) - User’s birth date for age-based financial planningmarital_status(ENUM) - single, married, divorced, widowed, domestic_partnershipnumber_of_dependents(INTEGER) - Number of financial dependents
Residence Information
primary_residence_street(TEXT)primary_residence_city(TEXT)primary_residence_state(TEXT)primary_residence_zip(TEXT)primary_residence_country(TEXT) - Defaults to ‘United States’home_ownership_status(ENUM) - own, rent, other
Employment & Income
employment_status(ENUM) - employed_full_time, employed_part_time, self_employed, retired, unemployed, studentoccupation(TEXT)employer_name(TEXT)annual_gross_income(NUMERIC)expected_retirement_age(INTEGER)
Financial Profile
risk_tolerance(ENUM) - conservative, moderate, aggressive, very_aggressiveinvestment_experience(ENUM) - beginner, intermediate, advanced, expertinvestment_time_horizon(ENUM) - short_term, medium_term, long_termprimary_financial_goals(JSONB) - Array of goals
Tax & Legal
citizenship_status(ENUM) - us_citizen, permanent_resident, visa_holder, othertax_filing_status(ENUM) - single, married_filing_jointly, married_filing_separately, head_of_household, qualifying_widowstate_of_tax_residency(TEXT)
Audit Trail
created_at(TIMESTAMPTZ) - When record was createdupdated_at(TIMESTAMPTZ) - When record was last updated (auto-updated via trigger)is_completed(BOOLEAN) - Whether intake form is complete
AI Tools
getPersonalInfo()
Description: Retrieves the user’s stored personal information
Input: None
Output:
updatePersonalInfo()
Description: Updates user’s personal information with partial updates supported
Input: Any subset of personal information fields
Examples:
System Prompt Integration
The AI is instructed to:- Capture information naturally when users mention personal details
- Store information silently without announcing or asking permission
- Never make it feel like a form - let information emerge organically
- Remember details like a human advisor would
Examples of Implicit Capture
Implementation Details
File Locations
- SQL Schema:
docs/user-personal-info-schema.sql - Tool Implementation:
app/api/chat/tools.ts(lines for getPersonalInfo and updatePersonalInfo) - System Prompt:
app/api/chat/system-prompt.ts(Personal Information Management section)
Security Features
- Row-Level Security (RLS): Users can only access their own records
- Foreign Key Constraint: Links to
all_userstable viaclerk_id - Cascade Delete: Automatically removes personal info when user account is deleted
- CHECK Constraints: Validates enum values at database level
- Audit Trail: Automatic timestamps via PostgreSQL trigger
Data Validation
- All enum fields have CHECK constraints in the database
- Zod validation in the AI tools layer
- Age constraints (e.g., retirement age between 0-120)
- Income validation (must be non-negative)
- Dependent count validation (must be non-negative)
Usage Patterns
For Financial Planning
The stored information enables more personalized financial advice:- Age-based recommendations: Retirement planning based on current age and target retirement age
- Family-aware guidance: Considers dependents for tax and savings strategies
- Location-specific advice: State tax implications, cost of living adjustments
- Income-appropriate suggestions: Investment recommendations scaled to income level
- Risk-aligned portfolios: Asset allocation matching stated risk tolerance
For Conversational Context
The AI can reference previously stored information:- “Based on your goal to retire at 60…”
- “Given your conservative risk tolerance…”
- “Considering your family of four…”
- “As a high-income earner in California…”
Privacy Considerations
- User Consent: Implied through using the financial advisory service
- Data Minimization: Only captures information relevant to financial planning
- Access Control: Strong RLS policies prevent unauthorized access
- Encryption: Data encrypted at rest (Supabase default)
- Deletion: Automatically deleted when user closes account
Future Enhancements
Potential additions to the system:- Explicit Intake Form: Optional UI for users to review/edit stored information
- Completeness Indicator: Show users what information has been captured
- Privacy Dashboard: Let users see and manage stored personal information
- Export Capability: Allow users to export their personal data
- Additional Fields: Healthcare status, estate planning details, beneficiaries
- Historical Tracking: Version history of personal information changes
Testing Checklist
Before deploying to production:- Run SQL migration to create
user_personal_infotable - Verify RLS policies are active and working
- Test
getPersonalInfo()with no existing data - Test
updatePersonalInfo()with new user (INSERT path) - Test
updatePersonalInfo()with existing user (UPDATE path) - Test partial updates (only some fields)
- Test with invalid enum values (should be rejected)
- Test with invalid numeric values (should be rejected)
- Verify timestamp auto-updates work
- Test cascade delete when user account is deleted
- Verify users cannot access other users’ data
Example Conversation Flow
Deployment Steps
-
Deploy SQL Migration:
-
Deploy Code Changes:
app/api/chat/tools.ts- Tool implementationsapp/api/chat/system-prompt.ts- AI instructions
-
Verify Deployment:
- Test with a sample conversation
- Check database to confirm data is being stored
- Verify RLS policies are protecting data
-
Monitor:
- Watch for errors in tool execution
- Monitor personal info capture rate
- Check for any privacy concerns from users
Support & Maintenance
- Questions: Contact the engineering team
- Bug Reports: Use the standard bug reporting process
- Feature Requests: Submit through product management
Last Updated: 2025-10-20 Version: 1.0 Author: AI Engineering Team