> For the complete documentation index, see [llms.txt](https://developers.laws.africa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.laws.africa/knowledge-bases/legislation.md).

# Legislation Knowledge Bases

Legislation Knowledge Bases retrieve relevant portions of legislation, such as chapters, sections or schedules.

Use them when your product needs current legislative context for:

* AI grounding;
* legal search;
* legal agents;
* workflow triage;
* lightweight product integrations.

## What they return

Legislation results include:

* the matched legal text in `content.text`;
* work metadata such as `title`, `work_frbr_uri`, `frbr_place` and `expression_date`;
* portion metadata such as `portion_type`, `portion_id`, `portion_title` and `portion_public_url`;
* a public URL for the source work.

In some cases, a result may represent a page of a PDF when the legislation has not yet been converted into Akoma Ntoso format.

## Recommended filters

For most legislation retrieval, use:

```json
{
  "principal": true,
  "repealed": false
}
```

Add a place filter when the user or workflow is about a specific jurisdiction:

```json
{
  "frbr_place": "za-cpt"
}
```

See [Filters](/knowledge-bases/filters.md) for details.

## Versions

Knowledge Bases focus on the latest available legislation. Use the [Content API](/content-api/content-api.md) when your product needs point-in-time versions or full local copies of legislation.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.laws.africa/knowledge-bases/legislation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
