> For the complete documentation index, see [llms.txt](https://thecontentforge.gitbook.io/thecontentforge-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thecontentforge.gitbook.io/thecontentforge-docs/feature-guides/knowledge-base.md).

# Knowledge Base

The Knowledge Base ingests your product documentation - a GitBook, a sitemap, a set of page URLs, a PDF, or Markdown - and makes it available inside TheContentForge in three ways: an **in-app reader** for browsing the docs page-by-page, **Ask your Knowledge Base** for natural-language answers grounded in those docs, and as the **highest-priority context source** when you generate content in [Content Forge](/thecontentforge-docs/feature-guides/content-studio.md).

The idea is simple: once your own docs are in the Knowledge Base, every post you generate can cite your real features, positioning, and claims instead of relying on a loose prompt.

### Who can use it

* **Reading** - everyone. The **Knowledge Base** appears in the sidebar for all org members and opens the in-app reader.
* **Adding and configuring sources** - Editor and Admin only, under **Ingestion → Knowledge Base**. If nothing has been ingested yet, the reader shows an empty state pointing editors there.

### Reading the docs in-app

Open **Knowledge Base** from the sidebar to read any ingested source page-by-page:

* **Source selector** - switch between ingested sources (e.g. different docs sites) from the dropdown at the top of the left panel. Sources appear here once they reach **Ready**, **Partial**, or **Embedding**.
* **Page list** - the table of contents for the selected source, in document order. Use **Filter pages…** to jump to a page by title.
* **Reading pane** - the selected page rendered as clean Markdown. Decorative GitBook card/table HTML is stripped for readability. If the page came from a live URL, an external link to the original sits under the title.

### Send to Forge

The reader is wired straight into content creation:

* **Send page to Forge** - the button in the page header drops the whole page into [Content Forge](/thecontentforge-docs/feature-guides/content-studio.md) as source material for a post.
* **Send to Forge** (per section) - every section heading has its own button, so you can draft a post about one feature rather than the entire page.

Either button opens Content Forge in **Post Helper** mode with the documentation prefilled as context (targeting X, awareness goal, confident tone by default) - tweak the mode, platform, or angle from there before generating.

### Ask your Knowledge Base

Under **Ingestion → Knowledge Base**, the **Ask your Knowledge Base** box answers questions in natural language, grounded only in what you've ingested. Type a question, hit **Ask**, and you get:

* A written answer grounded in the most relevant passages of your documentation.
* A numbered **Sources** list showing, for each passage used, the source it came from, the heading path, and a link to the original page.

The Sources list doubles as a sanity check: if an answer looks thin, it tells you whether the right pages were found, which usually points to a source that needs better extraction or a higher retrieval weight (below).

### Adding a knowledge source

Go to **Ingestion → Knowledge Base → Add knowledge source** and pick a source type:

| Source type            | Use it for                                                                                                              |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **GitBook / docs URL** | A docs site root. Markdown-first ingestion is used when your site provides it (cleanest)                                |
| **Sitemap URL**        | A `sitemap.xml` when you want to drive ingestion off the sitemap directly                                               |
| **Page URLs**          | A specific list of pages, one URL per line                                                                              |
| **PDF upload**         | A PDF (text extracted on ingest); stored in your [Asset Library](/thecontentforge-docs/feature-guides/asset-library.md) |
| **Markdown upload**    | A `.md` file you already have                                                                                           |

Add an optional label, choose whether to **Sync automatically (daily)**, and click **Add + ingest**. The source then walks through these states, which you can watch live:

| Status        | Meaning                                                           |
| ------------- | ----------------------------------------------------------------- |
| **Pending**   | Queued for the worker                                             |
| **Resolving** | Working out the best way to read the source                       |
| **Parsing**   | Reading pages into documents                                      |
| **Preview**   | A parse preview and quality score are ready                       |
| **Embedding** | Being indexed so pages can be found by meaning, not just keywords |
| **Ready**     | Fully ingested and searchable                                     |
| **Partial**   | Stopped early on a limit but some content was ingested            |
| **Failed**    | Couldn't ingest - see the error on the row                        |

A progress bar and message show pages done vs detected and a rough ETA while a crawl is in flight. With **auto-sync** on, the source re-crawls once a day; unchanged pages are skipped, so a refresh that finds nothing new costs almost nothing. You can also **Refresh now** any time.

### Source settings

Expand a source (the chevron on its row) to tune how it's used:

* **Priority** - `high` / `normal` / `low`. Higher-priority sources are favoured during retrieval.
* **Enabled** - turn a source off without deleting it.
* **Include in generation** - whether this source feeds [Content Forge](/thecontentforge-docs/feature-guides/content-studio.md) context (separate from being readable/askable).
* **Retrieval weight** - a 0.1–3× multiplier to push a source up or down in results.
* **Exclude paths** - one path per line (e.g. `/archive`, `/changelog`) to skip noisy sections on re-crawl.

### Extraction quality

Each source gets an **extraction quality score** (0–100) reflecting how cleanly it parsed. The preview panel shows the ingest mode used, pages done vs detected, any warnings, and the first parsed sections so you can sanity-check what was captured. If a source scores low, the panel says so and suggests fixes: add an `llms.txt` to the docs site, upload Markdown, or ingest specific URLs instead of crawling HTML.

### AI exports (llms.txt / llms-full.txt)

After a source is ready, TheContentForge generates two LLM-friendly exports you can **download** or **copy a URL** for:

* **`llms.txt`** - a compact index of the docs.
* **`llms-full.txt`** - the full concatenated content.

Optionally upload these to your own docs root (`https://yourdocs.com/llms.txt` and `/llms-full.txt`) so external AI tools can read your docs. This is optional - retrieval inside TheContentForge uses the hosted copies and doesn't need the files on your domain. **Regenerate** rebuilds the exports and **Verify files** confirms both exist.

### How it powers generation

When **Include in generation** is on, the Knowledge Base becomes the **highest-priority context source** for [Content Forge](/thecontentforge-docs/feature-guides/content-studio.md). Generation pulls the most relevant passages for the draft at hand, respecting each source's priority and retrieval weight. In practice that means your latest, real product details show up in drafts without you pasting them in every time.

### Workflow

1. An editor or admin opens **Ingestion → Knowledge Base** and adds your docs as a source.
2. Wait for the source to reach **Ready** (a full crawl can take minutes depending on size).
3. Browse it from the **Knowledge Base** sidebar entry, or test retrieval with **Ask your Knowledge Base**.
4. Use **Send to Forge** on a page or section to draft a post grounded in that documentation.
5. Leave **auto-sync** on so the Knowledge Base tracks your docs as they change.

### Tips

* GitBook sources ingest cleanest when an `llms.txt` / `llms-full.txt` is present - TheContentForge prefers it over scraping HTML.
* Use **Ask your Knowledge Base** before a big generation push to confirm the right pages are being retrieved.
* Raise **Retrieval weight** or **Priority** on your canonical positioning docs so they win when sources overlap.
* Turn **Include in generation** off for reference material you want readable but don't want shaping every draft.
* See [Data Ingestion](/thecontentforge-docs/feature-guides/data-ingestion.md) for the analytics-export side of the Ingestion page.


---

# 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, and the optional `goal` query parameter:

```
GET https://thecontentforge.gitbook.io/thecontentforge-docs/feature-guides/knowledge-base.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
