Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7ffd395
Add Memgraph v3.15.0 and Lab v3.15.0 release note titles
katarinasupe Oct 23, 2026
3b03691
release notes 3.15: add #5154
katarinasupe Oct 23, 2026
0f1e03f
release notes 3.15: add #5161
katarinasupe Oct 23, 2026
0ffec2f
release notes 3.15: add #5169
katarinasupe Oct 23, 2026
b05475e
release notes 3.15: add #5181
katarinasupe Oct 23, 2026
718c76d
release notes 3.15: add #5146
katarinasupe Oct 26, 2026
8254be8
release notes 3.15: add #5140
katarinasupe Oct 26, 2026
221eaa4
release notes 3.15: add #5147
katarinasupe Oct 26, 2026
3a86d05
release notes 3.15: add #4694, #5160, #5170, #5178, #5214, #5219, #52…
katarinasupe Nov 3, 2026
674279b
release notes 3.15: explain the ASYNC replica invalid state in #4694
katarinasupe Nov 3, 2026
f091372
release notes 3.15: move #5170 to breaking changes
katarinasupe Nov 3, 2026
794e3c4
release notes 3.15: add #5192
katarinasupe Nov 3, 2026
81eaf07
release notes 3.15: add #5299
katarinasupe Nov 3, 2026
708066d
release notes 3.15: apply corrections from the docs PRs for #4694, #5…
katarinasupe Nov 3, 2026
392ec56
Document ASYNC replicas caught up from durability files (#1884)
katarinasupe Nov 4, 2026
ff49ae8
Run every replication instance with the same per-database flags (#1888)
katarinasupe Nov 4, 2026
83c86bf
Document the optional bucket_owner key of cross_database.s3() (#1889)
katarinasupe Nov 4, 2026
4b12a69
release notes 3.15: add #4780, #5013, #5155, #5207, #5229, #5298, #53…
katarinasupe Nov 12, 2026
15ef6a6
release notes 3.15: #5013 as before/now/what to do; the timeout range…
katarinasupe Nov 12, 2026
08d8d9a
release notes 3.15: breaking items as Before/Now/What to do; #5170 sp…
katarinasupe Nov 12, 2026
c279277
release notes 3.15: #5160 from runs on 3.14.0 and the daily build
katarinasupe Nov 12, 2026
5363290
release notes 3.15: #5160 example says who charlie is and what ssn is
katarinasupe Nov 12, 2026
3117e6b
release notes 3.15: remove #5013, #5160, #5170 and #5178 until their …
katarinasupe Nov 12, 2026
1b7da8c
release notes 3.15: shorter items that link the docs for details
katarinasupe Nov 12, 2026
34fdaca
release notes 3.15: keep the same-flags requirement (#5192) and the z…
katarinasupe Nov 12, 2026
7608f40
fix(auth): treat {*} as its own property entry in GRANT, DENY, and RE…
katarinasupe Nov 13, 2026
58c5e04
feat(auth): accept DENY DATABASE ... TO and deprecate FROM (#1887)
katarinasupe Nov 13, 2026
57762bb
release notes 3.15: #5195 and #5343
katarinasupe Nov 13, 2026
b4e5f37
release notes 3.15: #5160 and #5178 from their docs PRs
katarinasupe Nov 13, 2026
2d337e8
feat(auth): Add the memgraph_internal system user (#1886)
katarinasupe Nov 13, 2026
4bf6a7a
release notes 3.15: #5170 from its docs PR
katarinasupe Nov 13, 2026
3f20a8a
feat: order KSHORTEST paths by a user-supplied weight lambda (#1917)
katarinasupe Nov 16, 2026
270897e
release notes 3.15: #4860, #4861, #5116, #5121 and #5159 from their d…
katarinasupe Nov 16, 2026
a86b08b
fix(license): say why the licence is invalid, and log losing it as an…
colinbarry Nov 16, 2026
8d8840c
release notes 3.15: #5194 from its docs PR
katarinasupe Nov 16, 2026
7619802
release notes 3.15: #5368
katarinasupe Nov 16, 2026
e98385c
release notes 3.15: #5372
katarinasupe Nov 17, 2026
cc6f312
release notes 3.15: #5187, #5406, #5413, #5414, #5415
katarinasupe Nov 20, 2026
8563376
fix(storage): Keep TTL's run state across restarts and failovers (#1908)
colinbarry Nov 20, 2026
5f7dac4
release notes 3.15: #5073 from its docs PR, #5205, #5231, #5248, #530…
katarinasupe Nov 20, 2026
32fcabc
release notes 3.15: release date is December 9th
katarinasupe Nov 23, 2026
a0b2f76
Stop persisting run-time settings except the license and AWS settings…
katarinasupe Nov 23, 2026
d570dd3
release notes 3.15: #5013 from its docs PR
katarinasupe Nov 23, 2026
8b5ac9d
Name the flag for each runtime setting (#1946)
katarinasupe Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/advanced-algorithms/available-algorithms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ library](/advanced-algorithms/install-mage).
| [Breadth-first search](/advanced-algorithms/deep-path-traversal#breadth-first-search) | C++ | An algorithm for traversing through a graph starting based on nodes' breadth (distance from the source node). |
| [Weighted shortest path](/advanced-algorithms/deep-path-traversal#weighted-shortest-path) | C++ | The weighted shortest path problem is the problem of finding a path between two nodes in a graph such that the sum of the weights of relationships connecting nodes, or the sum of the weight of some node property on the path, is minimized. |
| [All shortest paths](/advanced-algorithms/deep-path-traversal#all-shortest-paths) | C++ | Finding all shortest paths is an expansion of the weighted shortest paths problem. The goal of finding the shortest path is obtaining any minimum sum of weights on the path from one node to the other. |
| [K shortest paths](/advanced-algorithms/deep-path-traversal#k-shortest-paths) | C++ | Returning K shortest paths between 2 nodes in order of shortest to longest paths. |
| [K shortest paths](/advanced-algorithms/deep-path-traversal#k-shortest-paths) | C++ | Returning K shortest paths between 2 nodes, ordered by the number of hops or by total weight. |

## Traditional graph algorithms

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,19 @@ Read a CSV file directly from AWS S3 and stream its rows into Memgraph.
{<h4 className="custom-header"> Input: </h4>}

- `file_path: str` ➡ S3 path in the form `s3://bucket-name/path/to/file.csv`.
- `config: mgp.Map` ➡ AWS credentials; all keys optional. Missing keys fall back to the corresponding
environment variables:
- `config: mgp.Map` ➡ AWS credentials and the bucket owner check; all keys optional. Missing
credentials fall back to the corresponding environment variables:
- `aws_access_key_id` (env: `AWS_ACCESS_KEY_ID`)
- `aws_secret_access_key` (env: `AWS_SECRET_ACCESS_KEY`)
- `region_name` (env: `AWS_REGION`)
- `aws_session_token` (env: `AWS_SESSION_TOKEN`)
- `config_path: str` (optional) ➡ Path to a JSON file with AWS credentials.
- `bucket_owner` (no environment variable) ➡ The 12-digit AWS account ID that must own the
bucket. If another account owns it, S3 refuses the read and the procedure fails. Pass it as a
string, such as `'012345678901'`, so leading zeros are kept. A value that isn't 12 digits fails
with `Invalid 'bucket_owner'. Expected a 12-digit AWS account ID.` Without `bucket_owner`, the
bucket's owner isn't checked.
- `config_path: str` (optional) ➡ Path to a JSON file with the same keys as `config`. Its values
override those in `config`.

{<h4 className="custom-header"> Output: </h4>}

Expand All @@ -379,6 +385,16 @@ YIELD row
CREATE (e:Employee {id: row.id, name: row.name, position: row.position});
```

To read the file only if the bucket belongs to a given AWS account, add `bucket_owner`. Here the
credentials come from the environment variables:

```cypher
CALL cross_database.s3('s3://my-bucket/employees.csv', {region_name: 'eu-central-1',
bucket_owner: '123456789012'})
YIELD row
CREATE (e:Employee {id: row.id, name: row.name, position: row.position});
```

---

### `arrow_flight()`
Expand Down
232 changes: 212 additions & 20 deletions pages/advanced-algorithms/deep-path-traversal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,9 @@ was reached.

## K shortest paths

The K shortest paths algorithm finds K shortest paths between two nodes in order
of increasing length. This algorithm is useful when you need to find alternative
The K shortest paths algorithm finds K shortest paths between two nodes, ordered
by the number of hops or, with a [weight lambda](#order-paths-by-weight), by
total weight. This algorithm is useful when you need to find alternative
routes or analyze path diversity in a graph.

### Syntax
Expand Down Expand Up @@ -852,6 +853,21 @@ so guard an optional property with `coalesce` as above - a `null` limit raises a
error. A limit of `0` returns no paths for that pair without searching, and a
negative limit raises an error.

Every part after `*KSHORTEST` is optional, and the parts come in this order:

```plaintext
*KSHORTEST [MIN_HOPS..MAX_HOPS] [|K] [(r, n | WEIGHT) [TOTAL_WEIGHT] [(r, n | FILTER)]]
```

- `MIN_HOPS..MAX_HOPS`: the range of path lengths, in hops. Either end can be
left out.
- `|K`: the maximum number of paths for each source-target pair.
- `(r, n | WEIGHT)`: the weight lambda, which [orders the paths by
weight](#order-paths-by-weight).
- `TOTAL_WEIGHT`: a variable that holds each path's total weight.
- `(r, n | FILTER)`: the filter lambda, which decides which relationships and
nodes the search can expand to. It comes after the weight lambda.

### Example


Expand Down Expand Up @@ -907,36 +923,208 @@ A negative minimum depth and a maximum depth below 1 both raise an error. A rang
whose minimum exceeds its maximum, such as `4..3`, is empty and returns no paths
without searching.

### Constraining the expansion based on property values
### Order paths by weight

To rank paths by cost instead of by the number of hops, add a weight lambda after
`*KSHORTEST`. Memgraph returns the cheapest path first, and of two paths with
the same total weight, the one with fewer hops first. Available since Memgraph
3.15.

In the weight lambda `(r, n | expression)`, `r` is a relationship and `n` is the
node it leads to, in the direction the pattern is written. A path's total
weight is the sum of the lambda over the path's relationships, so the first
node of the path adds no weight.

To return the total weight, add a variable after the lambda. The following
dataset is the one from the [example](#example), with a `weight` property on
each relationship:

```cypher
MATCH (n) DETACH DELETE n;
CREATE (n1:Node {name: "A"}), (n2:Node {name: "B"}), (n3:Node {name: "C"}), (n4:Node {name: "D"}), (n5:Node {name: "E"}),
(n1)-[:ConnectedTo {weight: 1}]->(n2), (n1)-[:ConnectedTo {weight: 10}]->(n3), (n2)-[:ConnectedTo {weight: 2}]->(n3),
(n2)-[:ConnectedTo {weight: 1}]->(n4), (n4)-[:ConnectedTo {weight: 1}]->(n3), (n3)-[:ConnectedTo {weight: 1}]->(n5);
```

The following query returns the paths from `A` to `E` ordered by the sum of
their `weight` properties:

```cypher
MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
WITH a, e
MATCH path=(a)-[*KSHORTEST (r, n | r.weight) total_weight]->(e)
RETURN [x IN nodes(path) | x.name] AS nodes, total_weight;
```

```plaintext copy=false
+---------------------------+---------------------------+
| nodes | total_weight |
+---------------------------+---------------------------+
| ["A", "B", "C", "E"] | 4 |
| ["A", "B", "D", "C", "E"] | 4 |
| ["A", "C", "E"] | 11 |
+---------------------------+---------------------------+
```

The path through `C` alone has the fewest hops, but it costs 11, so it comes
last. The other two paths both cost 4, and the one with fewer hops comes first.

The weight lambda works with the path limit and the length range. A maximum
length leaves out longer paths even when they're cheaper:

```cypher
MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
WITH a, e
MATCH path=(a)-[*KSHORTEST ..3 (r, n | r.weight) total_weight]->(e)
RETURN [x IN nodes(path) | x.name] AS nodes, total_weight;
```

```plaintext copy=false
+----------------------+----------------------+
| nodes | total_weight |
+----------------------+----------------------+
| ["A", "B", "C", "E"] | 4 |
| ["A", "C", "E"] | 11 |
+----------------------+----------------------+
```

Each weight must be a non-negative number or a
[duration](/fundamentals/data-types#duration), and all weights in a search must
be of the same kind. Otherwise, the query fails:

- **Negative weight**, such as `-1`: `Weight must be non-negative, got -1.`
- **`null` weight**, for example from a missing property: the error starts with
`The weight lambda of a KSHORTEST path expansion must not evaluate to null.`
- **`NaN` weight:** `The weight lambda of a KSHORTEST path expansion must not
evaluate to NaN.`
- **Boolean weight:** see the breaking change in the next section.
- **Any other type**, such as a string: `Weight must be numeric or a Duration,
got string.`
- **Numbers and durations mixed:** the error starts with `All weights should be
of the same type, either numeric or a Duration.`
- **Integer total weight above the 64-bit maximum:** `The total weight of a
KSHORTEST path overflows a 64-bit integer.`

Before the search, Memgraph evaluates the weight lambda on every relationship
that leads to the target node, directly or through other nodes and allowed by
the pattern's relationship types, direction and filter. That includes
relationships that no path from the source uses.

One such relationship without a valid weight makes the query fail. Give those
relationships a default with the `coalesce()` function, or leave them out with
a filter lambda, described in the next section:

```cypher
MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
WITH a, e
MATCH path=(a)-[*KSHORTEST (r, n | coalesce(r.weight, 1)) total_weight]->(e)
RETURN [x IN nodes(path) | x.name] AS nodes, total_weight;
```

```plaintext copy=false
+---------------------------+---------------------------+
| nodes | total_weight |
+---------------------------+---------------------------+
| ["A", "B", "C", "E"] | 4 |
| ["A", "B", "D", "C", "E"] | 4 |
| ["A", "C", "E"] | 11 |
+---------------------------+---------------------------+
```

For the same reason, a weighted search does more work than a hop-count search,
in proportion to the part of the graph that can reach the target.

A literal or parameter weight, such as `(r, n | 1)` or `(r, n | $cost)`, orders
paths by the number of hops, as `*KSHORTEST` without a lambda does, and runs
the same hop-count search. The total weight is then the constant multiplied by
the number of hops.

### Constraining the expansion based on property values [#k-shortest-paths-filter]

K shortest paths expansion allows an arbitrary expression filter that determines
if an expansion is allowed over a certain relationship to a certain node. The
filter is defined as a lambda function over `r` and `n`, which denotes the
relationship expanded over and the node expanded to. The paths returned are the
K shortest paths of the subgraph the filter leaves behind.
filter is a second lambda over `r` and `n`, which denote the relationship
expanded over and the node expanded to.

The filter comes after the [weight lambda](#order-paths-by-weight) and the
optional total weight variable. The paths returned are the K shortest paths of
the subgraph the filter leaves behind.

Using the dataset above, the following example allows expansion only to nodes
other than `B`, which leaves a single path from `A` to `E`:
To filter without weighting the paths, use the constant weight `(r, n | 1)`,
which keeps the hop-count order. Using the dataset above, the following example
allows expansion only to nodes other than `B`, which leaves a single path from
`A` to `E`:

```cypher
MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
WITH a, e
MATCH path=(a)-[*KSHORTEST (r, n | n.name <> "B")]->(e)
MATCH path=(a)-[*KSHORTEST (r, n | 1) (r, n | n.name <> "B")]->(e)
RETURN path;
```

```plaintext copy=false
+----------------------------------------------------------------------------------------------------------------------+
| path |
+----------------------------------------------------------------------------------------------------------------------+
| (:Node {name: "A"})-[:ConnectedTo {weight: 10}]->(:Node {name: "C"})-[:ConnectedTo {weight: 1}]->(:Node {name: "E"}) |
+----------------------------------------------------------------------------------------------------------------------+
```

<Callout type="warning">
**Breaking change in Memgraph 3.15**: a single lambda after `*KSHORTEST` is now
the weight lambda, not the filter. Rewrite a filter `(r, n | <filter>)` from
Memgraph 3.13 or 3.14 as `(r, n | 1) (r, n | <filter>)`.
</Callout>

A filter in the old form raises an error instead of returning different paths:

- **A comparison or other boolean expression**, such as
`(r, n | n.name <> "B")`: fails when the query is parsed.
- **A lambda that returns a boolean or `null` at run time**, such as
`(r, n | r.active)`: fails when the query runs.

Both errors include the hint `KSHORTEST takes the weight lambda first. To
filter without a weight, write (e, n | 1) (e, n | <filter>).`

The filter can be combined with the path limit and the length constraints:

```cypher
MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
WITH a, e
MATCH path=(a)-[*KSHORTEST 2..4 |3 (r, n | n.name <> "D")]->(e)
MATCH path=(a)-[*KSHORTEST 2..4 |3 (r, n | 1) (r, n | n.name <> "D")]->(e)
RETURN path;
```

Unlike the other deep path traversal algorithms, K shortest paths does not
support the three-argument `(r, n, p | ...)` form that exposes the already
collected path. Using it raises an error.
```plaintext copy=false
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| path |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| (:Node {name: "A"})-[:ConnectedTo {weight: 10}]->(:Node {name: "C"})-[:ConnectedTo {weight: 1}]->(:Node {name: "E"}) |
| (:Node {name: "A"})-[:ConnectedTo {weight: 1}]->(:Node {name: "B"})-[:ConnectedTo {weight: 2}]->(:Node {name: "C"})-[:ConnectedTo {weight: 1}]->(:Node {name: "E"}) |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```

To filter and order by weight at the same time, put the weight lambda and the
total weight variable before the filter:

```cypher
MATCH (a:Node {name: "A"}), (e:Node {name: "E"})
WITH a, e
MATCH path=(a)-[*KSHORTEST (r, n | r.weight) total_weight (r, n | n.name <> "D")]->(e)
RETURN [x IN nodes(path) | x.name] AS nodes, total_weight;
```

```plaintext copy=false
+----------------------+----------------------+
| nodes | total_weight |
+----------------------+----------------------+
| ["A", "B", "C", "E"] | 4 |
| ["A", "C", "E"] | 11 |
+----------------------+----------------------+
```

Neither lambda takes the accumulated path: the `(r, n, p | ...)` and
`(r, n, p, w | ...)` forms raise an error.

### When to use K shortest paths?

Expand All @@ -949,19 +1137,23 @@ Use the K shortest paths algorithm when you need to:
### Interaction with other systems

- **Fine-grained access control**: Supports enterprise access control features
- **Hops limit**: Supports query level hops limit
- **Hops limit**: Supports query level hops limit. If the limit runs out during
the search for a source-target pair and [partial
results](#controlling-partial-results) are on (the default), that pair
returns only the paths the search has proven to be its shortest (or
cheapest, with a weight lambda), in order. That can be fewer than `K` paths,
or none. A weighted search uses more of the limit, because it also reads the
relationships that lead to the target

### Important limitations

- **Predefined nodes**: Both source and target nodes must be matched first using
a `WITH` clause
- **Unweighted**: Paths are ordered by the number of hops. Relationship
properties are never treated as weights, and no weight lambda is accepted
- **No accumulated path in the filter lambda**: the two-argument
`(r, n | ...)` filter is supported, the three-argument `(r, n, p | ...)` form
is not
- **No accumulated path or weight in the lambdas**: the weight and filter
lambdas take `(r, n | ...)`; the `(r, n, p | ...)` and `(r, n, p, w | ...)`
forms raise an error
- **Filter results**: the filter must evaluate to a boolean or `null`. `null`
prunes the expansion, as `false` does; any other type raises an error


<CommunityLinks/>
<CommunityLinks/>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ associated with a user and Memgraph matches these to existing roles.
As of v3.5, Memgraph supports assigning **multiple roles per user**, meaning an
external auth module can return a single role or a list of roles.

The name `memgraph_internal` is reserved for the [internal system
user](/database-management/authentication-and-authorization/users#internal-system-user).
If a module returns it as the username or as one of the roles, in any letter
case, Memgraph refuses the login and logs a warning, on data instances and
coordinators alike, whether or not `--system-user-internal-hash-file` is set.
Before Memgraph 3.15, the name wasn't reserved.

Memgraph also checks the name at startup. If a user or role named
`memgraph_internal`, created before Memgraph 3.15, exists and
`--system-user-internal-hash-file` is set, Memgraph refuses to start. If the
flag isn't set, Memgraph starts and logs a warning. Rename the user or role as
described in the [3.15 upgrade
guide](/database-management/upgrades/specific-versions#v315---reserved-memgraph_internal-name).


### Configuration flags

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ if the user also has access to the database.
In Memgraph Enterprise, both users and roles can have database access
permissions:

```cypher
```cypher template
// Grant database access to a role
GRANT DATABASE db_name TO user_or_role;

// Deny database access
DENY DATABASE db_name FROM user_or_role;
DENY DATABASE db_name TO user_or_role;

// Revoke database access
REVOKE DATABASE db_name FROM user_or_role;
Expand Down Expand Up @@ -94,7 +94,7 @@ When roles have conflicting database access, deny takes precedence:
GRANT DATABASE db1 TO role1;

// Role2 denies access to db1
DENY DATABASE db1 FROM role2;
DENY DATABASE db1 TO role2;

// User with both roles
SET ROLE FOR user TO role1, role2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Memgraph's privilege system controls access to various database operations throu
| `SHOW ROLE FOR USER` | `AUTH` | |
| `SHOW USERS FOR ROLE` | `AUTH` | |
| `GRANT DATABASE TO USER` | `AUTH` | |
| `DENY DATABASE FROM USER` | `AUTH` | |
| `DENY DATABASE TO USER` | `AUTH` | |
| `REVOKE DATABASE FROM USER` | `AUTH` | |
| `SHOW DATABASE PRIVILEGES` | `AUTH` | |
| `SET MAIN DATABASE` | `AUTH` | |
Expand Down
Loading