Expand description
Reusable GPUI components for Ragrig.
ragrig-gpui packages the chat, composer, transcript, attachment, session,
agent-status and settings surfaces needed to build a RAG front end. The
crate contains no editor: hosting applications such as Sciscraper compose
these components into their own layout.
§State model
The reducers in ChatState are plain data. ChatView wraps one in an
entity, keeps one TextViewState per message for incremental Markdown, and
renders it with MessageScroller. Composer owns its input and emits
ComposerEvents; it does not know about a controller.
§Feature flags
ragrig(default): enables the Ragrig controller, full settings page, and the compositeRagChatsurface. The worker uses a dedicated Tokio runtime thread.grobid: enables GROBID/BibTeX reference ingestion throughgrobid-bibtex, the reference rows, and their hover copy actions. It impliesragrig.
Modules§
- prelude
- Common imports for hosts of
ragrig-gpui.
Structs§
- Agent
Bar - A row of pipeline components with status dots and detail popovers.
- Agent
Component - One component shown in the agent bar.
- Agent
Info - The active Ragrig agent, as reported after a successful build.
- Attachment
- One chip above the composer.
- Attachment
Rows - A wrapping row of
Attachmentchips. - Cancel
Flag - A cloneable, thread-safe cancellation flag.
- Chat
Message - A message as stored in a
ChatState. - Chat
Settings - Chat-model configuration.
- Chat
State - The transcript reducer.
- Chat
View - A streamed, Markdown transcript with metadata and source chips.
- Composer
- A reusable chat input.
- Empty
State - The empty-transcript state.
- Ingest
Progress - A readable snapshot of a running ingestion.
- Library
Document - One document in the vector store, for the library panel.
- Library
Snapshot - A snapshot of the vector store.
- Message
Id - Stable identity of one message in a
ChatState. - Message
Meta - Pipeline metadata shown in a message footer.
- NewMessage
- Input for
ChatState::pushandChatState::replace. - Pending
Attachment - One context item waiting for the next question.
- RagChat
- A complete chat surface backed by a Ragrig controller.
- RagController
- Sends commands to the Ragrig worker and mirrors its state for widgets.
- RagReply
- Metadata returned with a finished answer.
- RagSettings
- Editable configuration shown by the settings page.
- RagSetup
- Everything needed to build one
ragrig::RagAgent. - Request
Id - Identity of one request (generation or ingestion) sent to the worker.
- Sciscraper
Attach - Merge attachments and retrieved chunks into Sciscraper’s context containers.
- Session
Entry - One saved conversation.
- Session
Info - One saved conversation, before the controller formats it.
- Session
Picker - A dropdown of saved conversations.
- Session
Turn - A conversation turn loaded from the session store.
- Side
Panel - A reusable left/right dock surface.
- Source
Ref - One retrieved source shown under an assistant message.
- Sync
Summary - Result of a completed ingestion.
Enums§
- Agent
BarEvent - What the user asked the agent bar to do.
- Attachment
Event - What the user did with an attachment chip.
- Attachment
Kind - How an attachment chip behaves.
- Attachment
Source - Where an attached context item comes from.
- Chat
Provider - Chat backend offered by the settings page.
- Chat
Role - Who authored a message.
- Chat
View Event - What the user did inside the transcript.
- Component
Kind - The role a component plays in the RAG pipeline.
- Component
Status - Status of one agent component.
- Composer
Event - What the host should do after the composer was used.
- Ingest
Phase - Coarse ingestion phase, used for status text and progress emphasis.
- Memory
Choice - Memory strategy offered by the settings page.
- Message
State - Lifecycle of one message.
- PdfBackend
- PDF backend offered by the settings page.
- RagChat
Event - What the composite chat surface reports to its host.
- RagCommand
- Work sent from the UI to the Ragrig worker.
- RagEvent
- Events emitted by the worker and re-emitted by the controller.
- Session
Picker Event - What the user asked the picker to do.
Functions§
- chat_
settings - Build a complete
Settingselement for chat configuration. - chat_
settings_ page - Build the standard chat settings page.
- init
- Initializes the GPUI kit and Ragrig UI state.
- rag_
settings - Build a complete
Settingselement for Ragrig configuration. - rag_
settings_ page - Build the full Ragrig settings page.
- stabilize_
markdown - Closes a code fence left open at the end of a streaming answer.