> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-codex-docs-audit-20260719-0149.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Grounding research

> Ground every agent in a mandate, a research library, and prior work, so conclusions are defensible.

Ungrounded research is confident and wrong. A research agent needs to know the rules it operates under, the body of knowledge it can draw on, and what was decided before. Agno layers these so each agent carries the right context without carrying everything.

| Layer            | Holds                                                  | Mechanism                         |
| ---------------- | ------------------------------------------------------ | --------------------------------- |
| Static context   | The mandate, policy, and process shared across queries | Injected into every system prompt |
| Research library | Company profiles, sector analyses, source documents    | RAG over a vector database        |
| Prior work       | Past decisions and memos                               | File navigation tools             |

## Layer 1: static context in the prompt

Rules that apply to every question belong in the prompt, not in retrieval. Load them once and inject them into every agent.

```python theme={null}
from pathlib import Path

CONTEXT_DIR = Path(__file__).parent / "context"


def load_context() -> str:
    sections = [f.read_text() for f in sorted(CONTEXT_DIR.glob("*.md"))]
    return "\n\n---\n\n".join(sections)


COMMITTEE_CONTEXT = load_context()

instructions = f"""\
You are the Risk Officer on a $10M investment team.

## Committee Rules (ALWAYS FOLLOW)

{COMMITTEE_CONTEXT}

## Your Role
Enforce position limits and sector caps on every recommendation.
"""
```

Mandate, risk policy, and process are markdown files. The loader places the same text in each agent's instructions. Model instructions guide behavior; enforce position limits and other hard policy in code or tool permissions.

## Layer 2: the research library in RAG

The corpus the agents reason over goes in a shared knowledge base, searched per query. Reuse one configured instance when agents share the same corpus.

```python theme={null}
from agno.agent import Agent
from agno.models.openai import OpenAIResponses

# Shared instance, imported from a settings module
from agents.settings import team_knowledge

analyst = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    knowledge=team_knowledge,
    search_knowledge=True,
    instructions="Search the research library before forming a view. Cite what you used.",
)

reply = analyst.run("What does our research say about semiconductor supply?").content
# The instruction tells the analyst to search and cite retrieved material.
```

`search_knowledge` is on by default. The agent pulls the relevant profiles and analyses per question instead of carrying the whole library in context.

## Layer 3: prior work on disk

Keep complete past memos as files when a reviewer needs the original reasoning trail. Give the reading agent file tools scoped to that archive.

```python theme={null}
from pathlib import Path

from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.file import FileTools

memos_dir = Path(__file__).parent / "memos"

archivist = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    tools=[
        FileTools(
            base_dir=memos_dir,
            enable_save_file=False,
            enable_replace_file_chunk=False,
        )
    ],
    instructions="Check prior memos before drawing new conclusions.",
)
```

The agent that writes new memos gets write access; this one only receives read and search tools. Keep sensitive files outside `memos_dir` because every file under the tool's base directory may be readable.

## Why three layers, not one

| Without     | You would lose                                 |
| ----------- | ---------------------------------------------- |
| The prompt  | Instructions and context shared across queries |
| RAG         | A corpus too large to inline                   |
| The archive | The reasoning trail behind past decisions      |

Each layer answers a different question: what are the rules, what do we know, what did we decide.

## Next steps

| Task                            | Guide                                                                     |
| ------------------------------- | ------------------------------------------------------------------------- |
| Make grounded research compound | [Institutional learning](/use-cases/deep-research/institutional-learning) |
| End in an auditable artifact    | [Structured deliverable](/use-cases/deep-research/structured-deliverable) |

## Developer Resources

* [Knowledge](/knowledge/overview)
* [Context engineering](/context/overview)
