Chatbot 4.x updating logs
๐ Jupiter Chatbot โ Version 4.x Dev Log
TL;DR
Between March 25 and April 11, I worked on launching the Jupiter chatbot into production. This post documents the major updates, improvements, and issues we faced in version 4.x. From a simple chat prompt to a fully autonomous search agent with backend integration and feedback, this journey reflects iterative development, real-world debugging, and agent system design.
๐งช v4.0 (March 25) โ Basic Chat Agent
- Launched a simple agent to help users search for medical services.
- The agent had:
- A single prompt for helping people find services.
- Access to a CPT-based knowledge base.
- Access to a backend API that searched for services in our database.
โ Problems:
- Lacked logic to handle more nuanced or vague user queries.
- Failed to find very common services like primary care.
- Could not prompt the user for more clarification if the search was too vague.
๐ค v4.3 (March 29) โ Adding Structure + Semantic Search
- Added logic to distinguish between types of care:
- Primary care, Urgent care, Emergency care, and Medical services.
- Designed and implemented:
- Semantic search for natural language input using vector embeddings.
- Keyword formatting via Algolia to ensure accurate service name matching.
- A more advanced flow that could prompt the user when their input was too vague.
- Introduced a multi-step reasoning process where the bot could narrow down search results.
โ Problems:
- The chat tone was too formal and lacked personality.
- We wanted a friendlier tone with emojis for a more approachable experience.
- Misclassified care levels:
- Couldn't always distinguish primary vs urgent vs emergency.
- Concierge practices were misinterpreted.
- Search accuracy was still inconsistent:
- Even if a service existed in the database, the bot sometimes failed to retrieve it.
๐งญ v4.3.1 โ Refined Chat Flow and Classification
- Rewrote the system prompt to restrict the chat flow
and align it more closely with our ideal script:
- Greet user โ Guess service โ Ask for location โ Redirect to results
- Improved classification by:
- Giving examples and criteria to help users understand what counts as ER, urgent, or primary care.
- Implemented a priority system that checked:
- Emergency care
- Urgent care
- Primary care
- Other medical services
- Fixed concierge classification by:
- Restricting keywords that led to misclassification.
- Ensuring Algolia uses minimum keywords to generate the correct formatted search keys, even if input was slightly off.
โ Problem:
- We decided that Algolia was not sufficient going
forward.
- We needed a backend search system that supported fuzzy keyword matching, not just exact service names.
- The result of this search should also be usable by the bot to guide further decisions.
โ๏ธ Midway: Migration to Dify Cloud
- Migrated the chatbot from a self-hosted server to the Dify.ai cloud service for better production readiness.
- While migrating, I:
- Contributed to the Dify GitHub repo by reporting bugs and suggesting solutions.
- Debugged multiple cloud-related issues.
๐ Problems Encountered:
- Frontend rendering failed after deploying to Dify Cloud.
- Could not create a knowledge base โ likely due to Difyโs handling of repeated documents.
๐ Fix:
- As a backup plan, I explored using external APIs for file storage and search.
- Ultimately fixed the issue by splitting large files into smaller documents to avoid duplication conflicts.
๐ v4.3.1.1 โ UX Copy Update
- Updated the "no result" response wording in the chatbot.
- Matched the tone and style of the search bar experience to maintain consistency between chatbot and UI search.
๐ง v4.4 (April 11) โ Full Production Launch ๐
- Major milestone: Backend search API completed.
- Vectorized all service descriptions in our database using PostgreSQL + embeddings.
- Implemented service sampling logic:
- The bot can now match a keyword input to the correct service name and CPT code.
- Fully replaced Algolia with the new backend API.
- Deployed to production with:
- Interactive result cards shown in the chat.
- A feedback system (๐ / ๐) to track user satisfaction.
โ Known Issues:
- The chatbot prompt is too long, causing fast memory loss in the LLM.
- Needs keyword association logic:
- Input like โlower backโ should match โlumbarโ services.
- Still misjudges some valid medical questions:
- For example, โWhat are the different prices for a knee replacement?โ may be rejected as not valid.
- Inconsistent return styles:
- Sometimes the bot gives a link to results.
- Other times, it explains the results inside the chat.
- Occasionally repeats itself.
๐ง Planned Improvements:
- Add support for prescription and drug-related services.
- Shorten and optimize the prompt for memory preservation.
- Implement concept linking and synonym matching.
- Standardize return methods for consistent UX.
๐ Final Thoughts
Over the course of version 4.x, weโve evolved from: - A one-prompt agent โ to a multi-branching flow โ to an autonomous search agent. - Keyword search โ to semantic understanding + structured decision-making. - Self-hosted infra โ to a cloud-native, production-ready platform.
More to come!
Chatbot 4.x updating logs
http://blog.slray.com/2025/04/11/Chatbot-4-x-updating-logs/