Cache-Augmented Generation (CAG)
Architecture of Neko’s Cache-Augmented Generation (CAG) System
Neko incorporates Cache-Augmented Generation (CAG) as a core component of its AI & Machine Learning infrastructure. CAG provides the DeFi Multiagent System with immediate access to essential, pre-loaded strategic knowledge, particularly concerning yield optimization and risk management heuristics relevant to the HyperEVM environment.
Unlike Retrieval-Augmented Generation (RAG) which fetches dynamic data in real-time, CAG focuses on providing agents with foundational, relatively stable knowledge efficiently.
Purpose: Efficient Strategic Context Setting
The primary goal of using CAG within Neko is to rapidly equip agents with core strategic context without the latency associated with real-time database lookups for this specific type of information. This allows agents to quickly ground their decision-making processes in established best practices and learned heuristics relevant to their assigned tasks (e.g., managing an Earn vault).
Mechanism: The CAG Database (KV Cache)
Neko utilizes a specialized CAG Database, likely implemented as a pre-computed key-value (KV) cache. This cache contains distilled strategic information relevant to DeFi operations on HyperEVM.
- Pre-computation: The knowledge within the CAG DB is processed and stored beforehand.
- Context Injection: When an agent requires foundational strategic guidance, the relevant portions of this KV cache are efficiently loaded directly into the agent’s operational context window.
- Efficiency: This direct injection avoids the need for complex real-time vector searches or embeddings for this cached knowledge, making context setting faster, especially for well-defined, constrained knowledge sets.
Content: Distilled DeFi Knowledge & Heuristics
The information stored within Neko’s CAG DB represents distilled knowledge and effective heuristics derived from analyzing successful DeFi strategies and risk management principles (drawing inspiration from the vast landscape of techniques outlined in Neko’s research context). This includes:
- Core principles for managing specific vault types.
- Effective patterns for liquidity provision or borrowing strategies on HyperEVM.
- Key risk parameters or safe operational boundaries.
- Learned heuristics from past agent performance.
This is not raw, real-time data but rather a condensed, readily accessible library of strategic “rules of thumb” or foundational knowledge.
Synergy with RAG
CAG and RAG work in tandem to provide agents with comprehensive context:
- CAG: Provides the foundational strategic knowledge and heuristics (the “how-to” based on learned patterns).
- RAG: Provides the real-time, dynamic data (current market prices, specific protocol states, recent events).
By feeding both the pre-loaded CAG context and the real-time RAG data into the agent’s decision-making process (e.g., the LLM core), Neko ensures that actions are both strategically sound and responsive to the immediate on-chain environment.
Outcome
Leveraging CAG allows Neko agents to make faster, more informed decisions by instantly accessing a pre-loaded cache of relevant strategic heuristics. This efficiency, combined with the real-time data provided by RAG, enables the DeFAI Multiagent system to operate effectively and adaptively within the dynamic HyperEVM ecosystem, optimizing for yield and managing risk according to both established best practices and current market conditions.