Building a Smart Assistant Bot: Postgres, Knowledge Base
I set out to build a smart assistant bot.
One that:
Searches a Postgres database based on a person's request. Like "find me a house" or some specific product that's currently available. From the fresh records.
Consults a knowledge base. Our own, that is, not the internet.
Doesn't just answer questions from the knowledge base/records, but can talk to a person like a human and not like a script, giving some recommendations (without searching the internet, just from what the LLM itself knows, like "don't eat yellow snow" and so on).
The additional requirements:
- long-term memory about the person/interlocutor: what they remembered, what they were interested in.
- multi-user, naturally, with simultaneous conversations.
First we spent two or three days building our own system with an agent. Painful, expensive, slow, and in the end I realized I was reinventing the wheel. OK, I studied humanity's best practices, realized I'd basically built a minimalist LangGraph, came to my senses and took the real LangGraph.
Then three more days of agonizing polishing and tuning. I'd already developed an inferiority complex. Why on earth can't it hold a conversation in which I combine different filters, "now show me the opposite", "pick something from what's there, but different", and so on? Or rather, why is it taking so long to get this right...
Until I looked at the prices/timelines of other freelancers. And realized that what I'd planned to do in 2-3 days is something people spend weeks polishing, and it starts at 100k.
The good news (for me): within a week I got the system to a working state.
Now I'm going to build V2 and put Hermes in the inner loop, so that it talks to people. And compare them on effectiveness and appetite.