> For the complete documentation index, see [llms.txt](https://docs.neohive.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neohive.ai/get-better-results/teach.md).

# Teach your agent as you work

How to correct your agent and tell it what to remember, so the knowledge comes back in later sessions.

Without NeoHive, your agent forgets what you told it when the session ends. You then explain the same things and correct the same mistakes again. With NeoHive, you tell your agent something once, in plain words. Your agent stores it as a note, a [Memory](/reference/glossary.md#memory) in your [Hive](/reference/glossary.md#hive). Every teammate's agent then gets the Memory back in later sessions, whichever tool they use.

How you word a note decides whether recall finds the note later. The following diagram shows one correction reaching a teammate:

<figure><img src="https://3192197639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4OPHduIiSuhnAhSI2yPb%2Fuploads%2Fgit-blob-70d320163a822fb69db7a59402949e29bc27bc05%2Fresults-teach.svg?alt=media" alt="You correct your agent to validate tokens in the gateway. Later, recall returns that Memory to a teammate who adds auth checks to the orders service."><figcaption></figcaption></figure>

## What to say

Tell your agent in the chat, in plain words, the way you would tell a teammate. You do not need a command, because your agent saves what you say by calling `memory_store` itself. The following table shows what to do in each case:

| When this happens                         | What to do                                                                                                                | For example                                                                                    |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Your agent gets something wrong           | Give the right answer and the reason. Your agent saves the correction as a Memory, so the mistake stops coming back.      | `No, we validate tokens in the gateway, not in each service.`                                  |
| You make a decision                       | Say what you chose and why. Your agent saves the decision, so later sessions follow the decision.                         | `Remember that we use Redis for sessions because they are short-lived and need no durability.` |
| You find a problem your team should avoid | Describe the problem and when it happens. Your agent saves the problem, so your teammates' agents avoid the same problem. | `Store this: the staging database rejects connections without TLS.`                            |

## Say it when it happens

Correct your agent while the reason is still in the conversation, because the reason is what makes the Memory useful later. The reasoning behind a choice is the first thing a team loses. Before you close a session, run the `capture-session-learnings` [skill](/reference/glossary.md#skill) to catch what you missed. The skill stores at most five Memories per run.

## Name the system, the rule, and the reason

Recall finds a Memory by the words and meaning in it, so a specific correction creates a Memory that recall can find:

| Vague (hard to recall)      | Specific (recalled reliably)                                                                                                                   |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `We fixed the bug.`         | `Retry calls to the billing API with exponential backoff from 500ms, at most 3 attempts. The provider returns 429 with no Retry-After header.` |
| `Don't use the old client.` | `Use the v2 HTTP client in lib/http for all outbound calls. The v1 client has no request timeout and hangs workers.`                           |

## Say "out of date" when a fact changes

If you state only the new fact, NeoHive keeps both the old fact and the new one, and your agent can use either. Say that the old fact is out of date, and your agent calls `memory_forget` on the old Memory and stores the new one:

```
That's out of date. We moved sessions off Redis last month. Update it.
```

Recall stops returning the old Memory.

## Where Memories go

Everything your agent stores goes into your own Hive's [Knowledge Index](/reference/glossary.md#knowledge-index), and your agents can recall it right away.

To see what your agents stored, do the following:

1. In the dashboard, open your Hive.
2. Click the **Recent learnings** tab.

The tab lists the latest Memories your agents stored in the last 7 days.

To import rules your team already keeps in `CLAUDE.md` or `AGENTS.md`, see [Import rules from CLAUDE.md and AGENTS.md](/add-your-context/migrate.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.neohive.ai/get-better-results/teach.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
