Menu

Post image 1
Post image 2
1 / 2
0

Building a Chatbot API From Scratch - Part 3: UUID Migration, Product Search, and Tests That Caught a Real Bug

DEV Community·Chris Kechagias·about 1 month ago
#strI6qqg
Reading 0:00
15s threshold

Two months in, both APIs are running. Before RAG touches either of them, I needed to fix decisions I'd been living with since day one. The retail API had integer primary keys. The chatbot had no tests. Both needed to change before I bolted anything else on. Five PRs across two repos. One Alembic migration I was genuinely nervous about. A test suite that found a bug I didn't know existed. UUID primary keys on the retail API The retail API launched with auto-incrementing integers for product and variant IDs. They work. They're also predictable — a scraper can enumerate your entire catalog by counting up from 1. More importantly: integers don't compose well when you're building a RAG pipeline where embeddings need stable, unique identifiers across multiple services. id=42 is not what you want there. id=550e8400-e29b-41d4-a716-446655440000 is. So I migrated.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More