---
title: "Add a document to your knowledge base"
method: POST
path: "/rag/ingest"
tags: ["Knowledge"]
---

# Add a document to your knowledge base

`POST /rag/ingest`

## Request

- Base URL: `https://foresea.ink` (the document declares no server; this is the origin it was published from)
- URL: `https://foresea.ink/rag/ingest`
- Auth: none declared

Chunk, embed, and store a document (text or URL) in the signed-in user's
knowledge base, so the agent can retrieve it as evidence.

## Request body

- RagIngestRequest: Add a document to the user's knowledge base.
  - `text` string, nullable: Raw text to ingest.
  - `url` string, nullable: URL to fetch and ingest.
  - `title` string
  - `namespace` string: Corpus: 'kb', 'evidence', or 'forecasts'.

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/foresea/apis/foresea-intelligence-api.md) · [All operations](https://skmtc.dev/foresea/apis/foresea-intelligence-api/llms.txt) · [OpenAPI document](https://skmtc.dev/foresea/apis/foresea-intelligence-api/revisions/b03e49f4385d?raw)
