You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Chat Agent is build specifically for use in Enterprise environments as it incorporates the following functions:
1
+
# Configurable Enterprise Chat Agent
2
+
This Chat Agent is build specifically as a reusable and configurable sample app to share with enterprises or prospects.
3
+
3
4
1. It uses [LangChain](https://www.langchain.com/) as the framework to easily set up LLM Q&A chains
4
5
2. It uses [Streamlit](https://streamlit.io/) as the framework to easily create Web Applications
5
6
3. It uses [Astra DB](https://astra.datastax.com/) as the Vector Store to enable Rerieval Augmented Generation in order to provide meaningfull contextual interactions
6
-
4. It uses Short Term Memory to keep track of what was said and generated
7
+
4. It uses [Astra DB](https://astra.datastax.com/) as Short Term Memory to keep track of what was said and generated
7
8
5. It uses a StreamingCallbackHandler to stream output to the screen which prevents having to wait for the final answer
8
-
6. It allows for new Context to be uploaded, Vectorized and Stored into the Astra DB Vector Database
9
-
10
-

9
+
6. It allows for new Content to be uploaded, Vectorized and Stored into the Astra DB Vector Database so it can be used as Context
10
+
7. It offers a configurable localization through `localization.csv`
11
+
8. It offers a guided experience on-rails through `rails.csv`
11
12
12
13
## Preparations
13
14
1. First install the Python dependencies using:
14
15
```
15
16
pip3 install -r requirements.txt
16
17
```
17
18
2. Download your Astra DB Secure Connect Bundle and place it in the `streamlit-langchain` directory.
18
-
3. Then update the secrets in `streamlit-langchain/.streamlit/secrets.toml`. There is an example provided at `streamlit-langchain/.streamlit/secrets.toml.example`.
19
+
3. Then update the `OpenAI`, `AstraDB` and optionally `LangSmith` secrets in `streamlit-langchain/.streamlit/secrets.toml`. There is an example provided at `secrets.toml.example`.
20
+
21
+
## Customization
22
+
Now it's time to customize the app for your specific situation or customers.
23
+
### Step 1
24
+
Define credentials by adding a new username and password in the `[passwords]` section in `streamlit-langchain/.streamlit/secrets.toml`.
25
+
### Step 2
26
+
Define the UI language of the app by adding a localization code in the `[languages]` section in `streamlit-langchain/.streamlit/secrets.toml`. Currently `en_US` and `nl_NL` are supported. However it is easy to add additional languages in `localization.csv`.
27
+
### Step 3
28
+
Create a guided experience by providing sample prompts in `rails.csv`. The convention here is that `<username>` from Step 1 is used to define the experience.
29
+
### Step 4
30
+
Start up the app and pre-load relevant PDF and Text files so that the app has content that can be used as context for the questions/prompts in the next step. All this data will be loaded into a user specific table defined by `<username>`.
31
+
### Step 5
32
+
Create a customized welcome page in the root folder. The convention here is to create a markdown file called `<username>.md`. Ideally, list which files have been pre-loaded.
19
33
20
34
## Getting started
21
35
You're ready to run the app as follows:
22
36
```
23
37
streamlit run rag_app.py
24
38
```
25
-
Now upload a piece of text, like for instance the [State of the Union](streamlit-langchain/assets/state_of_the_union.txt) located at `streamlit-langchain/assets/state_of_the_union.txt` and start asking questions about it.
39
+
In addition to the pre-loaded content, a user can add additional content that will be used as context for prompts.
26
40
27
-
Currently the App is configured to answer as a Pirate would do. Of cource you can change this as required by changing the `template`.
41
+
## Deploy to the internet
42
+
It's easy to upload this app to the community edition of Streamlit. As the app uses a login page it is safe to have it publicly available.
28
43
29
-
## Extensive comments
30
-
This repo is means to get you started using Streamlit as well. Check out the extensive comments in the code. The best way to get a better understanding is to check out the simpler app at `streamlit-langchain/qa_app.py`
44
+
## Warning
45
+
The goal of this app is to be easily shared within enterprises. Just be aware that YOUR OPENAI subscription is being used for creating embeddings and LLM calls. This WILL incur cost.
Generative AI is considered to bring the next Industrial Revolution.
1
+
## Jouw persoonlijke effectiviteitsbooster
2
+
Er wordt aangenomen dat generatieve AI de volgende industriële revolutie zal brengen.
3
3
4
-
Why? Studies show a **37% efficiency boost** in day to day work activities!
4
+
Waarom? Uit onderzoek blijkt dat de **efficiëntie van de dagelijkse werkzaamheden met 37% toeneemt!**
5
5
6
-
#### What is this app?
7
-
This app is a Chat Agent which takes into account Enterprise Context to provide meaningfull and contextual responses.
8
-
Why is this a big thing? It is because the underlying Foundational Large Language Models are not trained on Enterprise Data. They have no way of knowing anything about your organization.
9
-
Also they are trained upon a moment in time, so typically miss out on relevant and recent information.
6
+
#### Wat is deze app?
7
+
Deze app is een chatagent die rekening houdt met Enterprise Content om zinvolle en contextuele antwoorden te bieden.
8
+
Waarom is dit iets groots? Dit komt omdat de onderliggende Foundational Large Language Models niet zijn getraind op bedrijfsgegevens. Ze kunnen niets over uw organisatie weten.
9
+
Ze zijn bovendien op een bepaald moment getraind, waardoor ze doorgaans relevante en recente informatie missen.
10
10
11
-
#### What does it know?
12
-
The app has been preloaded with the following context:
11
+
#### Wat weet het?
12
+
De app is vooraf geladen met de volgende content:
13
13
-[PDF met Business Principles](https://www.postnl.nl/Images/business-principles-nl_tcm10-66407.pdf)
14
14
-[PDF met haalservice aanbod](https://www.postnl.nl/Images/aanleveren-pakketten_tcm10-236964.pdf)
15
15
-[Webpagina over zakelijk aanbod](https://www.postnl.nl/zakelijke-oplossingen/)
16
16
-[Webpagina over duurzaamheid](https://www.postnl.nl/zakelijke-oplossingen/duurzaamheid/)
17
17
18
-
This means you can start interacting with your personal assistant based on the above topics.
18
+
Dit betekent dat u op basis van de bovenstaande onderwerpen kunt beginnen met de interactie met uw persoonlijke assistent.
19
19
20
-
#### Adding additional context
21
-
On top of the above you have the opportunity to add additional information which then can be taken into account by the personal assistant. Just drop a PDF or Text file into the upload box in the sidebar and hit `Save`.
20
+
#### Extra content toevoegen
21
+
Bovenop het bovenstaande heeft u de mogelijkheid om aanvullende informatie toe te voegen, waarmee de persoonlijke assistent rekening kan houden. Plaats gewoon een PDF- of tekstbestand in het uploadvak in de zijbalk en klik op 'Opslaan'.
22
22
23
-
By the way... Be careful with the `Delete context` button. As this will do exactly that. I deletes the preloaded content mentioned above rendering the personal assistant non-contextual 😉
23
+
Overigens... Wees voorzichtig met de knop `Context verwijderen`. Omdat dit precies dat zal doen. Het verwijderd de hierboven genoemde vooraf geladen inhoud, waardoor de persoonlijke assistent niet-contextueel wordt 😉
Copy file name to clipboardExpand all lines: welcome.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,6 @@ Also they are trained upon a moment in time, so typically miss out on relevant a
11
11
#### What does it know?
12
12
Just drop a PDF or Text file into the upload box in the sidebar and hit `Save`.
13
13
14
-
By the way... Be careful with the `Delete context` button. As this will do exactly that. I deletes the preloaded content mentioned above rendering the personal assistant non-contextual 😉
14
+
By the way... Be careful with the `Delete context` button. As this will do exactly that. It deletes the preloaded content mentioned above rendering the personal assistant non-contextual 😉
0 commit comments