Source: Preliminary findings from the JetBrains Developer Ecosystem Survey 2026 • 15,000+ developers worldwide
Problem type
RAG
Context window
Internal company documentation
Best fit
Works for excerpts you paste in
Current conversation history
Adds latency for little gain
Best fit
Holds them for a single session
Practical for a handful of files
Works for small, explicitly provided rules
Long-term memory
Better served by an index
Better served by session state
Best fit
Too coarse for file-level recall
Useful for persistent learned preferences or decisions
Changes too often to index cleanly
Best fit
Good fit when stored in docs or repository files
User preferences and habits
Large repositories
Project conventions and style guides

Failure
Why it matters
Mitigation
Irrelevant retrieval
The agent reasons from the wrong context, so answers look plausible but are wrong
Improve chunking strategy and add reranking
Stale knowledge
The agent surfaces deprecated APIs, reverted decisions, or outdated procedures
Add freshness metadata and re-index frequently
Detect conflicts at retrieval time and require citations
Use semantic or structure-based chunking instead of fixed character counts
Enforce permission filtering at retrieval time, scoped to the requesting user
Two retrieved docs say opposite things, and the agent picks one without flagging
Chunks split logical concepts, losing necessary context
The agent surfaces documents the requesting user shouldn't see
Conflicting sources
Poor chunking
Missing permissions
Require groundedness evaluation and enforce citation on outputs
Cap what reaches the model after reranking, and filter aggressively on metadata before it gets there
The agent generates text that retrieved docs don't actually support
Too many retrieved chunks dilute the signal for the model
Unsupported claims
Context overload
Yes. Code repositories can be indexed and retrieved from like other knowledge sources, often using structure-aware chunking and hybrid search. Separately, IDE-connected agents, such as JetBrains Junie, can use IDE project awareness for symbol-aware search and repository exploration, while repository intelligence layers, such as JetBrains Context, provide semantic retrieval across indexed codebases.
A RAG chatbot retrieves context to answer a question. A RAG agent retrieves context to plan and execute multistep tasks, including generating code, calling tools, running tests, and updating files. The retrieval mechanism is similar, but the scope of downstream action is much broader.
Log every retrieval query and the top results returned,and then evaluate retrieval independently from answer quality. If the retrieved chunks don't contain the answer, the problem is in the retrieval pipeline, not in the model's reasoning.
Check the source metadata. When was the document last modified, who authored it, and does it conflict with other retrieved chunks? Requiring citations in agent responses gives developers a direct path to verify every claim against its source.
Not necessarily. Simple factual questions that the model can answer reliably from training data don't benefit from retrieval. The agent should decide whether retrieval is needed based on query type, confidence threshold, or explicit triggers, because retrieving unconditionally adds latency without always improving quality.
Yes. Hybrid retrieval can be particularly useful for code and technical documentation because semantic search captures conceptual similarity while keyword search catches exact identifiers, error codes, and API names. Whether it outperforms a simpler retrieval approach should be validated on your own query set.
Damaso Sanoja is an engineer who is passionate about helping others make data-driven decisions to achieve their goals. This has motivated him to write numerous articles on the most popular relational databases, customer relationship management systems, enterprise resource planning systems, master data management tools, and, more recently, data warehouse systems used for machine learning and AI projects. You can blame this fixation on data management on his first computer being a Commodore 64 without a floppy disk.
Explore JetBrains AI solutions that help you build, use, and scale AI agents across the software development lifecycle.
Run terminal agents through one JetBrains account, with access, models, and usage governed centrally.
Plan, code, debug, and automate tasks with a coding agent that works across your terminal, IDE, GitHub, and GitLab.
Orchestrate AI agents and verify their output directly in JetBrains IDEs, with full control over how changes are reviewed.
Automate software delivery workflows, coordinate agentic work across teams, identify bottlenecks affecting delivery.
Govern AI usage, models, policies, and costs across your organization, including JetBrains and third-party tools.
Give agents shared organizational memory and context that carries across tools, workflows, and execution environments.
An open system of AI products for developers, teams, and organizations – from coding with agents to automating workflows and governing AI at scale.
Continue Exploring the AI Agents for Developers Guide
Learn how to manage AI agent context windows, reduce context loss, and improve performance, accuracy, and reliability in long-running workflows.
Learn how long-term memory helps AI agents retain knowledge, improve decision-making, and support reliable multistep workflows over time.
Explores AI agent architecture, including core components, planning, memory, tool use, orchestration, and design patterns for building reliable AI agents.