#Error: Could not open session database: no such module: fts5

1 messages · Page 1 of 1 (latest)

swift socket
#

Running uv sessions I just get no module fts5. Tried to dig a bit, turns out my system python does have sqlite with fts5 working fine, but hermes uses uv to install its own python that lacks this.

As a simple test:

import os
from glob import glob

import sqlite3
print('sqlite version', sqlite3.sqlite_version)
print('version', sqlite3.version)
print('path:', sqlite3.__file__)

# Connect to database
conn = sqlite3.connect(':memory:')
cursor = conn.cursor()

# Create an FTS5 virtual table
cursor.execute("CREATE VIRTUAL TABLE posts USING fts5(title, body);")
# Insert sample data
cursor.execute("INSERT INTO posts (title, body) VALUES ('Python Tutorial', 'Learn SQLite FTS5 in Python.')")
cursor.execute("INSERT INTO posts (title, body) VALUES ('SQL Guide', 'Basic SQL queries for beginners.')")

# Query using MATCH
term = 'Python'
cursor.execute("SELECT * FROM posts WHERE posts MATCH ?", (term,))
results = cursor.fetchall()
print("FTS5 results:", results)
$ which python3.13
/usr/bin/python3.13
$ python3.13 --version
Python 3.13.13
$ python3.13 test_script.py
sqlite version 3.45.1
version 2.6.0
path: /usr/lib/python3.13/sqlite3/__init__.py
FTS5 results: [('Python Tutorial', 'Learn SQLite FTS5 in Python.')]
$ ~/.hermes/hermes-agent/venv/bin/python test_scirpt.py
sqlite version 3.49.1
version 2.6.0
path: /home/ob/.local/share/uv/python/cpython-3.11.13-linux-x86_64-gnu/lib/python3.11/sqlite3/__init__.py
Traceback (most recent call last):
  File "/home/ob/tmp/explore_hermes_db.py", line 14, in <module>
    cursor.execute("CREATE VIRTUAL TABLE posts USING fts5(title, body);")
sqlite3.OperationalError: no such module: fts5

any advice?

#
$ uname    -a
Linux Ubuntu22 6.8.0-62-generic #65-Ubuntu SMP PREEMPT_DYNAMIC Mon May 19 17:15:03 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

version:          0.15.1 (2026.5.29) [7379f175]
os:               Linux 6.8.0-62-generic x86_64
python:           3.11.13
openai_sdk:       2.24.0
profile:          default
hermes_home:      ~/.hermes
terminal:         local

features:
toolsets:           hermes-cli
mcp_servers:        0
memory_provider:    built-in
gateway:            stopped (systemd (user))
willow lava
#

That repro points at the uv-managed Python build Hermes is using, not your system Python.

Hermes currently initializes the session database by creating SQLite FTS5 virtual tables in hermes_state.py. In your Hermes venv, Python’s bundled sqlite3 can open SQLite normally, but it cannot create USING fts5(...), so session DB startup fails with:

no such module: fts5

That means this is not fixed by installing a normal Python package into the venv. FTS5 is compiled into the SQLite library Python was built against, so uv pip install ... will not add it to stdlib sqlite3.

For now, I would not change your Python install just for this. The right Hermes-side fix is to let the session DB open without FTS5, keep normal session/message storage working, and only disable or degrade full-text session search when FTS5 is unavailable.

There is already an open PR for that direction:

https://github.com/NousResearch/hermes-agent/pull/10972

It likely needs to be refreshed against current main because the session DB code has changed since it was opened, but it matches your failure mode.

cc @raven crescent or @nova swallow (review/update?)

GitHub

Summary

keep SessionDB usable when the bundled SQLite build does not provide FTS5
disable only full-text search in that case instead of dropping the entire SQLite session store
add regression cove...

swift socket
#

Think I managed to work around it by forcing uv to use my system python:

$ uv python uninstall cpython-3.11.13-linux-x86_64-gnu # remove the 'broken' python bundled with uv
$ sudo apt-get install python3.11 # install system python, fts5 capable
$ cd ~/.hermes/hermes-agent
$ rm -r venv
$ ./setup-hermes.sh
$ ./venv/bin/python test_script.py
sqlite version 3.45.1
version 2.6.0
path: /usr/lib/python3.11/sqlite3/__init__.py
FTS5 results: [('Python Tutorial', 'Learn SQLite FTS5 in Python.')
$ hermes sessions list
No sessions found.
#

but yes, a degrade gracefully option would be nice

willow lava
#

that's a decent temp workaround, yeah. agree on the second point. leaving this thread open for the PR review.

nova swallow
#

@idle knoll 🫡

swift socket
#

A nice https://github.com/NousResearch/hermes-agent/pull/35103

Yeah this sounds plausible I have had uv for a while and probably the python3.11 was too old

Guarantee the resolved uv-managed interpreter ships FTS5. uv's Python
distributions only gained FTS5 in mid-2025 (python-build-standalone #694),
so a stale interpreter already in uv's store — which uv python find
happily reuses — can lack it.

GitHub

Summary
Hermes no longer dies with Could not open session database: no such module: fts5 on installs whose bundled SQLite lacks FTS5, and the supported installer now guarantees an FTS5-capable Pyth...

nova swallow
#

so is this resolved? @swift socket

willow lava
#

That does look like a separate fix for the same issue, as it supersedes it. Merged 2 hours ago. So I'd call this resolved.