> 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-started/first-session.md).

# Your first session

Ask your agent about your code, teach the agent one thing, and see the agent recall that note in the next session.

Three prompts are enough to see what NeoHive changes. Your agent answers a question from your own code and saves a convention you teach it. In a new session, the agent then uses that convention without you repeating it. The following diagram shows the three prompts across two sessions:

<figure><img src="https://3192197639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4OPHduIiSuhnAhSI2yPb%2Fuploads%2Fgit-blob-210d2da418022975266134c3bd0a00f92ea5b311%2Fget-started-first-session.svg?alt=media" alt="A timeline of two sessions. Session 1 calls memory_recall and memory_store. In session 2, memory_context brings the convention back."><figcaption></figcaption></figure>

Before you start, you need an agent connected to a [Hive](/reference/glossary.md#hive). The Hive also needs a [Code Index](/reference/glossary.md#code-index) whose first sync has finished. For more information about connecting an agent, see [Connect your agent](/get-started/connect.md).

{% stepper %}
{% step %}

## Ask about your code

Ask your agent a question that only your repository can answer:

```
Where do we handle payment retries?
```

Your agent calls `memory_recall` and answers from the indexed code, with real file paths. You don't paste files into the chat.
{% endstep %}

{% step %}

## Teach your agent one thing

Tell your agent a convention that it can't work out from the code:

```
Remember that we always use snake_case for database column names.
```

The agent calls `memory_store`, which saves the convention as a [Memory](/reference/glossary.md#memory) in the Hive's [Knowledge Index](/reference/glossary.md#knowledge-index).
{% endstep %}

{% step %}

## See the convention come back

Close the session and start a new one. Ask for work that the convention applies to:

```
Add a table for customer invoices.
```

Your agent calls `memory_context` or `memory_recall`, gets the convention back, and uses snake\_case without you asking. If your agent has a NeoHive plugin and you ran its setup, the agent loads relevant Memories at the start of the task on its own.
{% endstep %}
{% endstepper %}

The Memory belongs to the Hive, not to your agent. A teammate who connects Cursor or Codex to the same Hive gets the same convention back.

{% hint style="info" %}
If the agent answers without calling a NeoHive tool, send the agent the following prompt:

```
Check NeoHive before answering.
```

To make the agent check NeoHive by default, add the rules from [Tell your agent to use NeoHive](/get-started/connect.md#tell-your-agent-to-use-neohive).
{% endhint %}


---

# 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-started/first-session.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.
