> 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/composite.md).

# Composite

The partners' entry point.

The **Composite** is the service partners call to get data about a farmer from several registries in one request. It puts together ("composes") the answer: a partner (e.g. a bank) asks for a [use case](https://docs.openg2p.org/products/open-agri-stack/architecture/use-cases.md), such as `loan-profile`, for one farmer; the Composite searches each department's registry the use case reads, with the farmer's consent, and returns the results combined into one response, signed with its own key. It runs only the use cases published in it and keeps no farmer data.

It is part of the Exchange, the install that partners onboard with: [the Composite in the architecture](https://docs.openg2p.org/products/open-agri-stack/architecture/exchange.md#the-composite). How one request travels: [request flow](https://docs.openg2p.org/products/open-agri-stack/architecture/request-flow.md).

## Key features

* **One generic service; each use case is a configuration file,** not code. Adding a use case, or a registry to one, needs no code change.
* **Never grants access.** What a partner receives is decided by the partner's use-case policy at the Exchange, each department's scope policy for the Composite, and the farmer's consent; each registry enforces it itself ([data-sharing policies](https://docs.openg2p.org/products/open-agri-stack/architecture/data-sharing-policies.md)).
* **One partner to every department.** Departments onboard only the Composite, never the banks ([Composite as a partner](https://docs.openg2p.org/products/open-agri-stack/architecture/exchange.md#composite-as-a-partner)).
* **Consent once, a token per registry.** The Composite tells the Exchange Consent Manager the use case's purpose, scopes and the partner's limits; the CM finds the partner's consent and gives each registry its own short-lived consent token. The CM knows no use cases.
* **Publishes consent templates.** Each use case granted to a partner is a consent template for the Exchange CM's partner portal, at an internal endpoint not on the public host ([consent templates](https://docs.openg2p.org/products/open-agri-stack/architecture/consent.md#consent-templates)).
* **Signed both ways.** Partner requests are verified against Partner Management; every response, errors included, is signed with the Composite's key, published at `/.well-known/jwks.json`.
* **Partial answers, reported.** Each source has a status (`ok`, `no_record`, `denied`, `unavailable`, `error`); an optional source can fail without failing the request.
* **Stores no farmer data.** Logs, audit events and the console's call log carry IDs, statuses and timings only.
* **Rate limited** per partner and use case, and optionally at the gateway ([rate limiting](https://docs.openg2p.org/products/open-agri-stack/composite/rate-limiting.md)).
* **A staff console**, read-only: the use cases, the registries and their data scopes, the partners allowed each use case, and a log of calls ([console](https://docs.openg2p.org/products/open-agri-stack/composite/console.md)).
* **A partner API** to list and describe the use cases and to query one ([Composite API Reference](https://docs.openg2p.org/products/open-agri-stack/composite/api.md)).

Installing it: [Deployment: Exchange](https://docs.openg2p.org/products/open-agri-stack/deployment/exchange.md#composite). Source: [`composite/`](https://github.com/openg2p/agri-stack/tree/develop/composite) in the agri-stack repository.

What is planned for the Composite: [Roadmap](https://docs.openg2p.org/products/open-agri-stack/roadmap.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.openg2p.org/products/open-agri-stack/composite.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.
