GenAI (源内)

repository·main·Indexed 19 days ago

https://github.com/digital-go-jp/genai-web

A generative AI utilization platform developed by the Digital Agency of Japan, based on AWS Generative AI Use Cases (GenU). It provides government officials with a secure environment for task-specific AI applications, featuring team and application management, support for external microservices, and integration with the Digital Agency Design System. Version 1.3.10 includes documentation on deployment, SAML authentication, and API specifications for synchronous and asynchronous AI application development.

Tokens
46.1K
Snippets
120
Records
204
Agent score
68%

What's inside genai-web

  1. Overview of GENAI Web (AI Interface)

    main

    GENAI is a generative AI utilization platform developed by the Digital Agency of Japan. It provides a secure environment for government employees to use generative AI applications tailored to their work.

    Key features that distinguish it from the base AWS Generative AI Use Cases (GenU) include:

    • Team management
    • AI application management
    • Support for external microservices as generative AI applications
    • Integration with the Digital Agency Design System
    • Operational monitoring features
  2. Overview of GenAI (源内 Web)

    main

    GenAI (源内) is a generative AI utilization platform developed and operated by the Digital Agency of Japan. It provides an environment for government officials to use task-specific generative AI applications quickly, safely, and easily.

    It is based on the AWS open-source Generative AI Use Cases (GenU) but includes several custom features and modifications:

    • Team management functionality
    • AI application management functionality
    • Ability to add and execute generative AI applications built as external microservices
    • Application of the Digital Agency Design System
    • Accessibility testing by the internal accessibility team
    • Added operational features such as monitoring and observability
    • Significant codebase changes compared to the original GenU.
  3. Understand hot reloading behavior in local development

    main

    The local development environment handles changes differently depending on the package being modified:

    • packages/web/: Changes are reflected immediately (Hot Module Replacement/Live Reload).
    • packages/cdk/: Changes are not reflected immediately. You must perform a redeployment to apply changes made in this directory.
  4. Understand the GenAI Web architecture

    main

    GenAI Web functions as an 'AI Interface' that integrates with AI applications managed in a separate repository: genai-ai-api. The system is designed to act as the frontend/interface layer for these AI services.

    Key architectural components include:

    • GenAI Web: The AI interface layer.
    • genai-ai-api: The backend/service layer managing the AI applications.

    For detailed visual representations of the system design, you can download the source diagrams from the repository's drawio directory.

  5. Parameter precedence and security

    main

    Parameter Precedence

    • Values defined in your parameter file take precedence over values in cdk.json's context.
    • cdk.json context values serve as the default fallback.

    Security Best Practices

    Parameter files may contain sensitive information like API keys or production-specific settings.

    • Follow your organization's security policy.
    • For production secrets, consider adding files to .gitignore or using AWS Secrets Manager.
  6. Understand System Administrator vs Team Administrator roles

    main

    The system distinguishes between two types of administrators:

    • System Administrator (SystemAdminGroup): Can create teams and edit all existing teams.
    • Team Administrator (TeamAdminGroup): Assigned by a System Administrator. They can add or remove members and apps within a specific team only.

    For a detailed breakdown of permissions, refer to the Team Management Permission Table.

  7. How SAML authentication providers work

    main

    The system supports multiple SAML Identity Providers (IdPs) categorized into two types: Primary Providers and Additional Providers. The IdP used for authentication is determined by the URL path accessed by the user.

    • Primary Provider: The main authentication provider used when accessing paths that do not start with /login/ (e.g., https://xxxxxx.cloudfront.net/).
    • Additional Providers: Specific providers assigned to user groups via a unique signinPath. These are accessed via https://xxxxxx.cloudfront.net/login/{signinPath}.

    Note: If an already authenticated user accesses a login URL, they are redirected to the application home page (/) instead of being prompted for re-authentication.

  8. Understand the role and permission model

    main

    The system uses a dual-layer authorization model combining AWS Cognito groups and DynamoDB TeamUser record flags to define user permissions.

    1. Cognito Groups

    • SystemAdminGroup: Global administrators with full access to all teams and applications. Assigned manually.
    • TeamAdminGroup: Team administrators. Assigned when a team is created or a member is added with isAdmin: true.
    • UserGroup: General users. Automatically assigned upon signup.

    2. TeamUser isAdmin Flag

    In addition to Cognito groups, the TeamUser record in DynamoDB contains an isAdmin boolean flag that controls team-level administrative rights:

    • isAdmin: true: Administrator of the specific team.
    • isAdmin: false: General member of the specific team.

    3. Effective Role Combinations

    RoleCognito GroupTeamUser isAdminDescription
    System AdministratorSystemAdminGroupN/ACan perform all operations across all teams and apps.
    Team AdministratorTeamAdminGrouptrueCan perform management operations for their assigned team.
    General MemberUserGroupfalseCan only view and execute apps within their assigned team.
  9. Understand Amazon Software License (ASL) restrictions

    main

    Certain files in this repository are subject to the Amazon Software License (ASL). These files were created via the AWS Prototyping Program and cannot be used in environments outside of AWS.

    If you are running GenAI Web in a non-AWS environment, you must reimplement the functionality of the ASL-restricted files to suit your specific infrastructure. All other files in the repository are under the MIT license, allowing for modification, redistribution, and commercial use.

  10. Enable Conversation History (Pseudo-Chat)

    main

    To allow users to continue a conversation with context (enabling a "Continue conversation" button), add a conversation_history key to your request definition JSON.

    While this key does not appear as a UI input field, it is recommended to provide a title and desc for clarity. The actual method of persisting history depends on your AI application's implementation.

    {
        "question": { "type": "text", "title": "Question" },
        "conversation_history": {
            "title": "Conversation History",
            "desc": "Input past history to generate context-aware answers",
            "type": "textarea"
        }
    }