Get Tavily Certified Today. Learn, take the quiz, and earn your certificate for API credits.

customer4 min read

How JetBrain’s Coding Agent, Junie, Keeps Developers in Flow

Learn how JetBrains solved AI hallucinations in their coding agent Junie by grounding it with real-time web search, and what it means for teams building production AI agents.

By Tavily Team

April 8, 2026

How JetBrain’s Coding Agent, Junie, Keeps Developers in Flow

If you're building an AI agent that touches code, documentation, or any domain that changes faster than a model's training cycle, you already know the problem: your model is confident, fluent, and frequently wrong about anything recent.

JetBrains ran into this head-on building Junie, their AI coding agent for IDE and CLI workflows. The fix wasn't prompt engineering or a bigger context window. It was grounding the agent with real-time web search via Tavily. Here's what that looked like in practice, and what it means for teams evaluating search APIs for their own agents.

The architecture problem: confident hallucinations on recent APIs

Training data has a cutoff. For well-covered, stable libraries, that's usually fine. But for anything released, updated, or niche enough to have thin training coverage, models don't fail gracefully. They hallucinate with the same tone and confidence they use when they're right.

For a coding agent, this is a particularly bad failure mode. A hallucinated method name doesn't just give the wrong answer, it looks completely plausible. The code reads as if it should work, passes a quick review, and only reveals itself as wrong when you go to run it. By then the developer has already lost 10–20 minutes verifying what went wrong and finding the actual API.

Nick Frolov, Head of Product at Junie, ran into this directly:

"Before web search, the model would hallucinate library methods it didn't know. I ran into this myself building a Telegram integration; it was confidently wrong. Grounding it with real-time web search fixed that immediately."

The issue wasn't that the model was bad. It was that the model had no mechanism to know the boundary of its own knowledge. Web search gives it one.

What the integration needed to do

Before choosing a search API, the JetBrains team had a clear set of requirements, and they're worth walking through, because they map directly to decisions any team building a retrieval-augmented agent will face.

Return content, not URLs

An agent that gets back a list of links still has to fetch, parse, and extract the relevant content from each one, adding latency, complexity, and another layer of potential failure. JetBrains needed a search layer that returned pre-extracted, relevant content chunks ready for the model to reason over. Not a browser wrapper. Actual retrieval.

Optimize for agent context windows

Token efficiency matters. Returning a full documentation page when you need two paragraphs wastes context and degrades response quality. Tavily's reranking surfaces the most relevant chunks, keeping context clean and model performance high.

Stay model-agnostic

Junie's underlying stack will evolve. Locking search to a vendor-specific implementation (like search features built into a particular model provider's API) creates architectural debt. Tavily works the same way regardless of which model is handling the generation step, which meant JetBrains could wire it in once and not revisit it every time they changed something upstream.

Ship citations

In a coding context, developers need to be able to trace where an answer came from. A response grounded in a specific documentation page is auditable. One that isn't is just the model's word for it. Tavily's cited responses gave Junie's output a verifiability layer that mattered for developer trust.

Why Tavily

After evaluating options, JetBrains chose Tavily as the web search backbone for Junie. Three things made it the clear fit.

It's model-agnostic

Some built-in search solutions are tied to specific LLM vendors. Tavily isn't. For a team that wants flexibility in how Junie evolves, swapping or layering models over time, that architectural independence matters.

The integration was fast

Getting search running didn't require significant engineering overhead. The team integrated Tavily as a native tool within Junie, defined clear invocation patterns for when the agent should trigger search, and moved quickly into validation. When you're testing a new capability mid-product cycle, time-to-working-prototype matters as much as the API design itself.

Citations developers can actually trust

Tavily grounds every response in real-time web evidence with citations a developer can spot-check. That's the bar for production code, and it's what gave JetBrains the confidence to ship.

Three invocation patterns that transformed Junie's output

With Tavily integrated as a native tool, the team defined clear triggers for when Junie should invoke search. These three patterns drove the most meaningful improvement.

Knowledge cutoff bridging

When a developer asks about a library or language version released after the model's training cutoff, Junie routes to Tavily to pull current API documentation before generating a response. The output reflects the real state of the ecosystem, not a model's best guess from twelve months ago.

Niche library lookup

For obscure SDKs and packages with thin model coverage, the agent calls Tavily to fetch authoritative documentation on demand rather than attempting to generate from sparse training signal. This is where the hallucination rate improvement is most pronounced: the model stops filling in gaps it can't see.

Open-ended research queries

"Which library should I use for X?" is a question where training data staleness is particularly damaging, since the community consensus from eighteen months ago may have reversed. Routing these queries through Tavily grounds the comparison in current documentation, recent benchmarks, and active community discussion.

The result: an agent that keeps developers in their IDE, in flow, and confident the code they're producing reflects the real state of the ecosystem.

The broader pattern

The JetBrains integration illustrates something that comes up consistently in production AI agent development: the knowledge cutoff problem doesn't get solved by better models alone. It gets solved by giving models a reliable way to go get what they don't know.

The implementation pattern is straightforward: define the invocation triggers, integrate a search API that returns pre-extracted content optimized for agent context windows, and surface citations in the response. But the decision to do it at all is the one that matters. For any agent operating in a domain where accuracy on recent or niche information is a hard requirement, grounding isn't optional infrastructure. It's what makes the agent production-ready.

Tavily works in Junie out of the box. No configuration needed, just accurate, verifiable code suggestions powered by real-time web retrieval. Try it in the Junie CLI today.