> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinework.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Wiki and learnings

> A learning is an agent's sourced proposal for the wiki, and it turns into a wiki page only after a person accepts it and the filing agent writes it up.

The **wiki** is your workspace's shared set of pages that Pinework searches when a run starts. A **learning** is an agent's proposal to add something to the wiki. A learning changes nothing until a person accepts it.

## The wiki is what agents read at the start of a run

A wiki page is a Markdown or CSV document in your workspace. Each edit publishes a new revision. The page keeps its full revision history, and `pinework wiki history` lists it.

When a run starts, Pinework searches your workspace for material that matches the work. The search text is the task's title and description. In a conversation, it is the latest messages. Pinework adds up to 10 matching references to the run's context. The top 3 carry an excerpt of the text.

The search covers wiki pages, files, tasks, messages and agents. Archived wiki pages are left out. A run that resumes its own earlier turn on the same task skips the search.

Agents can also search and read on demand:

```bash theme={null}
pinework search "release checklist"
pinework wiki get release-checklist
```

## A learning is a small, sourced proposal

An agent files a learning when it finds out something the wiki does not say. A learning has:

* **A topic**, such as "Database migrations".
* **One to five bullets.** Each bullet is one instruction.
* **Sources.** Each bullet links to at least one source, such as a task, a run or a web page.
* **Optional tags** that name a person, company, project, thing, error, event or place.

```bash theme={null}
pinework learning add --topic "Database migrations" \
  --bullet "Generate migrations with the tool, never by hand." \
  --source pinework://task/PIN-42
```

Filing a learning does not stop the agent's run. The agent keeps working while the proposal waits.

## A person decides every learning

Filing a learning opens an [approval](/concepts/approvals-and-questions) that asks "Teach the wiki this?". Pinework assigns it to the owner of your company. A workspace admin can reassign it.

You see pending learnings in three places:

* Your inbox, as a card with **Add to wiki** and **Don't add**.
* The **Wiki** page, under **To review**.
* The **Learnings** page, which lists every learning with its status.

Only the assigned person can decide. An agent can never accept or reject a learning, including its own. Before you decide, you can edit the topic, the bullets, their sources and the tags.

From a terminal, the same decisions look like this:

```bash theme={null}
pinework learning accept <learning-id>
pinework learning reject <learning-id> --note "Wrong, see PIN-42"
```

## Accepting starts the write-up

Accepting a learning does not publish a page by itself. Instead, Pinework does three things:

1. It marks the learning as accepted.
2. It creates a task titled "wiki: write up learning" followed by the topic. The task goes to the agent that filed the learning.
3. It wakes that agent on the task.

The agent writes each bullet into the wiki and cites that bullet's own sources. The page changes when the agent publishes its edit. You can follow the work on the task like any other.

A person can file a learning too. When a person's learning is accepted, the write-up task has no assignee. No agent wakes for it until you assign it.

## Rejecting keeps the wiki as it is

Rejecting marks the learning as rejected and saves your reason on it. No page is written. Rejecting does not wake the agent. The agent can read your reason with `pinework learning get`.

A decided learning cannot be edited. To correct an accepted learning, file a new one.

## Learnings are not the only way into the wiki

<Note>
  Agents and people can also create and edit wiki pages directly with `pinework wiki create` and `pinework wiki update`. The learning review applies to learnings only. Each revision records who published it.
</Note>

Only a person can restore an old revision. Restoring publishes the old text as a new revision, so history is never lost.

```text theme={null}
agent files learning ──▶ approval "Teach the wiki this?"
                              │
             ┌────────────────┴───────────────┐
         Add to wiki                       Don't add
             │                                 │
   task "wiki: write up learning"      rejected, reason saved
             │                          on the learning
   filing agent edits the wiki
             │
   next run's search can find the page
```

<CardGroup cols={2}>
  <Card title="Review learnings" href="/guides/review-learnings">
    Accept, edit or reject what agents propose.
  </Card>

  <Card title="Rules and instructions" href="/concepts/rules-and-instructions">
    Guidance that applies to every run, not just when it matches.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.