diff --git a/README.md b/README.md index c63e677..da96226 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ Then install this package using: pip install --no-build-isolation --no-deps . ``` +## Configuration + ### Configuring the retrieval service provider If running locally, navigate into the `llm_service` directory and copy the provided `.env.sample` file to a `.env` file. Then fill in the values with desired details for a retrieval service provider. @@ -55,11 +57,6 @@ If deploying remotely, instead of using the `.env` file, configure your cloud pr Caveat: due to non-standartisation of client credentials authentication, the retrieval service provider must be registered with a Community Solid Server (Node Solid Servers like and Enterprise Solid Servers are currently not supported). This only applies to the retrieval service provider, the chat app users can use any Solid server as their identity provider. -## Usage - -Open chat interface by running `genpod-chat`. - -Run the LLM service provider using `genpod-llm`. ### Granting access to documents to the retrieval service provider @@ -77,12 +74,115 @@ For other configuration, such as adding GPU acceleration, see >+ App: login() + App ->+ BIDP: oidc_login() + BIDP ->> Bob: login screen + Bob ->> BIDP: login(username, password) + BIDP -->>- App: oidc_token + + %% App ->>+ BPod: getOrCreateSocialGenPodConfig(oidc_token) + %% BPod ->>- App: config + + App ->> Bob: show_config() + alt + Bob ->> App: config_url + App ->>+ ConfigPod: get_socialgenpod_config(oidc_token) + ConfigPod -->>- App: retrieval_service, llm_provider, documents_location + else + Bob ->> App: retrieval_service, llm_provider, documents_location + end + + opt documents_location is not None + App ->>+ Retriever: test_access(retrieval_service, oidc_token, documents_location) + critical Prepare vector retrieval DB + Retriever ->> Retriever: uris = discover_document_uris() + loop for uri in uris + Retriever ->>+ APod: download_resource(uri) + APod -->>- Retriever: content + Retriever ->> Retriever: add(content) + end + option error + Retriever ->> Retriever: log(error) + end + Retriever -->>- App: ok + end + App ->>+ LLM: test_access(llm_provider, oidc_token) + LLM -->>- App: ok + App ->>+ BPod: getChatMessageHistory(oidc_token) + BPod -->>- App: chat_history +``` + +```mermaid +--- +title: SocialGenPod communication +config: + mirrorActors: false +--- +sequenceDiagram + actor Bob + participant App as ChatApp + participant BPod as Bob's Solid Pod + participant Retriever as Retrieval Service + participant LLM as LLM Service + + Bob ->>+ App: chat_input(prompt) + opt chat_history length > 1 + App ->>+ LLM: summarise(prompt, chat_history) + LLM -->>- App: prompt = condensed_prompt + end + + App ->>+ BPod: store_message(prompt) + deactivate BPod + + opt documents_location is not None + App ->>+ Retriever: find_relevant_context(selected_retriever, documents_location, prompt) + Retriever -->>- App: relevant_documents + end + + App ->>+ LLM: chat_completion(selected_llm, prompt, relevant_documents) + LLM -->>- App: response + + App ->>+ BPod: store_message(response) + deactivate BPod + App -->>- Bob: response +``` + ## Acknowledgments `chat_app/data/turtle.png` is from . diff --git a/paper/socialgenpod_paper.pdf b/paper/socialgenpod_paper.pdf deleted file mode 100644 index 65f5da0..0000000 Binary files a/paper/socialgenpod_paper.pdf and /dev/null differ