# Lighthouse knowledge

> Give every agent your procedures. Drop in the documents your team works by, approve the rules Lighthouse finds in them, and agents follow the approved rules and can read the documents.

Source: https://docs.go-lumen.ai/ai/lighthouse

**In one sentence**: Lighthouse is your workspace's shared knowledge for agents: documents you drop into a collection are read for their rules, a person approves the rules in the Rulebook, and every approved rule is then followed by every agent in your flows, with the documents themselves available to agents that name the collection.

There are two things to keep apart.

-   **Rules** are workspace-wide. Once approved, every agent in your flows follows them, whether or not the agent names a collection, unless you [turn them off for that agent](#rules-off).
-   **Documents** go only to agents that name their collection. Such an agent can read the documents' text, marked as data.

Nothing Lumen finds in a document reaches an agent until a person approves it.

## How it works

1.  An admin creates a **collection** and drops documents into it.
2.  Lumen reads each document and drafts the rules it states, each with the quote and page it came from. The drafts wait in the workspace **Rulebook**.
3.  An admin reviews the drafts in the **Rulebook** and approves or rejects each. Rules that need extra care are flagged and must be reviewed one by one.
4.  From the next run, agents follow the approved rules and can cite their source.

> **Documents are not screened for personal data:**
> 
> The console says so when you upload. Upload only what every agent of the workspace may read.

## Add documents

## Create a collection and drop in documents

1.  Open **Lighthouse** in the console. With no collections yet, an admin sees **Start with your procedures**. Enter a **Collection name**, such as `Operations manual`, and click **Create**. Others see that an admin can create one.
2.  On the **Documents** tab, drop files into **Drop documents here, or click to choose**. Lighthouse reads PDF, Word (DOCX), Markdown and text files, up to 50 MB each. A collection holds up to 500 documents.
3.  Watch each document's **Status**: **Reading the text**, **Finding the rules**, **Ready**, or **Could not be read**. **Rules** counts what was drafted from it.
4.  Open the **Rulebook** tab to review them.

![The Documents tab of Lighthouse. Add and delete buttons sit at the top right, with tabs Documents (3), Rulebook with 19 waiting, and Try a question. A dashed drop area reads Drop documents here, or click to choose, PDF, Word (DOCX), Markdown or text, up to 50 MB each.](https://docs.go-lumen.ai/img/ai/lighthouse-01-documents.png)

*Drop a document into the collection. Below the drop area, each document lists its pages and how many rules it produced.*

Deleting a document removes its draft rules and withdraws its approved ones, so agents stop using them. Deleting a collection does the same for everything in it, and asks you to type its name.

## Approve the rules

1.  On the **Rulebook** tab, the filter starts on **To approve**. Each draft shows its id, its text, the document and page it came from, and the quote.
2.  Read it. Click the pencil to edit the text first (it stays a draft until approved), the check to **Approve**, or the cross to **Reject**.
3.  A rule with a warning icon is **flagged** and needs a look one by one. Approving a flagged rule asks you to confirm.
4.  To take unflagged drafts in one go, click **Approve all shown**. Flagged rules are never approved in bulk.

![The Rulebook tab of Lighthouse with the filter To approve (19), Approved (10), Rejected (0), Withdrawn (0) and All (29), and an Approve all shown (16) button. Two notes say Approved rules apply to every agent in this workspace, and Flagged rules need a look one by one.](https://docs.go-lumen.ai/img/ai/lighthouse-02-rulebook.png)

*The Rulebook. Drafts wait for approval; flagged rules are approved one by one.*

An approved rule can be edited (the new text applies from the next run, and who approved it stays as it was) or **Withdrawn**, after which agents stop following it. Only workspace admins approve, reject, edit or withdraw rules and upload or delete documents. Other members can read the Rulebook.

## Rules proposed from answers

Documents are not the only source. When a flow asks a person a question by email and the answers state something lasting, Lighthouse can draft that as a rule too.

An [Ask by email](https://docs.go-lumen.ai/approvals/ask-by-email.md) step reads the reply into answers. An answer marked as a lasting rule, not just an answer for this run, becomes a **draft** in the Rulebook with the source **Email reply** and the question it answered. The email the next step sends lists the proposed rules, each with a confirm link.

These rules differ from document rules in two ways:

-   They are **scoped to the flow** that asked. A confirmed rule goes only to that flow's agents, and the flow's **Rules** tab lists them. A rule from a document applies to every flow.
-   They can be confirmed from the email. The link opens a page that shows the rule and a **Confirm the rule** button; only the button press confirms, so a mail scanner opening the link changes nothing. The link is signed, names one rule and expires after 30 days. So a rule from an answer can be confirmed by whoever received that email. A workspace admin can also approve or reject the same draft in the Rulebook.

A draft from either source reaches no agent until it is approved. The same answer in a step run again drafts nothing twice.

## Give an agent the documents

Approved rules need no setup. To let an agent read a collection's documents, name it in the agent's `knowledge` setting:

```yaml title="excerpt of an agent's config"
config:
  instructions: Answer the question from the procedures. Cite the rule or page you used.
  knowledge:
    collections: [ops-bible]   # up to 8 collections of this workspace
    mode: auto                 # auto or inject
```

| Mode | What the agent gets |
| --- | --- |
| `inject` | The collection's text, page by page. |
| `auto` | The same, when the collection is small enough. A larger one is not given to the agent. |

A third mode, `retrieve`, which searches the documents instead, is planned and refused for now.

The documents reach the model as untrusted data, in marked blocks. A document cannot add tools, change the instructions or approve a rule. Approved rules are the only trusted text, because a person approved each one.

A collection is a [`KnowledgeCollection`](https://docs.go-lumen.ai/reference/resources/knowledgecollection.md) resource. The console creates it from the name; in YAML you can set the rest:

**YAML:**

```yaml title="ops-bible.yaml"
apiVersion: lumen.ai/v1alpha1
kind: KnowledgeCollection
metadata:
  name: ops-bible
  namespace: tenant-acme
spec:
  displayName: Operations manual
  mode: inject
  maxDocuments: 500
  retention: {deletedVersionsDays: 30}
```

**Console:**

Follow [Create a collection and drop in documents](#create-a-collection). The agent editor in the console does not offer a collection picker yet, so naming a collection on an agent is done in YAML.

`sensitive` is `allow` for now, because documents are not screened. `hold` and `redact` are planned and refused.

## Keep the rules away from an agent

Every agent in your flows follows the approved rules unless you turn them off for it. Turn them off for an agent that talks to customers or to people outside your team: the rules come from your own documents, which may be private, and an agent can repeat what it was given.

**YAML:**

```yaml title="excerpt of an agent's config"
config:
  knowledge:
    rules: false   # this agent is not given the workspace rules
```

`rules: false` can sit next to `collections`: the agent still reads the collections it names, and gets no rules.

**Console:**

1.  Open the agent's settings and expand **Advanced**.
2.  Under **Lighthouse**, turn off **Workspace rules**.
3.  Save. The next run of the agent gets no rules.

In a run, the step's activity lists no rules in effect for that agent.

## Check what it knows

The **Try a question** tab asks a question as a new employee would, for example "Who approves a quote over $5,000?". An agent answers with the collection in its prompt. It is charged like a normal run.

In a run, the step's activity shows **Lighthouse: N rules in effect, M cited**, the rules in effect, the documents in the prompt and the pages cited in the reply.

## Next steps

[AgentsBuild the agents that follow your rules.](https://docs.go-lumen.ai/ai/agents.md)[Ask by emailAsk a person and let their answer become a rule.](https://docs.go-lumen.ai/approvals/ask-by-email.md)[MemoryNotes one agent keeps for itself.](https://docs.go-lumen.ai/ai/memory.md)[Workspaces and accessWho is an admin.](https://docs.go-lumen.ai/concepts/workspaces-and-access.md)
