github airweave-ai/airweave v0.3.0

latest releases: v0.9.65, v0.9.64, v0.9.63...
10 months ago

This release introduces a significant architectural overhaul to implement multi-tenancy via Organizations. This was a foundational effort that refactored the entire backend stack—from the API down to the data access layer—to be organization-aware, setting the stage for advanced enterprise features.

High-Level Summary

The primary change is the shift from a single-user-centric model to a multi-tenant, organization-centric one. Nearly every part of the backend has been touched to enforce strict data isolation and access control between different organizations.

Key Architectural Changes

  1. Introduction of AuthContext: We've replaced the current_user dependency with a new AuthContext object across the application. This context object is now the single source of truth for authentication and authorization, carrying both user and organization identity, ensuring all operations are correctly scoped to a tenant.

  2. New Data Access (CRUD) Paradigm: The CRUD layer was redesigned to enforce multi-tenancy at the database level.

    • A new CRUDBaseOrganization class now serves as the foundation for all resources that belong to an organization (e.g., Collections, SourceConnections, APIKeys). It automatically handles organization scoping and access validation.
    • A CRUDPublic base class is used for system-wide resources that are not tenant-specific (e.g., EmbeddingModels, Sources).
    • This change makes our data access patterns cleaner, more secure, and less prone to cross-tenant data leaks.
  3. Auth0 Organizations Integration: A new Auth0Service has been implemented to integrate directly with the Auth0 Management API. This provides seamless, two-way synchronization of organizations and user memberships between Airweave and Auth0, automating user onboarding into their respective orgs.

Feature and Endpoint Changes

  • New Organization Management API: A full suite of POST, GET, PUT, and DELETE endpoints under /api/v1/organizations has been added. This allows for programmatic management of organizations, user roles, and invitations.
  • Endpoint Refactoring: All existing endpoints have been refactored to be organization-aware. All resources are now created, listed, and managed strictly within the organization provided by the AuthContext.
  • Removal of Chat Functionality: The /chat API endpoints and the underlying ChatService have been removed. This decision was made to sharpen our focus.

Don't miss a new airweave release

NewReleases is sending notifications on new releases.