Prompt compression, Context compression
The top priority is to implement chat history increasing as a long-term memory proxy using vector-based hierarchy or file system-related hierarchy.
Specific implementation can be a chat history RAG or file system-based retrieval.
A system to manage context just as CPU cache architecture, including levels, and layers of understanding. This enables mapping tasks to code edit locations. This can be implemented as a subagent, memory folder, or hooks to implement this routing hierarchy.
Contextual Compressions
Represent Compressions
Survey
Prompt Compression for Large Language Models: A Survey
Leveraging large language models (LLMs) for complex natural language tasks typically requires long-form prompts to convey detailed requirements and information, which results in increased memory usage and inference costs. To mitigate these challenges, multiple efficient methods have been proposed, with prompt compression gaining significant research interest. This survey provides an overview of prompt compression techniques, categorized into hard prompt methods and soft prompt methods. First, the technical approaches of these methods are compared, followed by an exploration of various ways to understand their mechanisms, including the perspectives of attention optimization, Parameter-Efficient Fine-Tuning (PEFT), modality integration, and new synthetic language. We also examine the downstream adaptations of various prompt compression techniques. Finally, the limitations of current prompt compression methods are analyzed, and several future directions are outlined, such as optimizing the compression encoder, combining hard and soft prompts methods, and leveraging insights from multimodality.
https://arxiv.org/html/2410.12388v2
Contextual compression | 🦜️🔗 Langchain
One challenge with retrieval is that usually you don't know the specific queries your document storage system will face when you ingest data into the system. This means that the information most relevant to a query may be buried in a document with a lot of irrelevant text. Passing that full document through your application can lead to more expensive LLM calls and poorer responses.
https://python.langchain.com/docs/modules/data_connection/retrievers/contextual_compression

Seonglae Cho