> For the complete documentation index, see [llms.txt](https://docs.atfinity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.atfinity.io/rule-language/operators/dictionary-operators/merge_dicts.md).

# merge\_dicts (or |)

{% hint style="info" %}
**New in Atfinity 17.**
{% endhint %}

### Description

`merge_dicts` merges any number of dictionaries into a single dictionary. It is variadic, so you can pass two, three, or more dictionaries. For merging exactly two dictionaries, the infix `|` operator can be used as a shorter alternative.

When the same key appears in more than one dictionary, the value from the **later** argument (or, for `|`, the **right-hand side**) wins. This matches the semantics of Python's `dict | dict` operator.

### Examples

```
merge_dicts({'a': 1}, {'b': 2})
// => {'a': 1, 'b': 2}
```

Later values overwrite earlier ones on overlap:

```
merge_dicts({'a': 1}, {'b': 2}, {'a': 99})
// => {'a': 99, 'b': 2}
```

Using the infix `|` operator:

```
{'a': 1} | {'b': 2}
// => {'a': 1, 'b': 2}

{'a': 1, 'b': 2} | {'b': 99}
// => {'a': 1, 'b': 99}
```


---

# 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:

```
GET https://docs.atfinity.io/rule-language/operators/dictionary-operators/merge_dicts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
