Show HN: Customizable, embeddable Chat GPT based on your own documents (libraria.dev)

271 points by bealuga ↗ HN
Hi Hacker News!

My name is Bea, I built a site called Libraria that uses GPT to do a few things

1. Let you spin up multiple assistants based on your own documents. You can make it public, private, or protected. It has its own subdomain and landing page. 2. Respond in full markdown always, so it can output images, links, code, and more 3. Let you upload articles on the fly within the Chat, so you can ask it questions 4. Make it embeddable in your site with one line of code 5. Let you update it for fun / with your branding 5. Enable syncing for any URLs you let us scrape, so that you can make sure it's always up to date 6. Let you upload multiple file types

I've been working on this for about a month now by myself and you can keep track of my feature updates here: https://libraria.dev/feature-updates

I would LOVE your feedback on anything, and If you're willing to try it out I'm looking for a few beta users that can provide me more continuous feedback that I would gladly waive the fee for!

134 comments

[ 3.1 ms ] story [ 206 ms ] thread
(comment deleted)
For the Dumbledore demo I asked, "What are the 3 unforgivable curses?" and it was unable to provide an answer.

https://ibb.co/bL61nDk

Would your tool work in gated knowledge bases for example training courses behind logins?

Oh no! Let me manuially add the 3 unforgivable curses to the library. The way I did the dumbledore demo was upload a PDF for each of the 7 books and there ~might~ not be an explicit section in harry potter that states all of them at once?
> an explicit section in harry potter that states all of them at once?

Isn’t part of the point of GPT that it finds relationships without the training data having to be well-structured? So long as the text describes them in a way that a human, having read the books, could answer the question?

I don’t really understand how training works. This isn’t a jab.

It's a great question!

Right now, I don't train anything, I've broken the text down to n characters and created embeddings for that subset of text -- then I search for the closest distance / relationships between the question asked. Then I add the text to the prompt, and tell gpt to use those paragraphs to answer the question (to ensure that it doesn't make anything up). This is one of the ways I can get around the token limit, but it comes at the cost of thinking it can only use the paragraphs I show it. I'm trying to improve the prompt to get more consistent results, and maybe 4 can help me give it larger bodies of text!

Hope that answers your question, let me know if you have any more!

Oh! I think I understand.

So your software takes a prompt from me, does non-GPT work to find additional context from your source (the books, parsed and re-structured into word vectors or whatnot), and then asks GPT my prompt combined with the added context?

Like,

“What are the three foobars when considering these passages from a book <…> ?”

Yeah more or less! I still use open ai for their embeddings (translating text into vector space)

- Your question -> vectors with open ai embeddings - Text you uploaded before -> vectors with open ai embeddings

Get the most similar above a certain threshold, and then add it to the prompt saying

"From these articles / paragraphs, answer the user's question: What are the three foobars"

So yep! I preprocess it

I think that’s a really clever idea.

It feels like training is analogous to years of growing up and going school. And what you’ve done is taken that educated “mind” and said, “here’s a document. I’m going to quiz you on it.”

That seems really practical compared to sending an AI back to school to learn all about some specific topic.

I wonder if we will end up with a library of trained models, each of which went to different schools to obtain different focuses of knowledge. Maybe LiteratureGPT is better suited for this than General GPT or ProgrammerGPT.

Okay I think I’ve stretched the analogy far enough.

The GPT models create sequences of words that are likely to be look correct. A side effect is that it sometimes happens to find a connection between ideas. The three unforgivable curses are something that it should be able to connect, as these are all probably in a similar conceptual space, but you would need a fair bit of data to push the model to see that. It's possible to uncover these connections with less data, but with LLMs you need to do things like prompt engineering to give you more leverage on your data if it's limited.
Yeah, it looks like it actually got the documents correctly, but the prompt itself needed some reworking. I think there's a space out there for prompt testing.
so - if i download a boatload of research papers from scihub about topic X - this will be base its knowledge off them? if so i was just thinking this would be cool to have - and here it is?
I was thinking something similar and the answer is yes I think.

I uploaded a public-domain copy of Meditations by Marcus Aurelius and now I feel like I can get direct knowledge from the man himself

https://ibb.co/g7ry4X3

It worked pretty well on the first attempt. Will try putting more authors in it now

Yes. If you do try that, let me know! The most difficult part that i'm encountering right now is the "prompt" engineering part. So I'd be curious to know how I can make it better for you
The "Ask Libraria" text field doesn't let me type anything. I tried it with Chrome and Safari on a Mac. Is this intentional?
yeah sorry! That's just an image (,: There are other demos a bit below when you scroll down
I also thought it would be interactive and then realized it was just a screenshot. Would be cool to have an interactive demo right there at the top.
(,: I'm sorry! I'll put it up at the top soon hopefully (I'm hoping to go back to just coding on the app! Spent all day on the landing page today (,: )
This is cool. I just did a small poc yesterday. I scraped our api documentation and created an embedding and use chatgpt to answer questions. It is pretty slick.
Thank you! Hope you had as much fun as I've been having!
One question, are any of the prompts shared with OpenAI?
I use their APIs, so yes. There's no way around it right now, but hopefully in the future I can move away from relying on them
Testing it, nice.

I tried to import a .pdf but I got an error message about not having enough "credits" https://i.imgur.com/7za9FEn.png

Also, the google drive integration is not working (yet).

Can you give us a glimpse of what's coming down the road? How can I get more credits and when will Gdrive integration will be available?

Also: pricing?

Hi! Strange, that google drive integration should work. I'll take a look and update you right here when it does.

Pricing: Feel free to send me an email bea@bogpad.io, I'll send you some credits to play around with. I'm still trying to figure out pricing!

A few things:

1) I went through Stripe checkout to upgrade to the $10/month plan, but it's still showing me as on the free plan on the billing page.

2) I guess related to 1), but I want to show my business partner the results of a quick dump of a PDF plus scrape of our website; it's not clear how to supply him with the public chat/bot URL.

3) 'Last scraped' always shows 'invalid date'.

Feel free to reach out to me directly (email address is ***72@gmail.com for my account). Thanks, good luck with the product!

Thank you! Looking you up right now!
Love the approach and amazed by your packaging it looks slick and mature even for such a novel tech stack. But my understanding is that all the OpenAI models (3.5-Turbo et al) have a non compete terms of use clause so wondering how you approach this ? I can see the case that you are a complementary service increasing paid usage of OpenAI, but, I can also see them saying hey we want to be the ones to do that with enhanced features you are competing against. Perhaps just a long term risk to live with if you get past the short term market traction test ? Asking because I face a similar set of questions for a different set of reasons.
I ask 'googly' "tell me about the weather in san francisco, ca today and tomorrow" -- I get a factual answer that quotes Weather Underground.

I ask 'Dumbledore' the same thing, and I get (more-or-less) the same answer.

I think that I initially expected 'Dumbledore' to either feign ignorance on the topic, or at least output a 'flavored' answer in the style of his dialogue.

I guess what i'm saying is that assigning 'characters' to each of these pre-trained/biased prompts creates a user expectation of a character rather than just a pre-loaded knowledge-base.

Try the same with "Zappy". It won't give you the same answer!

I have a checkbox for you to enable or disable GPT. I enabled GPT for the Dumbledore one

https://ibb.co/8sQh1X6

Do you know what would be pretty cool? A feature that let the user to upload N documents, from different fields.

Then through an API he/she can extract the knowledge he/she wants.

Hmm, right now you can kind of simulate that by creating n assistants with only the knowledge you want in them. But yes, no API for now. If there's demand for it, I'll gladly build it though
I asked Dumbledore something from the books[0] and got something somewhat innovative, somewhat wrong: "How can I turn a staircase into a slide?"

> To turn a staircase into a slide, you can use the spell 'Tergeo' to remove any dirt or grime from the stairs, and then use the spell 'Lubricus' to make the stairs slippery. Lubricus is an incantation, which can be cast with a wand and by reciting the word 'Lubricus' while pointing the wand at the object in question. You can also use the spell 'Flagrante Curse', which can make a surface slippery by causing the target object to become extremely hot, in order to render the staircase slippery. However, this spell is considered one of the Unforgivable Curses and is strictly forbidden. It takes years of study and practice to become a proficient wizard, and performing spells can be dangerous, so it's important to learn and practice magic under the guidance of a skilled wizard or witch.

[0] https://harrypotter.fandom.com/wiki/Glisseo

:D LOL. The dumbledore example is interesting. I left "GPT" enabled, so it's not just pulling from the documents. I think I'll add settings for users to be able to change the temperature etc. for the assistants in the future as well
The first thing I did was try and get it to hallucinate or talk about things that aren't in the harry potter books.

This is the main concern for me with chatgpt bots: they make things up and can be prompt hacked to get outside their bounds.

So just some feedback that your demos should show how you tackle this too.

and got something somewhat innovative, somewhat wrong

That's not surprising, it's just par for the course with LLMs.

Beautifully designed. I assumed a team of people was behind this based on the apparent quality and then learned you're a solo dev. Very impressive!
This looks awesome. I'd be super interested in testing this out and providing feedback on it. I'm going to make an account and is there an email/link to submit feedback as I use it?
Congrats on the launch. We are building something similar at https://trypromptly.com that allows chatbot building on user's own documents powered by GPT. We also allow users to build AI powered apps without writing code.

For example, https://trypromptly.com/app/9da10a4f-6d20-431e-98f7-048fab81... is a chatbot built on Coursera video transcript. Similarly https://trypromptly.com/app/d478594d-2082-46c9-bee7-f057f4bc... is a web app that generates resume based on user information and the position they are applying to. Both are powered by Open AI message completions API and built using Promptly's no-code builder. Another fun app we built allows end user to provide a audio file, pipe that to Whisper and use that in the chain below to extract summaries etc.

Ps: We are still updating our landing page with app builder videos and other content

I feel it is impolite to hijack someone else’s Show HN to promote your own, like-for-like product, that too as a top level comment. Not sure about HN norms around this though.
It's a for-profit app being posted here to get free advertising. Other people jumping on to get free advertising too is fair game and definitely the HN norm.

Besides, I always bookmark threads for apps that look interesting and check back later when everyone else has posted their similar apps and been commented on, then I can compare and choose whichever one looks best (or whichever is open source).

I can see your point of view.

Personally, if I find that my app is similar to an ongoing Show HN, I like to wait for an opening where I can respond with a plug for my own app.

I don't feel comfortable talking up my own app unprompted. Feels like making a big attention grabbing announcement at someone else's wedding.

It is useful for users to learn about the alternatives.
Nah it was done kinda tastefully here and it’s helpful to know the comps
Ah this is crazy how fast the space is moving. I'm literally trying to build a document embedding UI to do Q&A on. Great work!
One thing that's understated is the fact that all you need is a sitemap. Wild how you can summon the knowledge of any site with a list of links.
I wonder if you’ve considered academics as a target market. We have a lot of pdfs and might like help in “thinking” about them.
Yep. This is such an obvious use case. Have you seen the best thing out there that does this? Where can I load 100gb of pdfs and ask questions about what's in them??
Yes, this is the next step I'm looking forward to, and what would probably make LLMs really take off. Let me dump my own knowledge base or source code into ChatGPT and have it use that as its source of knowledge. I can only imagine the cost and resources required to train and run these individual models on a large scale must still be prohibitively large.
That would be really really cool if I could able to serve that space. I'd be curious to know what kind of features you'd want to have, what would be deal-breakers, etc!
Not person with original question but he asks for the same feature as I would like to see.

I am not sure how the documents are handled in your product, since Chat GPT has a context limit that probably wont be able to hold longer papers in memory.

For me, I have a pdf[0] depicting a system that can be programmed, along with bits of pseudo-code and a lot of clarifications. Something that the Chat GPT could use to spit out an actual implementation, if it were able to "think" about the pdf as a whole. I would love to see if your product is capable of such feat.

[0]: https://arrow.tudublin.ie/cgi/viewcontent.cgi?article=1177&c...

Drive-Based Utility-Maximizing Computer Game Non-Player Characters by Colm Sloan (note that basically only chapter 3 is needed in this case, but its still over 40 pages long)

Basic setup: point it at a folder of PDFs, have it recurse in and read them all, then ask it questions like:

* Summarize these papers on chimpanzee cooperation in the wild. What other papers should I be reading?

* Suggest an interesting master's thesis topic on the early modern economy.

* How good are polygenic scores at predicting educational attainment, and how has this developed over time?

Bonus: integrate it with e.g. google scholar, so it can go and find and read new papers.

Pricing: it is probably easier to start selling this to individual academics. Then when you've got a compelling product and the word is out, you could sell it to the whole lab (at a much higher price because people can put it in their grant budgets).

Gotchas: privacy. Nobody wants their hot unpublished paper to be scooped by a large language model.

There's http://chatpdf.com already
Interesting and cool, but here's why serious academics should avoid it:

When you post Contributions, you grant us a license (including use of your name, trademarks, and logos): By posting any Contributions, you grant us an unrestricted, unlimited, irrevocable, perpetual, non-exclusive, transferable, royalty-free, fully-paid, worldwide right, and license to: use, copy, reproduce, distribute, sell, resell, publish, broadcast, retitle, store, publicly perform, publicly display, reformat, translate, excerpt (in whole or in part), and exploit your Contributions (including, without limitation, your image, name, and voice) for any purpose, commercial, advertising, or otherwise, to prepare derivative works of, or incorporate into other works, your Contributions, and to sublicense the licenses granted in this section. Our use and distribution may occur in any media formats and through any media channels.

Congrats, this is really cool. Have you thought about making the assistants Slack bots?
Congrats on the launch! I’m working on a similar product at https://upstreamapi.com

Im excited to see what features we build on top of semantic search + chat.

This is cool! I’m guessing you use something like langchain’s document loaders to make it work?
This is really cool! I would suggest a landing page based on the benefits - what cool things are people doing with this? IE some applications - what immediately pops to mind is a chatbot for your website or documentation, but I'm sure there are many more use cases you've thought of. Would be cool to see on the home page.
Hi Bea and thank you for sharing your creation. Looking good ! Couple of questions:

1) could you please describe your data privacy considerations. Like what happens to my documents after they are uploaded ? Are they stored somewhere (encrypted or not) or deleted ?

2) could you please share more details on how this works “under the hood”. Specifically how do you ingest and digest the knowledge contained in my documents ?

Thanks !

I asked "Dumbledore" a question. It gave the answer along with a "learn more" button which ended up being a link to PDF of the book. It shows up only for one particular question. Seems like a bug?