langchain
langchain copied to clipboard
[Feature] Adding prompt compression to langchain?
I have used LangChain heavily in my two LLMs demos. Really appreciate for your efforts on building such a great platform!
I recently designed a prompt compression tool which allows LLMs to deal with 2x more context without any finetuning/training. It's a plug-and-play module that fits langchain ecosystem very well.
I have employed this module in my demos. With this technique, my demo can now process upto 8 pages paper and very long conversation.
I realise it's a quite promising technique to greatly enhance user experience. I wonder if it's possible to embed this module into langchain? My twitter followers said it might be a good idea. Please let me know what do you think! I can contribute.
You can find the prompt compression tool here: https://github.com/liyucheng09/Selective_Context paper: https://arxiv.org/pdf/2304.12102.pdf