eraaa: Era: The Jewelry Assistant That Turns Chat Into Inventory Logic

A close look at the state machine, hybrid retrieval stack, and staff handoff that make this open-source retail assistant feel more like a concierge than a chatbot.

8 min read • View on GitHub • More from evinjohnn

A jewelry counter under glass with rings and necklaces arranged in an orderly display while small blank tags hover above them like search constraints. The scene explains how the assistant turns shopping language into structured inventory logic instead of freeform chat.
Era frames jewelry shopping as a search problem with taste, budget, and occasion attached.
Key Takeaways

A chatbot that behaves like a jeweler

Most shopping bots try to answer everything. Era does something sharper: it asks enough questions to turn a vague request into a search problem it can actually solve. In jewelry, that matters more than chat polish. A necklace is not just a product, it is metal, budget, occasion, taste, and often another person's feelings.

That is why Era feels different from a chatbot with a catalog bolted on. It behaves like a merchandiser with memory, not a language model guessing at preference. The useful unit is not a message. It is a structured preference set.

Why jewelry breaks generic chat

Jewelry is a worst-case retail domain for generic chat. A customer may ask for something elegant for a sister's graduation under $200, and every word matters. Miss the metal, the occasion, or the price ceiling, and the recommendation is wrong even if the prose sounds confident.

Era is built around that reality. The repository's product model carries the kind of metadata a human salesperson keeps in their head, such as metal, gemstones, recipient tags, occasion tags, and design type. That means the assistant is not just matching text. It is matching intent against inventory with enough structure to be useful.

A close-up of hands annotating a customer note card beside a tray of rings. Simple abstract chips rise from the note card and settle into a neat row, showing how messy language becomes structured preferences.
The first trick is translation, not generation. Era turns shopping language into fields it can search.

How a sentence becomes a shortlist

The repo's conversation engine treats the chat as a finite state machine. It starts by identifying purpose, moves through preference gathering, then shifts into recommendation, or routes to staff when confidence drops. That sounds modest until you see the implication: the model is not allowed to wander. It has to decide what kind of problem this is before it solves it.

Once the assistant has a context object, preference extraction can keep adding detail without losing the thread. One branch pulls semantic similarity from embeddings. The other applies hard metadata filters from PostgreSQL, like budget, metal, gemstone, occasion, and recipient tags. The ranking step then scores the survivors against the current context. Era is useful because it narrows twice, once in language and once in inventory.

A sentence narrows into preferences, then into inventory, then into a human handoff when confidence falls.

The enhanced stack is the real origin story

The codebase reads like a project that grew up in public. The simpler path in `main.py` is the prototype, the route that proves the idea. The enhanced path adds the scaffolding a real store needs, FastAPI, PostgreSQL, ChromaDB, Redis, analytics, and a staff dashboard. That shift matters because retail tools live or die on traceability.

The stack also shows a clear division of labor. `database.py` keeps relational truth in Postgres, `vector_db.py` builds the semantic layer, `rag_system.py` handles generation, and `conversation_engine.py` manages state. `analytics.py` makes the whole thing measurable by tracking signals like handoff rate and confidence levels. Era does not just answer shoppers. It records where the assistant was uncertain and how often a person had to step in.

That is the difference between a demo and an operating system. A demo can impress with a good answer. A retail assistant has to explain why it answered that way, remember what was already learned, and keep working when the answer should come from a human.

Era versus the usual store chatbot

The right comparison is not another jewelry bot. It is the default stack most stores already use.

DimensionGeneric retail chatbotClassic faceted searchEra
MemoryShort, fuzzy conversational memoryUsually noneStateful context across the conversation
RetrievalBroad language generationExact filter narrowingHybrid semantic search plus metadata filters
PrecisionSounds helpful, often guessesAccurate but rigidPrecise without losing conversational flow
EscalationOften absentNot designed for itClean staff handoff when confidence is low
Failure modeConfident nonsenseToo many clicks or too few resultsStops short and routes to a person
A split scene shows a noisy chatbot on one side, surrounded by vague speech bubbles and mismatched product cards, while the other side shows a tidy jewelry shortlist pinned with exact constraint chips. The image explains the difference between guessing and structured narrowing.
Era sits between search and service, and that is exactly why it feels more useful.

The handoff is not a fallback

The smartest part of Era may be the least glamorous. It has a `STAFF_HANDOFF_REQUESTED` state, and that is the right move. Retail asks for taste, judgment, and context that a model should not fake. When the assistant cannot narrow the field enough, it should stop pretending and bring in a person.

The analytics layer makes that behavior legible. If handoffs spike, or confidence keeps dipping, the team can tell whether the catalog is thin, the retrieval is weak, or the prompt is asking for too much. That is how a system becomes tunable. It does not just answer. It produces signals the business can act on.

Era's real lesson is simple. Conversational UI only works when it is backed by the discipline of search and the humility of escalation. In jewelry, that combination is not a nice-to-have. It is the product.

A sales associate receives a clean alert on a tablet while a customer stands nearby and the recommendation flow ends in a human hand. The scene shows that escalation is part of the product design, not a failure condition.
The assistant knows when to stop and hand the conversation to a person.