Skip to content

Commit cf1f3db

Browse files
[release-1.10] RHIDP-12596: Personal AI Notebooks (#2212)
* Personal AI Notebooks * CQA-related changes * Incorporated Ben's comments * Fixing UI button name * Incorporate tech comments * Incorporated Fabrice's comments * Remove orphaned files * Incorporated Fabrice's comments --------- Co-authored-by: Priyanka Abel <pabel@redhat.com>
1 parent db10693 commit cf1f3db

10 files changed

Lines changed: 305 additions & 0 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
ifdef::context[:parent-context: {context}]
3+
4+
[id="build-a-private-knowledge-base-with-notebooks_{context}"]
5+
= Build a private knowledge base with {ls-short} Notebooks
6+
7+
:context: build-a-private-knowledge-base-with-notebooks
8+
9+
[role="_abstract"]
10+
Use {ls-short} notebooks to create isolated research environments. These workspaces allow you to analyze project data securely by using a large language model (LLM) grounded in your specific documentation.
11+
12+
include::{docdir}/artifacts/snip-developer-preview.adoc[]
13+
14+
include::../modules/shared/proc-create-isolated-research-workspaces.adoc[leveloffset=+1]
15+
16+
include::../modules/shared/proc-provide-project-context-to-the-ai.adoc[leveloffset=+1]
17+
18+
include::../modules/shared/proc-extract-and-verify-document-based-insights.adoc[leveloffset=+1]
19+
20+
// [role="_additional-resources"]
21+
// == Additional resources
22+
//*
23+
//
24+
ifdef::parent-context[:context: {parent-context}]
25+
ifndef::parent-context[:!context:]

assemblies/shared/assembly-customize.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ include::../modules/shared/proc-update-the-system-prompt-in.adoc[leveloffset=+1]
1515

1616
include::../modules/shared/proc-customize-the-chat-history-storage-in.adoc[leveloffset=+1]
1717

18+
include::../modules/shared/proc-enable-secure-ai-research-with-developer-lightspeed-notebooks.adoc[leveloffset=+2]
19+
1820
// include::../modules/shared/proc-changing-your-llm-provider.adoc[leveloffset=+1]
1921
ifdef::parent-context[:context: {parent-context}]
2022
ifndef::parent-context[:!context:]
23+

assemblies/shared/assembly-get-ai-assisted-help-for-your-development-tasks.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ include::../modules/shared/ref-best-results-for-assistant-queries.adoc[leveloffs
2020
include::../modules/shared/con-ai-response-monitoring-and-context-management.adoc[leveloffset=+1]
2121

2222
include::../modules/shared/proc-manage-chats.adoc[leveloffset=+1]
23+
24+
include::assembly-build-a-private-knowledge-base-with-notebooks.adoc[leveloffset=+1]
25+
2326
ifdef::parent-context[:context: {parent-context}]
2427
ifndef::parent-context[:!context:]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
ifdef::context[:parent-context: {context}]
3+
4+
[id="solve-project-specific-challenges-with-notebooks_{context}"]
5+
= Solve project-specific challenges with {ls-short} Notebooks
6+
:context: solve-project-specific-challenges-with-developer-lightspeed-notebooks
7+
8+
[role="_abstract"]
9+
Use {ls-short} Notebooks to research, troubleshoot, and analyze projects by using a large language model (LLM) grounded in your own documentation. Notebooks use Retrieval-Augmented Generation (RAG) to ensure that responses are based strictly on the files you upload.
10+
11+
Use Notebooks to achieve the following goals:
12+
13+
`Query your documentation`:: Upload project files to ask questions, summarize content, or brainstorm ideas based on those specific documents.
14+
`Troubleshoot with project-specific context`:: Upload project logs, architecture diagrams, or onboarding files to receive technical answers tailored to your specific environment.
15+
`Securely analyze private data`:: Conduct research in isolated sessions. Your uploaded data and chat history remain private and are inaccessible to other users.
16+
`Run multiple Notebooks`:: Uploaded documents and chat history remain available and are re-opened through the *Notebook* dashboard.
17+
`Verify AI responses with citations`:: Use the *Sources* chips to view the exact document excerpts used to generate an answer.
18+
`Organize research`:: Use metadata and tagging to categorize different research topics.
19+
20+
The following constraints apply during the {developer-preview}:
21+
22+
`Data boundaries`:: The AI can only access data within the active Notebook session.
23+
`Private access`:: You cannot share notebooks or documents with other team members.
24+
`Manual uploads`:: You must upload files directly. The tool does not support URL ingestion or web scraping.
25+
`Ephemeral defaults`:: Without a configured Persistent Volume (PV), all Notebook data and uploaded files are lost upon service restart.
26+
27+
include::{docdir}/artifacts/snip-developer-preview.adoc[]
28+
29+
include::../modules/shared/proc-enable-secure-ai-research-with-developer-lightspeed-notebooks.adoc[leveloffset=+1]
30+
include::../modules/shared/proc-enable-data-persistence-for-developer-lightspeed-notebooks.adoc[leveloffset=+1]
31+
32+
ifdef::parent-context[:context: {parent-context}]
33+
ifndef::parent-context[:!context:]
34+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
[id="create-isolated-research-workspaces_{context}"]
3+
= Create isolated research workspaces
4+
5+
[role="_abstract"]
6+
Organize your work into individual notebook sessions to keep research topics separate and private.
7+
8+
.Procedure
9+
. In the {product-very-short} interface, click the *Open Lightspeed* floating action button (FAB).
10+
. In your *Developer Lightspeed* page, select the *Notebooks* tab.
11+
. Click *Create a new notebook* to start a new workspace.
12+
. Optional: To manage your workspaces, click the *More options* icon on a notebook card to *Rename*, *Delete*, or add *Tags* to the session.
13+
14+
.Verification
15+
* Confirm the new notebook card appears on the *My Notebooks* dashboard.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="enable-data-persistence-for-developer-lightspeed-notebooks_{context}"]
4+
= Enable data persistence for Developer Lightspeed Notebooks
5+
6+
[role="_abstract"]
7+
To persist Notebook sessions, documents, and AI history across service restarts, you must configure the Notebooks storage backends to use persistent volumes.
8+
9+
By default, the service uses ephemeral storage in the `/tmp` directory, which the system clears during a pod restart.
10+
11+
.Prerequisites
12+
13+
* By using the link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/cli_tools/index#cli-about-cli_cli-developer-commands[{openshift-cli}], you have access, with developer permissions, to the {ocp-short} cluster aimed at containing your {product-short} instance.
14+
* You have authored and provisioned a custom config map for your deployment. For more information, see link:{configuring-book-link}#provision-your-custom-rhdh-configuration_provision-and-use-your-custom-rhdh-configuration[Provision your custom {product} configuration].
15+
* A Persistent Volume Claim (PVC) is provisioned in your cluster and mounted to the {lcs-short} container (for example, at `/var/lib/lightspeed-data`).
16+
17+
.Procedure
18+
19+
. Update your custom config map `llama-stack-configs/config.yaml` file to point the `kv_notebooks` storage backend to your persistent mount point:
20+
+
21+
[source,yaml]
22+
----
23+
spec:
24+
initContainers:
25+
- name: init-notebooks-dir
26+
# ... complete init container
27+
containers:
28+
- name: lightspeed-core
29+
image: quay.io/lightspeed-core/lightspeed-stack:0.5.1
30+
ports:
31+
- containerPort: 8080
32+
volumeMounts:
33+
- name: notebooks-storage
34+
mountPath: /var/lib/lightspeed-data
35+
- name: config # ← Added all ConfigMap mounts
36+
mountPath: /app-root/config.yaml
37+
subPath: config.yaml
38+
- name: lightspeed-config
39+
mountPath: /app-root/lightspeed-stack.yaml
40+
subPath: lightspeed-stack.yaml
41+
- name: profile
42+
mountPath: /app-root/rhdh-profile.py
43+
subPath: rhdh-profile.py
44+
livenessProbe: # ← Added health checks
45+
httpGet:
46+
path: /readiness
47+
port: 8080
48+
readinessProbe:
49+
httpGet:
50+
path: /readiness
51+
port: 8080
52+
volumes: # ← Added all volume definitions
53+
- name: notebooks-storage
54+
persistentVolumeClaim:
55+
claimName: lightspeed-notebooks-pvc
56+
- name: config
57+
configMap:
58+
name: llama-stack-config
59+
- name: lightspeed-config
60+
configMap:
61+
name: lightspeed-core-config
62+
- name: profile
63+
configMap:
64+
name: rhdh-profile
65+
----
66+
. Update your deployment manifest to include the init container, volume mounts, and volume definitions:
67+
+
68+
[source,yaml]
69+
----
70+
spec:
71+
template:
72+
spec:
73+
initContainers:
74+
- name: init-notebooks-storage
75+
image: registry.access.redhat.com/ubi9/ubi-minimal
76+
command: ["sh", "-c", "mkdir -p /var/lib/lightspeed-data/notebooks && chmod -R 777 /var/lib/lightspeed-data/notebooks"]
77+
volumeMounts:
78+
- name: lightspeed-notebooks
79+
mountPath: /var/lib/lightspeed-data
80+
containers:
81+
- name: lightspeed-stack
82+
image: quay.io/lightspeed-core/lightspeed-stack:0.5.1
83+
ports:
84+
- containerPort: 8080
85+
volumeMounts:
86+
- name: lightspeed-notebooks
87+
mountPath: /var/lib/lightspeed-data
88+
- name: config
89+
mountPath: /app-root/config.yaml
90+
subPath: config.yaml
91+
livenessProbe:
92+
httpGet:
93+
path: /readiness
94+
port: 8080
95+
readinessProbe:
96+
httpGet:
97+
path: /readiness
98+
port: 8080
99+
volumes:
100+
- name: lightspeed-notebooks
101+
persistentVolumeClaim:
102+
claimName: lightspeed-notebooks-pvc
103+
- name: config
104+
configMap:
105+
name: llama-stack-config
106+
----
107+
. Apply the updated configuration and restart the service.
108+
109+
.Verification
110+
111+
. In {product}, create a Notebook and upload a test document.
112+
. Send a message to the virtual assistant and verify that the response is based on the document.
113+
. Restart the pod:
114+
+
115+
[source,terminal]
116+
----
117+
$ oc delete pod <pod_name>
118+
----
119+
. After the pod recovers, refresh the *My Notebooks* dashboard.
120+
. Verify that the Notebook and the uploaded file are still accessible.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="enable-secure-ai-research-with-developer-lightspeed-notebooks_{context}"]
4+
= Enable secure AI research with Developer Lightspeed Notebooks
5+
6+
[role="_abstract"]
7+
Configure {product} and {ls-brand-name} to provide users with private, document-based AI workspaces.
8+
9+
.Prerequisites
10+
* A deployed instance of {product-very-short}.
11+
* By using the link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/cli_tools/index#cli-about-cli_cli-developer-commands[{openshift-cli}], you have access, with developer permissions, to the {ocp-short} cluster aimed at containing your {product-short} instance.
12+
* A Lightspeed Stack service is running and accessible to the backend.
13+
* A supported large language model (LLM), such as Granite 7B or higher, is available.
14+
15+
.Procedure
16+
. Enable the notebook feature and define your model by adding the following configuration to your `{my-app-config-file}` file:
17+
+
18+
[source,yaml]
19+
----
20+
lightspeed:
21+
notebooks:
22+
enabled: true
23+
queryDefaults:
24+
model: ${NOTEBOOKS_QUERY_MODEL} # Use the exact model name
25+
provider_id: ${NOTEBOOKS_QUERY_PROVIDER_ID}
26+
----
27+
+
28+
[NOTE]
29+
====
30+
If the model name is incorrect, an error message appears in the logs and the user interface.
31+
====
32+
33+
. Grant user access through role-based access control (RBAC) policies by defining permissions in your `rbac-policy-csv` file:
34+
.. Add the permission policy:
35+
+
36+
[source,text]
37+
----
38+
p, role:default/_<your_team_name>_, lightspeed.notebooks.use, update, allow
39+
----
40+
.. Assign the role to specific users:
41+
+
42+
[source,text]
43+
----
44+
g, user:default/_<your_user_name>_, role:default/_<your_team_name>_
45+
----
46+
47+
. Apply the updated configuration and restart the service.
48+
49+
.Verification
50+
. Log in to {product-very-short} using an account assigned to the RBAC role defined in the configuration.
51+
. Confirm that the *Notebooks* tab is visible next to the *Chat* tab in the primary navigation bar.
52+
. Click the *Notebooks* tab and ensure the *My Notebooks* dashboard loads without error messages.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
[id="extract-and-verify-document-based-insights_{context}"]
3+
= Extract and verify document-based insights
4+
5+
[role="_abstract"]
6+
After providing context, use the AI to perform reasoning across your files and verify the accuracy of the responses.
7+
8+
.Prerequisites
9+
* You have uploaded documents or URLs to the active chat session to establish context.
10+
+
11+
[NOTE]
12+
====
13+
If no documents are uploaded, you cannot communicate with the AI.
14+
====
15+
.Procedure
16+
. Enter a question in the prompt bar at the bottom of the screen.
17+
. Analyze the response. The AI identifies relationships across all uploaded documents and URLs in the session.
18+
. To verify accuracy, click the *Sources* chip to view the specific document excerpts used to generate the answer.
19+
. Manage your workflow by using the history panel in the sidebar to expand or collapse previous interactions.
20+
21+
.Verification
22+
* Confirm that the *Sources* panel displays the correct filenames and text snippets corresponding to the AI's response.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
[id="provide-project-context-to-the-ai_{context}"]
3+
= Provide project context to the AI
4+
5+
[role="_abstract"]
6+
To receive answers tailored to your project, upload relevant source material to your active session.
7+
8+
.Procedure
9+
10+
. Open a Notebook card from the dashboard.
11+
12+
. Add resources by using one of the following methods:
13+
** In the sidebar, click the *Add (+)* icon.
14+
** In the main user interface, click *Upload a resource*.
15+
16+
. Select your sources:
17+
Local files:: Upload `.txt`, `.md`, `.pdf`, `.docx`, `.log`, `.yaml`, or `.json` files.
18+
Web content:: Enter a URL to ingest web-based content.
19+
20+
. Adhere to the following constraints:
21+
`File size`:: Individual files or URL content must be 20MB or smaller.
22+
`Notebook Capacity`:: The total token count per session must not exceed 100k.
23+
`Unsupported content`:: Avoid scanned PDF images without text, audio, video, and general image files.
24+
`Persistence requirement`:: The internal SQL and KV stores must be mapped to a persistent backend to maintain the 100k token context across sessions.
25+
26+
. Wait for the system to process and vectorize the files. This might take several seconds for larger PDFs.
27+
28+
.Verification
29+
* Ensure the uploaded files appear in the *Resources* list in the sidebar with a `Processed` status.

titles/integrate_interacting-with-developer-lightspeed-for-rhdh/master.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ include::modules/shared/proc-install-and-configure.adoc[leveloffset=+1]
2626

2727
include::assemblies/shared/assembly-customize.adoc[leveloffset=+1]
2828

29+
include::assemblies/shared/assembly-solve-project-specific-challenges-with-notebooks.adoc[leveloffset=+1]
30+
2931
include::assemblies/shared/assembly-get-ai-assisted-help-for-your-development-tasks.adoc[leveloffset=+1]
3032

3133
include::assemblies/shared/assembly-ai-model-evaluation-data-to-select-the-right-ai-model.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)