Day 20 of building DocuPulse AI — a system that answers questions about legal contracts.
Today my system started typing its answers live, word by word, like ChatGPT does. Same total speed as before — but instead of a dead screen for five seconds followed by a wall of text, you watch the answer build. It's a user-experience trick, not a speed gain, and that distinction matters.
Getting there taught me something. I assumed the streamed data would be simple text. It wasn't. I guessed the shape three times and was wrong three times — until I stopped guessing and dumped the actual object to see what was really coming back. Turns out a stream isn't strings at all: it's a sequence of typed events, and only some of them carry words.
The lesson: when you're working with a tool newer than your knowledge, the running code is the source of truth — not the docs, not your assumptions. Dump reality and read it.
12 years of backend engineering, now applied to AI. Building in public, one honest day at a time.
#RAG #LLM #AI #BackendEngineering #BuildInPublic
0
15
A retrieval-augmented AI system that answers questions about legal contracts in plain English — grounded strictly in the source document, never guessing. Built with Laravel, PostgreSQL/pgvector, and the OpenAI embedding + LLM APIs. Handles document chunking, vector search, prompt assembly, and hallucination control, with a validation layer that refuses to invent answers when information is not present.