diff --git a/src/LibraryManager.jsx b/src/LibraryManager.jsx
index 693eaa2..dfca0cf 100644
--- a/src/LibraryManager.jsx
+++ b/src/LibraryManager.jsx
@@ -2,9 +2,10 @@ import React, { useEffect, useState } from 'react'
function statusLabel(job) {
if (!job) return null
+ const type = job.type === 'prepare' ? 'prepare' : job.type
const progress = typeof job.progress === 'number' ? `${job.progress.toFixed(0)}%` : null
const detail = job.detail ? ` ${job.detail}` : ''
- return `${job.type} · ${job.status}${progress ? ` · ${progress}` : ''}${detail}`
+ return `${type} · ${job.status}${progress ? ` · ${progress}` : ''}${detail}`
}
export default function LibraryManager({
@@ -110,30 +111,10 @@ export default function LibraryManager({
onDeleted?.(library.slug)
}
- async function startJob(kind) {
- if (!library) return
- try {
- await runAction(async () => {
- const endpoint = `${apiBase}/libraries/${library.slug}/jobs/${kind}`
- const options = {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' }
- }
- if (kind === 'embed') {
- options.body = JSON.stringify({})
- }
- const response = await fetch(endpoint, options)
- await expectOk(response)
- })
- } catch (error) {
- setErrorMessage(String(error?.message || error))
- }
- }
-
if (!library) {
return (
-
Create a database, add files or folders, then build and index it for local RAG.
+
Create a database, add files, then add it to chat. Heimgeist will prepare retrieval automatically.
)
}
@@ -141,6 +122,7 @@ export default function LibraryManager({
const activeJobs = (jobs || []).filter(job => job.slug === library.slug && (job.status === 'queued' || job.status === 'running'))
const usingInChat = chatLibrarySlug === library.slug
const isPreparingForChat = pendingChatLibrarySlug === library.slug
+ const isReadyForChat = !!library.states?.is_indexed
const canStartRename = () => {
setRenameValue(library.name || '')
setErrorMessage('')
@@ -190,7 +172,7 @@ export default function LibraryManager({
{confirmDelete && (
-
Delete "{library.name}"? This removes the local index and metadata for this database.
+
Delete "{library.name}"? This removes the registered files and local retrieval data for this database.
Add Files
- startJob('build')}>Build Corpus
- startJob('enrich')}>Enrich
- startJob('embed')}>Index
Rename
onToggleChatLibrary(usingInChat ? null : library).catch((error) => setErrorMessage(String(error?.message || error)))}
>
- {usingInChat ? 'Stop Using In Chat' : isPreparingForChat ? 'Preparing For Chat...' : 'Use In Chat'}
+ {usingInChat ? 'Remove From Chat' : isPreparingForChat ? 'Adding To Chat...' : 'Add To Chat'}
Files: {library.files?.length || 0}
- Corpus: {library.artifacts?.corpus_records || 0}
- Enriched: {library.artifacts?.enhanced_records || 0}
- Indexed
+
+ {isPreparingForChat ? 'Preparing' : isReadyForChat ? 'Ready for chat' : library.files?.length ? 'Needs preparation' : 'No data yet'}
+
+
+ {usingInChat ? 'In chat' : isPreparingForChat ? 'Adding to chat' : 'Not in chat'}
+
{usingInChat && (
- This database will be queried before each chat request and its context will be appended to the prompt.
+ This database is attached to chat. Heimgeist retrieves relevant snippets before each message and appends them to the prompt.
)}
{isPreparingForChat && (
- Preparing this database for chat. Heimgeist will build and index it automatically.
+ Preparing this database for chat. Heimgeist is reading files, enriching content, and building search indexes automatically.
)}
- {!library.states?.is_indexed && !usingInChat && !isPreparingForChat && (
+ {!library.files?.length && !usingInChat && !isPreparingForChat && (
- Use In Chat will prepare this database automatically if it is not ready yet.
+ Add files to make this database available in chat.
+
+ )}
+
+ {library.files?.length > 0 && !isReadyForChat && !usingInChat && !isPreparingForChat && (
+
+ Add To Chat will prepare this database automatically before it is used.
)}