8 ms·
Retrieval in LangChain
- 40291misteryo 4y agoThanks for this info! Regarding the first instance of a non-LangChain Retriever - the ChatGPT Retrieval Plugin. I know this was recently open sourced by OpenAI for their own purposes to help gain more traffic to them. Probably to help people figure out endpoints to hook into ChatGPT. But how about for other usages? Be interested in how this fits in with your vectorstores. Thanks for the read!
- 35mm 4y agoCan anyone use the ChatGPT Retrieval plugin yet? Or is it limited to whitelisted beta testers?
- apetresc 4y agoStill whitelisted atm.
- Spivak 4y agoReally excited to see LangChain moving really fast in this space. They turn your favorite Llm into a real boy that can do real work. Some "agents" in their vernacular that I've built. * A reminder system that can take a completely free-form English description and turn it into a precise date and time and schedule it with an external scheduler. * A tool that can take math either in English or ascii like y = 2x^2 + ln(x) and turn it into rendered LaTeX. * A line editor that let's you ingest Word documents and suggests edits for specific sections. * A chess engine. Like it's crazy at just how trivial all this stuff is to build.
- mark_l_watson 4y agoI share your enthusiasm for LangChain (as well as LlamaIndex). I don’t remember being as obsessed by any new technology. I am writing a book on the subject [1] but to be honest the documentation and available examples are so very good, that my book has turned into just a write up of my own little projects. I agree that some things really are trivial to implement and I think this opens the door to non-programmers who know a little Python or JavaScipt to scratch their own itches and build highly personalized systems. [1] https://leanpub.com/langchain https://leanpub.com/langchain
- thequadehunter 4y agoThat's funny...I actually just bought your book because I have a bone to pick with the documentation. It's good at explaining stuff, but I feel it fails to show how some of the parts work together. It would be immediately more obvious if there were just full examples rather than partial ones. Thanks for writing this.
- mark_l_watson 4y agoThanks for the kind comments! The final version should be available in a day or two.
- pumanoir 4y agoThese examples are great, but the chess engine sounds specially interesting and can't think of how I'd do it with langchain. Do you have a git link or something written down, on how you accomplished this?
- deleted 4y ago[deleted]
- nextaccountic 4y ago> Some "agents" in their vernacular that I've built. Are any of those open source / are they on Github? Could you link it?
- KrugerDunnings 4y agoI've been playing around with sentence embeddings to search documents, but I wonder how useful they are as a natural language interface for a database. The way one might phrase a question might be very different content wise from how the document describes the answer. Maybe it might be possible to do some type of transform where the question is transformed into a possible answer and then turned into a embedding but I haven't found much info on that yet. Another idea I've had is to "overfit" a generative model like GPT on a dataset but pay more attention to how url and the like are tokenised
- nunodonato 4y agoembeddings are really good at that, you dont need to use similar words at all.
- IanCal 4y ago> Maybe it might be possible to do some type of transform where the question is transformed into a possible answer and then turned into a embedding but I haven't found much info on that yet. Here you go https://twitter.com/theseamouse/status/1614453236349693953 https://twitter.com/theseamouse/status/1614453236349693953
- summarity 4y ago> might phrase a question might be very different content wise from how the document describes the answer That's what hypothetical embeddings solve: https://summarity.com/hyde https://summarity.com/hyde There are also encoding schemes for question-answer retrieval (e.g. ColBERT)
- sharemywin 4y agois there an example what what your talking about? Also would you just return a list of likely candidates and loop over the result set to see if any info is relevant to the question and then have the the final pass try to answer the question.
- visarga 4y ago> The way one might phrase a question might be very different content wise from how the document describes the answer. If the embeddings are worth their salt, then they should not be influenced by paraphrasing with different words. Try the OpenAI embeddings or sbert.net embedding models.
- amrb 4y agoLangChains is a great tool and looking forward to swapping between LLM's like it was an API!
- vthallam 4y agoNoob here. Is this similar to what ChatGPT Retrieval plugin does, but for other LLM's?
- 0xDEF 4y agoLangChain is LLM agnostic. People are using it with Cohere's LLMs and even self-hosted LLMs like LLaMA.
- blueorange8 4y agoIt's the backend of retrieval plugin basically
- gk1 4y agoThe retrieval plugin does not use LangChain, afaik.
- blueorange8 4y agoGuess I can't delete my comment but I guess "basically" in this context means a similar type implementation
- justanotheratom 4y agoI would say LangChain is similar to ChatGPT itself. - LangChain's Retriever is analogous to ChatGPT Retrieval Plugin. - In general, LangChain has tools for what ChatGPT calls Plugins. - ChatGPT uses OpenAI's GPT-4 LLM. LangChain uses ... any LLM (i.e. configurable).
- jcims 4y agoEnabling the 'terminal' and 'python-repl' tools in a langchain agent demonstrates some pretty remarkable behavior. The link below is the transcript of a session in which I asked the agent to create a hello world script and executes it. The only input I provide is on line 17. Everything else is the langchain agent iteratively taking an action, observing the results and deciding the next action to take. This is just scratching the surface. I've seen it do some crazy stuff with the AWS CLI. And this is just with GPT-3.5, I don't have access to GPT-4 yet and it clearly has better capabilities. https://pastebin.com/qJsbufVj https://pastebin.com/qJsbufVj
- deleted 4y ago[deleted]
- robbintt 4y agoWhat is the aws cli stuff? I was thinking about writing a terraform agent tool.
- jcims 4y agoYou install and configure the CLI to run locally, then ask it to do something. For example, ask it to create a website using s3 static website feature. It creates the bucket, creates the content, uploads the content, configures the bucket static website features and configures the permissions on the bucket and content. I just started tinkering with terraform, which it seems to understand fairly well.
- antibasilisk 4y agoThat pastebin is mindboggling.
- badloginagain 4y agoI'm glad our AI overlords are as bamboozled by python vs. python3 as us lowly humans
- roflyear 4y ago
- jacooper 4y agoHow can I use this with llama ?
- justanotheratom 4y agohttps://github.com/linonetwo/langchain-alpaca https://github.com/linonetwo/langchain-alpaca
- freezed88 4y agoMaking retrieval really really good is part of the mission of LlamaIndex! Given a natural language input, find the best way to return a set of documents that is relevant to your LLM use case (question-answering, summarization, more complex queries too). - We integrate with vector db's + ChatGPT Retrieval Plugin - Submitted a Retrieval PR to langchain here: https://github.com/hwchase17/langchain/pull/2014 https://github.com/hwchase17/langchain/pull/2014 - would love to explore further integrations as a plugin in any outer agent system
- zikohh 4y agoI want to use llamaindex. My input would be a slack export but I don't want any data to go to openai I want it all to happen locally or within my own EC2 instance. I have seen https://github.com/jerryjliu/llama_index/blob/046183303da4161ee027026becf25fb48b67a3d2/docs/how_to/custom_llms.md#example-using-a-custom-llm-model https://github.com/jerryjliu/llama_index/blob/046183303da416... but it calls hugging face. My plan was to use https://github.com/cocktailpeanut/dalai https://github.com/cocktailpeanut/dalai with the alpaca model then somehow use llamaindex to input my dataset - a slack export. But it's not too clear how to train the alpaca model.
- neilellis 4y agoWho would have thought we'd be able to follow the birth of Skynet in real-time.
- aunty_helen 4y agoTo be fair, LangChain may be the reprogrammed ChatGPT that we use to fight off Skynet
- anonymouslambda 4y agoDoes anyone have an opinion on LangChain versus Deepset Haystack? Haystack seems more polished for NLP tasks, but LangChain looks more extensible long term? Thanks!
- meghan_rain 4y agoHaystack unfortunately seems like a dead end. LLMs are the way forward.
- yadaeno 4y agoIn the back of my head im thinking about how you could make a stock portfolio analysis chatbot. I think you would want to vectorize a set of documents containing summarized historical + a few documents containing recent data. When asked to analyze a particular portfolio, the portfolio, along with the short term + long term vectors are passed into the LLM. Im not sure if this is the ideal approach though.
- ryanwaggoner 4y agoA little off-topic: are LLMs the death knell for new languages, frameworks, tools, processes, etc? I can see how an LLM is going to be such a huge productivity boost that they’ll be hard to avoid everywhere, but then new stuff won’t have any training data. Will anyone ever go through the effort of everything being 10x - 100x less effective with new tools since there’s no training data?
- sanity31415 4y agoTools could be made so that an AI can learn to use it, generating training data in the process.
- Ozzie_osman 4y agoOne thing I love about LangChain is I can basically use it to keep abreast of all that's going on around LLMs. Which models are available, which patterns (eg agents), papers like MRKL or ReAct. The library is always at the cutting edge.