#35 — Persistence and caching per tenant

Repo: Twill-AI/facade State: closed | Status: done Assignee: Unassigned

Created: 2024-07-08 · Updated: 2025-09-15

Description

Blocked by https://github.com/Twill-AI/facade/issues/13

For now TenantsManager class holds list of tenants (of type shared.multitenancy.context.Tenant) in memory and this information is persisted in db, but it is not enough for Facade and LlmEngine inside it. We need in:

  • shared.multitenancy.context.Tenant for Facade persistence (dashboards, LLM chat messages, user profiles, etc.)
  • PostgreSQL schema name and role name for BusinessData persistence (see #31).
  • (in future) General information about company to add into LLM prompts.

Note that we don’t support multiple users per tenant so don’t need to persist any per-user information.

In order to swiftly response on HTTP/WS requests this information should be pre-cached.

AC:

  • There is a persistence for all points above.
  • Information is loaded into memory on service startup.

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets