# Institutional learning (/use-cases/deep-research/institutional-learning)



Use a shared learning store to carry reviewed insights from one research cycle into the next. Agno's `LearningMachine` with a global namespace makes those learnings available to every agent and team that uses the store.

These are composition examples adapted from the [Investment Team application](https://github.com/agno-agi/investment-team). Follow its [clone, database, credentials, and research-loading setup](https://github.com/agno-agi/investment-team#quick-start) for a complete application. Its [`agents/`](https://github.com/agno-agi/investment-team/tree/main/agents), [`teams/`](https://github.com/agno-agi/investment-team/tree/main/teams), and [`workflows/`](https://github.com/agno-agi/investment-team/tree/main/workflows) define the components referenced here; [`agents/settings.py`](https://github.com/agno-agi/investment-team/blob/main/agents/settings.py) supplies shared knowledge and paths.

Import those components into your application module, or define your own before composing them. The application uses Gemini; the OpenAI variants on these pages require `uv pip install "agno[openai]"` and `OPENAI_API_KEY` as well. Shared knowledge/storage still needs the application's database and embedding-provider setup. Prose context, analyst-output variables, and local archives must be supplied by your application.

```python
from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.learn import LearnedKnowledgeConfig, LearningMachine, LearningMode
from agno.models.openai import OpenAIResponses

# team_learnings is a Knowledge instance backed by a vector database, on its own
# table so learnings stay out of the research library's search results.
from agents.settings import team_learnings

db = PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai")


def institutional_learning() -> LearningMachine:
    return LearningMachine(
        knowledge=team_learnings,
        learned_knowledge=LearnedKnowledgeConfig(
            mode=LearningMode.AGENTIC,
            namespace="global",
        ),
    )


learning_instructions = (
    "Use save_learning to store reusable insights. "
    "Use search_learnings to find prior knowledge before forming a view."
)

analyst = Agent(
    name="Financial Analyst",
    model=OpenAIResponses(id="gpt-5.5"),
    db=db,
    instructions=learning_instructions,
    learning=institutional_learning(),
)

risk_officer = Agent(
    name="Risk Officer",
    model=OpenAIResponses(id="gpt-5.5"),
    db=db,
    instructions=learning_instructions,
    learning=institutional_learning(),
)

# The risk officer captures an insight:
risk_officer.print_response(
    "Save this insight: analyst estimates lag this sector by about a quarter."
)

# Later, a different agent reads it back from the shared store:
analyst.learning_machine.learned_knowledge_store.print(query="estimate lag")
```

The learning is available to every agent and team sharing the store. In Agentic mode, retrieve it with `search_learnings`. A configured `Knowledge` instance backs the store. Missing knowledge configuration causes saves and searches to log a warning; state remains unchanged.

## Per-agent vs institutional [#per-agent-vs-institutional]

|           | User memory                                                 | Institutional learning                                    |
| --------- | ----------------------------------------------------------- | --------------------------------------------------------- |
| Scope     | One user across agents sharing the database                 | Every agent and team that shares the store                |
| Namespace | Scoped by `user_id`                                         | `"global"`                                                |
| Effect    | User preferences and facts remain available across sessions | Reviewed insights remain available across research cycles |

Use institutional learning to keep reviewed team judgment available across research cycles.

## What to capture [#what-to-capture]

| Save to shared learning                          | Keep in context or source data                |
| ------------------------------------------------ | --------------------------------------------- |
| "Analyst estimates lag this sector by a quarter" | One-off query results stay with the run       |
| "This data source double-counts renewals"        | The mandate stays in static context           |
| A correction to a conclusion that was wrong      | Source summaries stay in the research library |

Capture corrections and transferable insights. Leave durable facts to the [research library](/use-cases/deep-research/grounding-research) and rules to the static context.

## Modes [#modes]

| Mode      | Behavior                                                                       | Use for                                           |
| --------- | ------------------------------------------------------------------------------ | ------------------------------------------------- |
| `ALWAYS`  | Start extraction from the current input on every run                           | Steady accumulation of observations               |
| `AGENTIC` | The agent decides what is worth keeping                                        | Research, where signal-to-noise matters           |
| `PROPOSE` | The model proposes a learning and asks before saving; approval is prompt-based | Low-risk review where soft approval is sufficient |

The [data agent self-correction pattern](/use-cases/data-agents/self-correcting-agents) uses the same machine with a per-warehouse store. This research pattern uses the shared institutional store.

## Next steps [#next-steps]

| Task                               | Guide                                                                     |
| ---------------------------------- | ------------------------------------------------------------------------- |
| Feed it grounded context too       | [Grounding research](/use-cases/deep-research/grounding-research)         |
| Audit what changed the team's mind | [Structured deliverable](/use-cases/deep-research/structured-deliverable) |

## Developer Resources [#developer-resources]

* [Learning Machines](/learning/overview)
* [Learning modes](/learning/learning-modes)
* [Learned knowledge cookbook](https://github.com/agno-agi/agno/tree/main/cookbook/08_learning/05_learned_knowledge)
