> For the complete documentation index, see [llms.txt](https://alix-lahuec.gitbook.io/zotero-roam/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alix-lahuec.gitbook.io/zotero-roam/customization/other/autocomplete.md).

# Autocomplete

## Description

The Autocomplete feature enables you to insert references to Zotero items while you're writing in Roam. It is powered by [the tributejs library](https://github.com/zurb/tribute).

To enable Autocomplete, add a **trigger** in your user settings - the trigger is a sequence of one or more characters which, when typed in a Roam block, will cause the autocomplete menu to be shown. A common trigger is `@`.

Besides the trigger, you may customize the following:

* how items are displayed in the autocomplete menu
* how items' references are inserted into the Roam block

### Display as

```javascript
// Citekey
@someCitekey
@anotherCitekey
...

// Zettlr
Author et al. (2019) Some Paper Title
A.N. Author (2018) Some study : a paper
...
```

### Insert as

```javascript
// Citation
[Author et al. (2019)]([[@someCitekey]])

// Citekey
@someCitekey

// Citekey (raw)
someCitekey

// Page reference
[[@someCitekey]]

// Popover
{{=: Author et al. (2019) | {{embed: [[@someCitekey]]}} }}

// Tag
#[[@someCitekey]]
```

### Custom templates

For both settings, you can choose to use a custom template for rendering items.

Here are the replacements available:

* {{authors}} will insert shortened authorship information - `Author et al.`
* {{citekey}} will insert the citekey - `@someCitekey`
* {{key}} will insert the raw citekey - `someCitekey`
* {{summary}} will insert shortened publication information - `Author et al. (2019)`
* {{summary\_or\_key}} will insert the same contents as {{summary}}, or default to the item's key if information is missing
* {{title}}
* {{year}}


---

# 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://alix-lahuec.gitbook.io/zotero-roam/customization/other/autocomplete.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.
