24 stable releases (4 major)

new 4.2.0 Apr 14, 2026
4.0.1 Feb 18, 2025
4.0.0 Jun 7, 2024
3.0.0 Apr 21, 2023
0.1.0 Aug 22, 2019

#334 in Database interfaces

Download history 75/week @ 2025-12-27 230/week @ 2026-01-03 293/week @ 2026-01-10 333/week @ 2026-01-17 176/week @ 2026-01-24 354/week @ 2026-01-31 468/week @ 2026-02-07 403/week @ 2026-02-14 258/week @ 2026-02-21 384/week @ 2026-02-28 160/week @ 2026-03-07 344/week @ 2026-03-14 894/week @ 2026-03-21 2769/week @ 2026-03-28 2777/week @ 2026-04-04 2723/week @ 2026-04-11

9,323 downloads per month

Apache-2.0

725KB
4.5K SLoC

Build Status Crates.io Documentation #seshat

Seshat

Seshat is a database and indexer for Matrix events.

Its main use is to be used as a full text search backend for Matrix clients.

JavaScript bindings

Seshat provides JavaScript bindings which can be found in the seshat-node subdir.

Usage

There are two modes of operation for Seshat, adding live events as they come in:

use seshat::{Database, Event, Profile};
use tempfile::tempdir;

let tmpdir = tempdir().unwrap();
let mut db = Database::new(tmpdir.path()).unwrap();

/// Method to call for every live event that gets received during a sync.
fn add_live_event(event: Event, profile: Profile, database: &Database) {
    database.add_event(event, profile);
}
/// Method to call on every successful sync after live events were added.
fn on_sync(database: &mut Database) {
    database.commit().unwrap();
}

The other mode is to add events from the room history using the /room/{room_id}/messages Matrix API endpoint. This method supports storing checkpoints which remember the arguments to continue fetching events from the /room/{room_id}/messages API:

database.add_historic_events(events, old_checkpoint, new_checkpoint)?;

Once events have been added a search can be done:

let result = database.search("test", &SearchConfig::new()).unwrap();

Development

Seshat uses standard cargo commands build and test.

You can install pre-commit and then pre-commit install to ensure your work is linted on commit.

Dependencies

~52MB
~1M SLoC