﻿# JetBrains AI symbol and database attachments: preserve the context type

JetBrains symbol and database attachments identify different evidence types; a declaration or schema supplies context, while observed runtime behavior needs separate verification.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/learn-jetbrains-symbol-database-context/
Language: en

A symbol, a database object and a pasted text fragment can contain related information while giving an assistant different context. JetBrains AI Chat exposes typed attachments for this reason. Preserving what was attached helps the developer understand whether an answer refers to a declaration, a schema, selected content or an observation from a running system.

## A symbol identifies a code-level object

Imagine asking why a repository method returns an optional value. Attaching the relevant symbol points toward a declaration with a particular identity, while a pasted name can be ambiguous across modules. The chat-mode guide describes symbol mentions as a context category. This improves the precision of the request object, but it does not guarantee that every caller or implementation detail is included. The question can still require surrounding context to explain how the optional result is actually handled.

## A database object supplies a different kind of evidence

The same guide documents attaching a database object or schema in supported IDE configurations. For a query-generation task, the schema can describe table and field relationships. That is different from evidence about the current contents of the tables. A generated query can use valid names and still answer the wrong business question. Distinguish structural context from live query results when explaining what the assistant knew, rather than treating an attached schema as proof that the database operation ran.

## Keep dialect and source context connected

A SQL snippet’s meaning depends on the relevant dialect and data-source context as well as its text. The documentation describes applying database context to generated files in supported configurations. In a hypothetical reporting change, identify which schema and source the snippet is intended to use. This is an engineering continuity requirement: a correct-looking query detached from its target can be misunderstood. The attachment type helps the developer preserve that relationship while reviewing a proposed result.

## Validate the claim at the right boundary

For the optional-return method, inspect the declaration and needed call path. For the SQL task, validate the query against the intended schema and appropriate test data if execution is part of the authorized work. A context attachment itself is neither a test result nor a general execution permission. The AI Chat overview and Junie guideline documentation provide related workflow context. Keeping evidence types explicit lets the developer assess an answer without attributing hidden repository or database knowledge to the model.

## Primary sources

- [JetBrains AI chat mode](https://www.jetbrains.com/help/ai-assistant/chat-mode.html).

- [JetBrains AI Chat](https://www.jetbrains.com/help/ai-assistant/ai-chat.html).

- [Junie CLI guidelines and memory](https://junie.jetbrains.com/docs/guidelines-and-memory.html).

Related engineering context: [Choosing an AI development stack](/journal/local-ai-app-stack-selection/); [Git state and undo](/journal/aider-git-dirty-tree-undo/).
