Skip to content

Commit f2bf614

Browse files
Ready for production
1 parent 2937728 commit f2bf614

9 files changed

+299
-30
lines changed

.streamlit/secrets.toml.example

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ datastax = "password_abc"
2121
# Follow the rule: username = "localization_code"
2222
# Where localization_code defines the language from localization.csv
2323
postnl = "nl_NL"
24-
datastax = "en_US"
24+
datastax = "en_US"
25+
26+
[delete_option]
27+
# Follow the rule: username = "delete_option"
28+
# Where delete_option = True allows the 'Delete Context' button to be shown for that username
29+
michel = "True"

app.py

+21-27
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,16 @@ def check_password():
7373

7474
def login_form():
7575
"""Form with widgets to collect user information"""
76-
with st.form("Credentials"):
76+
with st.form("credentials"):
7777
st.text_input('Username', key='username')
7878
st.text_input('Password', type='password', key='password')
7979
st.form_submit_button('Login', on_click=password_entered)
8080

8181
def password_entered():
8282
"""Checks whether a password entered by the user is correct."""
83-
if st.session_state['username'] in st.secrets[
84-
"passwords"
85-
] and hmac.compare_digest(
86-
st.session_state['password'],
87-
st.secrets.passwords[st.session_state['username']],
88-
):
83+
if st.session_state['username'] in st.secrets['passwords'] and hmac.compare_digest(st.session_state['password'], st.secrets.passwords[st.session_state['username']]):
8984
st.session_state['password_correct'] = True
85+
st.session_state.user = st.session_state['username']
9086
del st.session_state['password'] # Don't store the password.
9187
else:
9288
st.session_state['password_correct'] = False
@@ -102,8 +98,8 @@ def password_entered():
10298
return False
10399

104100
def logout():
105-
del st.session_state['password_correct']
106-
del st.session_state['username']
101+
del st.session_state.password_correct
102+
del st.session_state.user
107103

108104
# Function for Vectorizing uploaded data into Astra DB
109105
def vectorize_text(uploaded_files):
@@ -174,7 +170,7 @@ def load_rails(username):
174170
if not check_password():
175171
st.stop() # Do not continue if check_password is not True.
176172

177-
username = st.session_state['username']
173+
username = st.session_state.user
178174
language = st.secrets.languages[username]
179175
lang_dict = load_localization(language)
180176

@@ -335,24 +331,23 @@ def load_prompt():
335331
memory.clear()
336332

337333
# Drop the vector data and start from scratch
338-
with st.sidebar:
339-
with st.form('delete_context'):
340-
st.caption(lang_dict['delete_context'])
341-
submitted = st.form_submit_button(lang_dict['delete_context_button'])
342-
if submitted:
343-
with st.spinner(lang_dict['deleting_context']):
344-
vectorstore.clear()
345-
memory.clear()
346-
st.session_state.clear()
347-
st.session_state.messages = [AIMessage(content=lang_dict['assistant_welcome'])]
334+
if (username in st.secrets['delete_option'] and st.secrets.delete_option[username] == 'True'):
335+
with st.sidebar:
336+
with st.form('delete_context'):
337+
st.caption(lang_dict['delete_context'])
338+
submitted = st.form_submit_button(lang_dict['delete_context_button'])
339+
if submitted:
340+
with st.spinner(lang_dict['deleting_context']):
341+
vectorstore.clear()
342+
memory.clear()
343+
st.session_state.messages = [AIMessage(content=lang_dict['assistant_welcome'])]
348344

349345
# Draw rails
350346
with st.sidebar:
351347
st.subheader(lang_dict['rails_1'])
352348
st.caption(lang_dict['rails_2'])
353349
for i in rails_dict:
354-
if i>1:
355-
st.markdown(f"{i-1}. {rails_dict[i]}")
350+
st.markdown(f"{i}. {rails_dict[i]}")
356351

357352
# Draw all messages, both user and agent so far (every time the app reruns)
358353
for message in st.session_state.messages:
@@ -390,16 +385,15 @@ def load_prompt():
390385
print(f"Using chain: {chain}")
391386

392387
# Call the chain and stream the results into the UI
393-
callback = StreamHandler(response_placeholder)
394-
response = chain.invoke({'question': question, 'chat_history': history}, config={'callbacks': [callback]})
388+
response = chain.invoke({'question': question, 'chat_history': history}, config={'callbacks': [StreamHandler(response_placeholder)]})
395389
print(f"Response: {response}")
396390
content = response.content
397391

398392
# Write the sources used
399393
relevant_documents = retriever.get_relevant_documents(question)
400-
content += """
394+
content += f"""
401395
402-
*The following context was used for this answer:*
396+
*{lang_dict['sources_used']}:*
403397
"""
404398
sources = []
405399
for doc in relevant_documents:
@@ -421,4 +415,4 @@ def load_prompt():
421415
st.session_state.messages.append(AIMessage(content=content))
422416

423417
with st.sidebar:
424-
st.caption("v11.07.01")
418+
st.caption("v11.20.01")

datastax.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Your personal effectivity booster
2+
Generative AI is considered to bring the next Industrial Revolution.
3+
4+
Why? Studies show a **37% efficiency boost** in day to day work activities!
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.
10+
11+
#### What does it know?
12+
De app has been pre-loaded with the follpowing information:
13+
- [DataStax homepage](https://www.datastax.com)
14+
- [Vector search for Genrative AI Apps](https://www.datastax.com/resources/whitepaper/vector-search-for-generative-ai-apps)
15+
- [Astra DB Datasheet](https://cdn.sanity.io/files/bbnkhnhl/production/325d36f40acc590b146ea9d77442cf4ed1da9eac.pdf)
16+
- [Digital Champion: Priceline](https://www.datastax.com/digital-champions/martin-brodbeck-delivers-the-best-travel-products-to-priceline-customers-by-leveraging-real-time-ai)
17+
- [Luna for Apache Cassandra](https://www.postnl.nl/zakelijke-oplossingen/duurzaamheid/)
18+
19+
This means you can start interacting with your personal assistant based on the above information!
20+
21+
#### Add additonal content
22+
Just drop a PDF or Text file into the upload box in the sidebar and hit `Save`.
23+
24+
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 😉
25+
26+
---
Binary file not shown.

documents/Datastax homepage.txt

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
Datastax is an AI company focussing on Generative AI with their Vector Database Astra DB.
2+
3+
DATASTAX ASTRA DB
4+
Vector and RAG Made Easier
5+
Astra DB gives developers the APIs, real-time data and complete ecosystem integrations to put accurate RAG and Gen AI apps in production - FAST.
6+
7+
START FOR FREE
8+
9+
ASTRA DB VECTOR
10+
Register now to try the new Astra DB vector experience in public preview.
11+
12+
13+
ASTRA ASSISTANTS API
14+
Unify data and LLMs within a single API within our Astra DB vector database.
15+
16+
17+
RAG IN PRODUCTION
18+
See Skypoint Cloud’s LangChain RAG app in production.
19+
20+
21+
VERCEL & ASTRA DB
22+
Transform Product Docs into a RAG-Powered App with Vercel and Astra DB.
23+
24+
Real-time Vector data for RAG
25+
Accurate Gen AI
26+
Accurate Gen AI
27+
Vector updates available with ZERO latency delays.
28+
29+
Production-level
30+
Production-level
31+
High performance and serverless for distributed production workloads.
32+
33+
Proven and Trusted
34+
Proven and Trusted
35+
Built on Cassandra, choice of AI leaders, with enterprise security and compliance.
36+
37+
DEVELOPERS
38+
RAG Made Easier
39+
Elegant APIs and powerful integrations for production-level RAG and FLARE.
40+
41+
TRY FOR FREE
42+
EXPLORE EXAMPLES
43+
Create
44+
Create a table using the VECTOR type
45+
46+
Load
47+
Easily load vectors like any other data type
48+
49+
Index
50+
Create a Storage Attached Index which enables high performance ANN (Approximate Nearest Neighbor) search
51+
52+
Query
53+
Query to perform similarity search
54+
55+
CREATE TABLE my_vectors (my_id text PRIMARY KEY, my_vector vector<float, 3>);
56+
Generative AI Leaders Shaping their Industries
57+
Bolstering Bookings with Real-time AI and Vector Search
58+
Transforming Banking Through Generative AI
59+
Improving Operational Efficiency with GenAI
60+
Empowering Financial Management with Gen AI
61+
Banking on Astra DB to Provide Real-Time Financial Transaction Data Enrichment with AI
62+
Bolstering Bookings with Real-time AI and Vector Search
63+
Priceline leverages real-time data infrastructure and Generative AI to build highly personalized experiences for customers, combining AI with real-time vector search.
64+
65+
LEARN MORE
66+
“Priceline has been at the forefront of using machine learning for many years. Vector search gives us the ability to semantically query the billions of real-time signals we receive as part of our checkout experience that flow back to Astra DB. We plan to use Google Cloud’s Generative AI capabilities alongside Astra DB’s vector search to power our real time data infrastructure and Generative AI experiences."
67+
68+
Martin Brodbeck
69+
CTO, Priceline
70+
Transforming Banking Through Generative AI
71+
Capital One has consistently invested in technologies that reinvent the banking and financial services industry. Capital One leverages Generative AI for more engaging and human-centered digital banking experiences, all facilitated by instant access to real-time data.
72+
73+
LEARN MORE
74+
“Vector search is a really important aspect of Generative AI. It has multiple applications for example, holding in personalized or contextually relevant information to those large language model interactions to make them more contextually relevant.”
75+
76+
Kel Vanee
77+
VP of Machine Learning Engineering
78+
Improving Operational Efficiency with GenAI
79+
SkyPoint AI is revolutionizing senior care through its use of Generative AI healthcare solutions. The company builds real-time AI applications with vector search, empowered by advanced LLMs and AI agents.
80+
81+
LEARN MORE
82+
“Finding specific policies and operating procedures is time-consuming and challenging due to scattered storage across various platforms. Using Astra DB's vector search capabilities, SkyPoint can leverage these benefits to enhance its services, offering users real-time, contextual, and personalized solutions. This leads to accurate predictions and personalized healthcare outcomes at a lower cost.”
83+
84+
Tisson Mathew
85+
Founder & CEO, SkyPoint AI
86+
Empowering Financial Management with Gen AI
87+
Macquarie Bank utilizes DataStax and Bard to facilitate a customized search experience, allowing users to search for and categorize their payments, enhancing their financial management capabilities.
88+
89+
LEARN MORE
90+
"In 2017, we started to use DataStax. For the first time in the bank's history, we can provide a real 360-degree view of customers—not only to internal people but also to the customers: all the products in a nice, simple view. Personalization will be more and more important. In our opinion, that will be the key differentiation.”
91+
92+
Luis Uguina
93+
Chief Digital Officer, Macquarie
94+
Banking on Astra DB to Provide Real-Time Financial Transaction Data Enrichment with AI
95+
The world's leading financial companies build with Bud's simple APIs to turn messy financial data into powerful customer insights. With Astra DB, Bud has a reliable platform for its data that lets its internal team concentrate on new services and using financial data to create value for customers, rather than supporting our database infrastructure.
96+
97+
"Financial services enterprises are unlocking the value of enriched transactional data with the Bud platform. We depend on DataStax Astra DB for the dynamic scalability and high performance we need to apply machine learning (ML) to real-time data. This means we can provide highly accurate, actionable insights for our clients and their customers."
98+
99+
Michael Cullum
100+
VP of Engineering, Bud
101+
REVIEWS
102+
Hear from our customers
103+
Trust Radius icon
104+
Incentivized Review
105+
Astra DB has been a phenomenal tool, we have gained an organized workplace due to it. The data structure is so well maintained, and our employees rely working on Astra DB on daily basis. Its simple to use nature and cost effectiveness is an eye catcher.
106+
Kartik Pujari
107+
Full Stack Engineer
108+
EDII Software Solutions
109+
Information Technology & Services | 51-200 employees
110+
Read Full Review
111+
Incentivized Review
112+
It has helped us keeping our data secured and organized. The working environment has become more efficient due to this.
113+
Avinash Bhatt
114+
Senior Web Administrator
115+
EDII Software and Solutions
116+
Information Technology & Services | 51-200 employees
117+
Read Full Review
118+
READ ALL REVIEWS
119+
Ready to get started with Vector Search?
120+
Deliver Generative AI apps on the world’s most powerful, most scalable vector database.
121+
122+
TRY FOR FREE
123+
Trusted by leaders in every industry
124+
Capital One
125+
Macquarie
126+
Priceline
127+
Audi
128+
T-Mobile
129+
The Home Depot

documents/Luna.txt

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
LUNA FOR APACHE CASSANDRA®
2+
Support mission-critical Cassandra deployments
3+
Deliver apps at scale with unparalleled expertise and support from the team behind the open-source Apache Cassandra®.
4+
5+
CONTACT US
6+
BENEFITS
7+
Get more from Apache Cassandra
8+
Enterprise support from the experts
9+
Best practices, advice, and SLA-based support to keep your Cassandra deployment in top shape.
10+
11+
Enterprise support from the experts
12+
Data management Expertise
13+
Develop Cassandra apps with your choice of API: . Build real-time data pipelines between Cassandra and upstream & downstream systems using .
14+
15+
Data management Expertise
16+
Cloud-native support
17+
Expert support for K8ssandra which is a production-ready platform for running Cassandra on Kubernetes, with necessary metrics and tooling.
18+
19+
Cloud-native support
20+
Zero downtime
21+
Experience 24x7x365 availability with Apache Cassandra’s active-everywhere architecture.
22+
23+
Zero downtime
24+
Linear scalability
25+
Scale without compromising on performance or latency to seamlessly manage the most demanding real-time workloads.
26+
27+
Linear scalability
28+
High performance
29+
Create real-time and highly-interactive customer experiences with blisteringly fast reads and writes.
30+
31+
High performance
32+
CONTACT US
33+
Real-time data at work
34+
Wood Hole Oceanographic Institution
35+
Logate
36+
Delivering 90TB of oceanographic data with performance and reliability
37+
Woods Hole uses Luna to optimize their Apache Cassandra architecture, improve performance, and stabilize access to oceanographic observation data with increased reliability.
38+
39+
LEARN MORE
40+
“I recommend anybody using Cassandra who is unsure if they are getting the most out of it to try Luna. It's been great.”
41+
42+
Jeff Glatstein
43+
Data Delivery Manager at WHOI
44+
Expert support with Luna delivers a richer Cassandra experience.
45+
Logate relies on Apache Cassandra to deliver cloud-ready apps that scale without service outages and automatically balance loads across nodes. Apache Cassandra, combined with expert support from DataStax Luna, delivers more availability, better redundancy, and easier scaling for Logate customers.
46+
47+
LEARN MORE
48+
“We found the educational material around Cassandra from DataStax incredibly helpful to our team as we scaled up our deployments, and we also used DataStax Luna so we could have consulting support available to us. Luna makes it easy for us to get the help we need whenever we need it.”
49+
50+
Danilo Mišović
51+
Technical Lead at Logate
52+
Packages
53+
Luna Standard for Apache Cassandra
54+
For small production environments
55+
56+
CONTACT US
57+
Node-based pricing (20-150 nodes)
58+
Unlimited tickets
59+
24x7 support coverage
60+
1 hour urgent response time
61+
Luna Plus for Apache Cassandra
62+
For large production environments
63+
64+
CONTACT US
65+
Node-based pricing (150 nodes +)
66+
Unlimited tickets
67+
24x7 support coverage
68+
1 hour urgent response time
69+
Support for additional open source projects including K8ssandra (deployments of 150+ nodes)
70+
Access to Solution Architects
71+
Premium support add-on
72+
An enterprise support partnership
73+
74+
CONTACT US
75+
Access to Named Engineer/Technical Account Manager
76+
15 minute urgent response time
77+
Engineering escalation
78+
Community approved patch support
79+
Long term support for Apache Cassandra versions beyond end of support from the project

0 commit comments

Comments
 (0)