9 ms·
RAG with PostgreSQL
- deleted 3y ago[deleted]
- rcarmo 3y agoBest part of the article for me was the fact that it doesn't use any weird frameworks and the code is completely straightforward. I can do the REST calls myself on any language (even if the demo is in Go). Contrast that to miles of (often shoddily put together) langchain code, and this is very refreshing.
- madarco 3y agoSure, because this implementation won't work in practice. He's embedding the whole documents at once, without splitting, summarization, Q&A extraction etc.
- WJW 3y agoIt's really striking that the prompt is just a variation of "using the following text as reference material: <paste text of relevant document here>, answer the following question: <paste question here>". It's so simple it almost makes you wonder if this "should" work, but apparently it does so that's nice. On the other hand, this approach does struggle if the chosen reference is not actually the one you want, or if the correct answer is spread over some combination of many different documents. You could add more reference documents to the prompt, but intuitively that doesn't scale with many and/or large documents.
- madarco 3y agoNice demo but its lacks one feature to make it practical: splitting the input documents in chunks. Without it the embeddings will be too broad, and when retrieved the docs will consume a lot of input tokens, making the request slower/expensive