-
-
Notifications
You must be signed in to change notification settings - Fork 31
Home
Context Augmented Generation (CAG) is the core engine behind RepoMind, designed to overcome the limitations of traditional Retrieval Augmented Generation (RAG) when dealing with complex codebases.
Instead of retrieving small, disconnected fragments of code, CAG leverages the massive context windows of modern LLMs (1M+ tokens) to understand the whole picture.
| Feature | Traditional RAG | RepoMind (CAG) |
|---|---|---|
| Context Strategy | Fragmented Context: Chops code into small, disconnected vector chunks. | Full File Context: Loads entire relevant files into the 1M+ token window. |
| Retrieval Method | Similarity Search: Relies on fuzzy matching which often misses logic and flow. | Smart Agent Selection: AI intelligently picks files based on dependency graphs. |
| State | Stateless: Forgets everything after each query. | KV Caching: Remembers context for instant follow-up answers. |
CAG moves beyond vector databases by loading complete files into the model's context. This allows the AI to see function definitions, imports, and logic flow in their entirety, rather than guessing from a 5-line snippet.
Rather than relying on simple keyword matching, CAG uses dependency graphs to understand how files relate to each other. If you ask about a component, it knows to also look at the hooks and utilities that component uses.
To ensure speed despite large context sizes, CAG utilizes Key-Value (KV) caching. This means once a file is processed, its "understanding" is cached, making follow-up questions instant.