Skip to content

AI-powered expense creation via natural language#3

Merged
pdhruv93 merged 1 commit into
mainfrom
feat/agent
Jun 16, 2026
Merged

AI-powered expense creation via natural language#3
pdhruv93 merged 1 commit into
mainfrom
feat/agent

Conversation

@pdhruv93

Copy link
Copy Markdown
Owner

Summary

  • Add @opensplit/ai package — a chat agent that creates expenses from natural language using Vercel AI SDK (v6), OpenAI, and the existing MCP server
  • Add a floating chat popover in the web app with markdown rendering and i18n support
  • Add "Create with AI" button to the add expense form
  • Add dotenv support to the MCP server so it reads .env for port/URL configuration

What's included

New package: packages/ai

  • System prompt tailored for expense creation (handles equal splits and custom paid amounts)
  • Connects to the MCP server over HTTP via @ai-sdk/mcp — no tool duplication, reuses all existing MCP tools
  • createChatHandler() factory that the Next.js API route calls with MCP URL, user API key, and OpenAI key

Web app changes

  • /api/chat route handler — authenticates via the user's cookie and proxies to the AI agent
  • ChatPopover component — floating bottom-right chat panel with useChat hook, markdown rendering (react-markdown + @tailwindcss/typography), and streaming status
  • "Create with AI" sparkles button on the expense form that opens the chat
  • All new strings use next-intl (no hardcoded text)

Other changes

  • MCP server now loads .env via dotenv (resolves relative to package dir, not cwd)
  • MCP .env.example added
  • Expenses ordered by createdAt desc (was date desc)
  • Docker compose updated: web service gets OPENSPLIT_MCP_URL and OPENAI_API_KEY, depends on MCP
  • README updated with AI package docs, screenshots, env var tables, and demo disclaimer

@pdhruv93 pdhruv93 merged commit 9a7792f into main Jun 16, 2026
1 check passed
@pdhruv93 pdhruv93 deleted the feat/agent branch June 16, 2026 11:00
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