Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Backstage Plugin: LibreChat AI Chat

AI-powered chat assistant, right inside your Backstage developer portal.

Ask questions about the page you're viewing, get contextual answers, and chat with your AI agent β€” all through a floating chat bubble powered by your own LibreChat instance.

License: Apache-2.0 Node.js Backstage


Backstage LibreChat Plugin


✨ Features

Feature Description
πŸ’¬ Floating Chat Bubble Persistent AI chat overlay across all Backstage pages
πŸ“„ Page Context Awareness Automatically sends the current page title, path, and URL to the agent
⚑ Streaming Responses Real-time SSE streaming from the LibreChat Agents API
πŸ“ Markdown Rendering Full GitHub Flavored Markdown support (code blocks, tables, lists)
πŸ” Secure Backend Proxy API keys stay server-side in app-config.yaml
πŸ”‘ User API Key Override Users can provide their own API key via in-chat settings
πŸ”— Configurable Help Text Customize the Settings API-key help text, including Markdown links, via apiKeyDescription
πŸ–ΌοΈ Custom Bubble Icon Replace the default chat icon with your own local image via iconPath
βœ… API Key Validation Test your API key with a single click β€” response appears as a chat bubble
βš™οΈ Configurable Agent ID and base URL set centrally; users only manage their API key

πŸ“¦ Packages

Package Description
@nospt/backstage-plugin-librechat Frontend plugin β€” chat bubble, settings, streaming client
@nospt/backstage-plugin-librechat-backend Backend plugin β€” proxies requests to LibreChat

πŸš€ Getting Started

Installation and configuration instructions live in each plugin's README:


πŸ“„ Page Context

Every message you send includes the current Backstage page context:

  • Page title β€” e.g., "my-service β€” Backstage"
  • Page path β€” e.g., /catalog/default/component/my-service
  • Full URL β€” the complete URL of the page

This context is injected as a system message so the AI agent can provide relevant answers about the catalog entity, TechDocs page, or any other Backstage content you're viewing.

A small context bar below the chat header shows which page is currently being shared.


βš™οΈ How It Works

sequenceDiagram
    participant User
    participant Backstage
    participant Frontend Plugin
    participant Backend Plugin
    participant LibreChat

    User->>Backstage: Types message in chat bubble
    Frontend Plugin->>Backstage: Captures page context (title, path, URL)
    Frontend Plugin->>Backend Plugin: POST /api/librechat/chat (SSE stream)
    Backend Plugin->>LibreChat: POST /api/agents/v1/chat/completions
    LibreChat-->>Backend Plugin: Streamed AI response
    Backend Plugin-->>Frontend Plugin: SSE chunks
    Frontend Plugin-->>User: Renders Markdown response in real-time
Loading

πŸ› οΈ Local Development

Setup

# Install dependencies
yarn install

# Configure your LibreChat instance
# Edit app-config.yaml with your baseUrl, agentId, and optionally apiKey

# Start both frontend and backend
yarn start:dev

# Or start them separately:
yarn start           # Frontend dev server (port 3000)
yarn start:backend   # Backend dev server (port 7007)

πŸ›‘οΈ Security

Concern How it's handled
API key storage Default key in app-config.yaml (server-side, @visibility secret). User overrides stored in browser via Backstage Storage API
Backend proxy All LibreChat requests go through the backend β€” API keys never exposed to the browser
Input validation Messages validated for role, length, and format before proxying
Agent ID Sanitized with strict alphanumeric pattern; configured server-side only

Made with ❀️ by NOS Inovação

About

A Backstage Plugin to integrate Librechat πŸ“š

Topics

Resources

Code of conduct

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages