Back to feed
Dev.to
Dev.to
7/18/2026
Adding an AI Chat Feature to My Expense Manager

Adding an AI Chat Feature to My Expense Manager

Short summary

A developer built an AI chat feature for an existing React/Express/SQLite expense tracker, letting users ask natural-language questions about their spending. The approach injects fresh expense data into system instructions on every request rather than relying on conversation memory. The writeup covers four real bugs encountered (env var naming, async SDK changes, model availability, 503 errors) and why streaming was essential for chat UX.

  • Chat feature injects fresh DB data into system prompts each turn instead of relying on LLM memory
  • Streaming is essential for chat UX — non-streaming feels broken to users
  • Four real bugs encountered and solved: env var naming, async SDK change, model deprecation, 503 errors

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more