> For the complete documentation index, see [llms.txt](https://docs.openg2p.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openg2p.org/products/open-agri-stack/registries.md).

# Registries

The department registries.

Each registry in Agri Stack belongs to a department and is its own install there. Two are integrated today; what each holds, its registers and its data scopes are documented with the product. A registry joins Agri Stack by becoming a data source of a use case ([Adding a Registry](https://docs.openg2p.org/products/open-agri-stack/registries/adding-a-registry.md)); the [Livestock Registry](https://docs.openg2p.org/products/open-agri-stack/roadmap/livestock-registry.md) is designed as the next one.

| Registry                                                                               | Department (example) | Holds                                                   |
| -------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------- |
| [Farmer Registry](https://docs.openg2p.org/products/registry/farmer-registry.md)       | Agriculture          | Farmers, their land, households and declared main crops |
| [Crop Sown Registry](https://docs.openg2p.org/products/registry/crop-sown-registry.md) | Crops                | Crop seasons, plot by plot and season by season         |

**One registry per fact.** Crop seasons are held only in the Crop Sown Registry, land in the Farmer Registry (until a land administration registry exists), and livestock moves to the Livestock Registry once it is built. Two registries holding the same fact would disagree, and count it twice.

## Each registry is sovereign

* **Its own install.** Each department runs its registry with its own Partner Management, Consent Manager and data. Registries share identifiers, never code or databases: neither looks anything up in the other.
* **It sees only the Composite.** No bank or other partner calls it through Agri Stack; the partner's ID comes with each request and is logged ([Composite as a partner](https://docs.openg2p.org/products/open-agri-stack/architecture/exchange.md#composite-as-a-partner)).
* **It decides what leaves it.** The department sets what its registry releases to the Composite, in its own Partner Management, and its Consent Manager applies it to every request ([Data-Sharing Policies](https://docs.openg2p.org/products/open-agri-stack/architecture/data-sharing-policies.md#what-actually-gets-released), [Releasing Registry Data to the Composite](https://docs.openg2p.org/products/open-agri-stack/administration/releasing-data-to-the-composite.md)).

## Farmer ID across registries

The **Farmer ID**, issued by the Farmer Registry, identifies the farmer across Agri Stack: every registry keys its records on it. The national ID is used only to authenticate the farmer, and registries keep it beside the Farmer ID so that a consent, given after that login, can be checked.

| Identifier                              | Farmer Registry                         | Crop Sown Registry                              |
| --------------------------------------- | --------------------------------------- | ----------------------------------------------- |
| Farmer ID (`FARMER_ID`, e.g. `FR-0007`) | Issued here: the farmer's functional ID | The subject of each activity                    |
| National ID (`FAYDA_FAN`)               | The farmer's foundational ID            | Recorded on each activity, beside the Farmer ID |

* A partner names the farmer by the Farmer ID, or by the national ID if that is all it has: the Composite then reads the Farmer ID from the Farmer Registry and searches the Crop Sown Registry with it ([request flow](https://docs.openg2p.org/products/open-agri-stack/architecture/request-flow.md)).
* **One consent covers both.** The consent records the national ID the farmer logged in with; the Crop Sown Registry accepts a search by Farmer ID because its own records link that Farmer ID to that national ID ([how the Crop Sown Registry relates to the Farmer Registry](https://docs.openg2p.org/products/registry/crop-sown-registry.md#how-it-relates-to-the-farmer-registry)).
* Each registry returns only the consent's farmer's records, so a wrong ID finds no data, never another farmer's ([consent](https://docs.openg2p.org/products/open-agri-stack/architecture/consent.md#key-features)).

What the `loan-profile` use case reads from each registry: [the `loan-profile` use case](https://docs.openg2p.org/products/open-agri-stack/composite/use-case-configuration.md#the-loan-profile-use-case).


---

# 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.openg2p.org/products/open-agri-stack/registries.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.
