Skip to content

feat: Add admin AI assistant with chat interface#238

Open
timgl wants to merge 2 commits intomainfrom
dmarticus/admin-ai-assistant
Open

feat: Add admin AI assistant with chat interface#238
timgl wants to merge 2 commits intomainfrom
dmarticus/admin-ai-assistant

Conversation

@timgl
Copy link
Contributor

@timgl timgl commented Feb 4, 2026

Summary

Adds a full-featured AI assistant for admin users with:

  • Chat interface on homepage with sidebar for conversation history
  • URL-based routing for shareable conversation links (?c=<conversationId>)
  • Multi-step agentic tool execution using Vercel AI SDK v6
  • Tools for employee data, compensation, and org structure queries
  • Auto-create conversations on page load to ensure valid transport
  • Database schema updates to support conversations without agents

Implementation Details

  • Uses @ai-sdk/react with DefaultChatTransport for streaming chat
  • Uses stopWhen: stepCountIs(10) for multi-step tool execution (not maxSteps)
  • Server responds with toUIMessageStreamResponse() for proper UIMessage format
  • Chat sidebar shows conversation history with delete functionality
  • Lazy conversation creation - only creates DB record when admin visits homepage

Tools Available

  • readEmployees - Read employee data
  • readSalaryHistory - Read salary history
  • readProposedHires - Read proposed hires
  • readOrgStructure - Read organizational structure
  • readCompensationBenchmarks - Read compensation benchmarks

Database Changes

  • Made agentId nullable in AgentConversation table (migration included)
  • Conversations can exist without being tied to a specific agent record

Testing

Tested locally with multiple conversations, tool execution, and chat history navigation.

@timgl timgl requested a review from MarconLP as a code owner February 4, 2026 23:25
Add a full-featured AI assistant for admin users with:
- Chat interface on homepage with sidebar for conversation history
- URL-based routing for shareable conversation links
- Multi-step agentic tool execution using Vercel AI SDK v6
- Tools for employee data, compensation, and org structure queries
- Auto-create conversations on page load to ensure valid transport
- Database schema updates to support conversations without agents

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@timgl timgl force-pushed the dmarticus/admin-ai-assistant branch from e255ef1 to ed6f825 Compare February 4, 2026 23:28
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.

1 participant