Skip to content

Commit 98ce365

Browse files
committed
Init RAG
1 parent 0c39241 commit 98ce365

File tree

159 files changed

+2298
-412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+2298
-412
lines changed

content/post/6minutes-tech-rag.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: "6minutes Tech RAG"
3+
type: "post"
4+
date: 2025-08-16T21:34:58+07:00
5+
description: "Without RAG, the LLM takes the user input and creates a response based on information it was trained on—or what it already knows. With RAG, an information retrieval component is introduced that utilizes the user input to first pull information from a new data source."
6+
keywords: ["6minutes Tech Rag"]
7+
categories: ["cheatsheet", "6minutes-tech"]
8+
tags: []
9+
image: "/common/no-image.png"
10+
---
11+
12+
## LLM
13+
14+
Let's take a look at these 2 questions and how ChatGPT (LLM) answers those.
15+
16+
> 1st question: What is LLM ?
17+
18+
![LLM](https://gist.github.com/user-attachments/assets/f3b6059b-f5f0-4c51-b6f2-4eb61eb4adee)
19+
20+
![LLM](https://gist.github.com/user-attachments/assets/5fd2a28c-f282-4d52-b250-2e85d3c2bc1c)
21+
22+
> 2nd question: What is our company onboarding process ?
23+
24+
![LLM](https://gist.github.com/user-attachments/assets/55e82e5c-6b2e-42f8-ae86-fd767d23e302)
25+
26+
![LLM](https://gist.github.com/user-attachments/assets/d50b53e5-3575-438c-9844-356fb8181631)
27+
28+
What we can see is, in the 1st question, ChatGPT can answer your question, because there are answers in its knowledge base, so it just picks one them and the answer is more precised to your question.
29+
30+
But in the 2nd question, ChatGPT can not answer your question, because there is no information about your company and its internal process.
31+
32+
**So how do we support ChatGPT can answer this question?**
33+
34+
You must provide it with context included your company's internal process.
35+
36+
And that's what we call RAG (retrieval augmented generation) - provide context for LLM to allow it provides more accurate answers.
37+
38+
> Let's build a prompt with context
39+
40+
```
41+
You are an internal chatbox.
42+
Your name is SChat
43+
Your mission is to answer employee's questions.
44+
You should find answers from the information I provided you.
45+
For questions you don't know, please answer "I'm sorry, I don't have any information about this, please contact HR department for more information."
46+
Here is our company information:
47+
Company Name: SONNM
48+
Founded: 2025
49+
CEO: Son Nguyen Minh
50+
Industry: Software Development and Digital Marketing
51+
Some of process in our company:
52+
I. Onboarding Process
53+
54+
1.1. Pre-boarding: This phase begins after a candidate accepts a job offer and continues until their first day. It involves tasks like:
55+
Completing necessary paperwork (e.g., tax forms, benefit enrollment).
56+
Setting up IT access and equipment.
57+
Sending a welcome email and providing information about the first day.
58+
Introducing the new hire to the team and culture.
59+
1.2. Orientation: This is the first day or week of the new employee's experience, focusing on:
60+
Introductions to key personnel and team members.
61+
An overview of the company's structure, mission, and values.
62+
A tour of the workspace.
63+
Basic information about company policies and procedures.
64+
1.3. Training: This phase focuses on job-specific training and development:
65+
Providing the necessary skills and knowledge for the new role.
66+
Introducing performance metrics and expectations.
67+
Implementing a progressive training schedule.
68+
Utilizing mentorship or buddy systems.
69+
1.4. Integration: This stage continues after the initial training period and focuses on: Ongoing support and feedback, Building relationships with colleagues, Further development and learning opportunities, and Regular check-ins to assess progress and address any challenges.
70+
71+
```
72+
73+
<img width="1714" height="970" alt="image" src="https://gist.github.com/user-attachments/assets/579f641c-0aa2-493b-afbf-4ef870bea8cd" />
74+
75+
<img width="1634" height="482" alt="image" src="https://gist.github.com/user-attachments/assets/d58f8916-d5c4-4a4b-aa86-3a3220471261" />
76+
77+
<img width="1826" height="340" alt="image" src="https://gist.github.com/user-attachments/assets/eefb63e7-0037-41b0-8fff-bb095248ca1b" />
78+
79+
## RAG
80+
81+
![alt text](https://docs.aws.amazon.com/images/sagemaker/latest/dg/images/jumpstart/jumpstart-fm-rag.jpg)
82+
83+
## References
84+
85+
- https://aws.amazon.com/what-is/retrieval-augmented-generation/
86+
- https://cloud.google.com/use-cases/retrieval-augmented-generation?hl=en
87+
- https://aws.amazon.com/blogs/machine-learning/from-concept-to-reality-navigating-the-journey-of-rag-from-proof-of-concept-to-production/

content/post/image-2.png

146 KB
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: "Java Tutorial 2025 Day 03 - Data Persistent with Hibernate"
3+
type: "post"
4+
date: 2025-07-02T13:49:22+07:00
5+
description: "Java Tutorial 2025 Day 02"
6+
keywords: ["Java Tutorial 2025 Day 02"]
7+
categories: ["java"]
8+
tags: ["java"]
9+
image: /articles/java-tutorial-2025-day-02/001.png
10+
---
11+
12+
### Source Code
13+
14+
- [Source code](https://github.com/RefactorEveryThing/ret_java_cli_001)
15+
16+
### References
17+
18+
- [Hibernate](https://docs.jboss.org/hibernate/orm/7.0/quickstart/html_single/#tutorial_annotations)
19+
20+
## Steps
21+
22+
1. Add dependency

public/categories/6minutes-tech/index.html

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,32 @@ <h1 class="hero-section-heading">
251251
</section>
252252
<section class="container section grid md:grid-cols-4 gap-8">
253253

254+
<div class="card card-post-default">
255+
<a href="http://localhost:1313/post/6minutes-tech-rag/"
256+
><img
257+
class="card-post-image"
258+
src="http://localhost:1313/common/no-image.png"
259+
alt="6minutes Tech Rag"
260+
/></a>
261+
<div class="px-6 py-4">
262+
<h2 class="card-post-title"><a href="http://localhost:1313/post/6minutes-tech-rag/">6minutes Tech Rag</a></h2>
263+
<div>
264+
265+
<a class="category-tag category-cheatsheet" href="http://localhost:1313/categories/cheatsheet">cheatsheet</a>
266+
267+
<a class="category-tag category-6minutes-tech" href="http://localhost:1313/categories/6minutes-tech">6minutes-tech</a>
268+
269+
</div>
270+
<div>
271+
<span class="card-post-date"
272+
>16 Aug, 2025</span
273+
>
274+
</div>
275+
<div class="card-post-description">Without RAG, the LLM takes the user input and creates a response based on information it was trained on—or what it already knows. With RAG, an information retrieval component is introduced that utilizes the user input to first pull information from a new data source</div>
276+
</div>
277+
</div>
278+
279+
254280
<div class="card card-post-default">
255281
<a href="http://localhost:1313/post/6minutes-tech-graphql/"
256282
><img
@@ -371,15 +397,15 @@ <h4 class="footer-heading">Cheatsheet</h4>
371397
<ul class="footer-section-navigation-menu-links">
372398

373399

400+
<li><a href="http://localhost:1313/post/6minutes-tech-rag/">6minutes Tech Rag</a></li>
401+
374402
<li><a href="http://localhost:1313/post/6minutes-tech-graphql/">6minutes Tech Graphql</a></li>
375403

376404
<li><a href="http://localhost:1313/post/6minutes-tech-progressive-web-app/">6minutes Tech Progressive Web App</a></li>
377405

378406
<li><a href="http://localhost:1313/post/flexbox-and-real-world-examples/">Flexbox and Real World Examples</a></li>
379407

380408
<li><a href="http://localhost:1313/post/react-native-examples-setup-working-place-for-react-native-developer/">[React Native Examples] Setup Working Place for React Native Developer</a></li>
381-
382-
<li><a href="http://localhost:1313/post/happy-new-year-2024/">Happy New Year 2024</a></li>
383409

384410
</ul>
385411
</div>
@@ -396,7 +422,7 @@ <h4 class="footer-heading">Cheatsheet</h4>
396422
Powered by <a class="font-bold text-primary" href="https://gohugo.io/">Go Hugo</a> - Made
397423
with love from <a class="font-bold text-primary" href="http://localhost:1313/">NextJSVietNam</a> -
398424
Build
399-
Version 2024-05-19 08:35:31 &#43;0700 &#43;07
425+
Version 2025-08-16 21:34:58 &#43;0700 &#43;07
400426
</div>
401427
</div>
402428
</footer>

public/categories/6minutes-tech/index.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66
<description>Recent content in 6minutes-Tech on Useful NodeJS Tricks, JavaScript Tips, Tricks and Best Practices</description>
77
<generator>Hugo</generator>
88
<language>en-us</language>
9-
<lastBuildDate>Sun, 19 May 2024 08:35:31 +0700</lastBuildDate>
9+
<lastBuildDate>Sat, 16 Aug 2025 21:34:58 +0700</lastBuildDate>
1010
<atom:link href="http://localhost:1313/categories/6minutes-tech/index.xml" rel="self" type="application/rss+xml" />
11+
<item>
12+
<title>6minutes Tech Rag</title>
13+
<link>http://localhost:1313/post/6minutes-tech-rag/</link>
14+
<pubDate>Sat, 16 Aug 2025 21:34:58 +0700</pubDate>
15+
<guid>http://localhost:1313/post/6minutes-tech-rag/</guid>
16+
<description>&lt;p&gt;&lt;img src=&#34;image-2.png&#34; alt=&#34;alt text&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://aws.amazon.com/what-is/retrieval-augmented-generation/&#34;&gt;https://aws.amazon.com/what-is/retrieval-augmented-generation/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://cloud.google.com/use-cases/retrieval-augmented-generation?hl=en&#34;&gt;https://cloud.google.com/use-cases/retrieval-augmented-generation?hl=en&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://aws.amazon.com/blogs/machine-learning/from-concept-to-reality-navigating-the-journey-of-rag-from-proof-of-concept-to-production/&#34;&gt;https://aws.amazon.com/blogs/machine-learning/from-concept-to-reality-navigating-the-journey-of-rag-from-proof-of-concept-to-production/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
17+
</item>
1118
<item>
1219
<title>6minutes Tech Graphql</title>
1320
<link>http://localhost:1313/post/6minutes-tech-graphql/</link>

public/categories/aws-labs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,15 +371,15 @@ <h4 class="footer-heading">Cheatsheet</h4>
371371
<ul class="footer-section-navigation-menu-links">
372372

373373

374+
<li><a href="http://localhost:1313/post/6minutes-tech-rag/">6minutes Tech Rag</a></li>
375+
374376
<li><a href="http://localhost:1313/post/6minutes-tech-graphql/">6minutes Tech Graphql</a></li>
375377

376378
<li><a href="http://localhost:1313/post/6minutes-tech-progressive-web-app/">6minutes Tech Progressive Web App</a></li>
377379

378380
<li><a href="http://localhost:1313/post/flexbox-and-real-world-examples/">Flexbox and Real World Examples</a></li>
379381

380382
<li><a href="http://localhost:1313/post/react-native-examples-setup-working-place-for-react-native-developer/">[React Native Examples] Setup Working Place for React Native Developer</a></li>
381-
382-
<li><a href="http://localhost:1313/post/happy-new-year-2024/">Happy New Year 2024</a></li>
383383

384384
</ul>
385385
</div>

public/categories/aws/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,15 +761,15 @@ <h4 class="footer-heading">Cheatsheet</h4>
761761
<ul class="footer-section-navigation-menu-links">
762762

763763

764+
<li><a href="http://localhost:1313/post/6minutes-tech-rag/">6minutes Tech Rag</a></li>
765+
764766
<li><a href="http://localhost:1313/post/6minutes-tech-graphql/">6minutes Tech Graphql</a></li>
765767

766768
<li><a href="http://localhost:1313/post/6minutes-tech-progressive-web-app/">6minutes Tech Progressive Web App</a></li>
767769

768770
<li><a href="http://localhost:1313/post/flexbox-and-real-world-examples/">Flexbox and Real World Examples</a></li>
769771

770772
<li><a href="http://localhost:1313/post/react-native-examples-setup-working-place-for-react-native-developer/">[React Native Examples] Setup Working Place for React Native Developer</a></li>
771-
772-
<li><a href="http://localhost:1313/post/happy-new-year-2024/">Happy New Year 2024</a></li>
773773

774774
</ul>
775775
</div>

public/categories/cheatsheet/index.html

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,32 @@ <h1 class="hero-section-heading">
251251
</section>
252252
<section class="container section grid md:grid-cols-4 gap-8">
253253

254+
<div class="card card-post-default">
255+
<a href="http://localhost:1313/post/6minutes-tech-rag/"
256+
><img
257+
class="card-post-image"
258+
src="http://localhost:1313/common/no-image.png"
259+
alt="6minutes Tech Rag"
260+
/></a>
261+
<div class="px-6 py-4">
262+
<h2 class="card-post-title"><a href="http://localhost:1313/post/6minutes-tech-rag/">6minutes Tech Rag</a></h2>
263+
<div>
264+
265+
<a class="category-tag category-cheatsheet" href="http://localhost:1313/categories/cheatsheet">cheatsheet</a>
266+
267+
<a class="category-tag category-6minutes-tech" href="http://localhost:1313/categories/6minutes-tech">6minutes-tech</a>
268+
269+
</div>
270+
<div>
271+
<span class="card-post-date"
272+
>16 Aug, 2025</span
273+
>
274+
</div>
275+
<div class="card-post-description">Without RAG, the LLM takes the user input and creates a response based on information it was trained on—or what it already knows. With RAG, an information retrieval component is introduced that utilizes the user input to first pull information from a new data source</div>
276+
</div>
277+
</div>
278+
279+
254280
<div class="card card-post-default">
255281
<a href="http://localhost:1313/post/6minutes-tech-graphql/"
256282
><img
@@ -809,30 +835,6 @@ <h2 class="card-post-title"><a href="http://localhost:1313/post/con-duong-tro-la
809835
</div>
810836

811837

812-
<div class="card card-post-default">
813-
<a href="http://localhost:1313/post/create-static-blog-with-hugo-and-github-pages-in-5-minutes/"
814-
><img
815-
class="card-post-image"
816-
src="http://localhost:1313/common/no-image.png"
817-
alt="Create Static Blog With Hugo and Github Pages in 5 Minutes"
818-
/></a>
819-
<div class="px-6 py-4">
820-
<h2 class="card-post-title"><a href="http://localhost:1313/post/create-static-blog-with-hugo-and-github-pages-in-5-minutes/">Create Static Blog With Hugo and Github Pages in 5 Minutes</a></h2>
821-
<div>
822-
823-
<a class="category-tag category-cheatsheet" href="http://localhost:1313/categories/cheatsheet">cheatsheet</a>
824-
825-
</div>
826-
<div>
827-
<span class="card-post-date"
828-
>21 Jun, 2022</span
829-
>
830-
</div>
831-
<div class="card-post-description">Create Static Blog With Hugo and Github Pages in 5 Minutes</div>
832-
</div>
833-
</div>
834-
835-
836838
</section>
837839
<section class="container">
838840

@@ -921,15 +923,15 @@ <h4 class="footer-heading">Cheatsheet</h4>
921923
<ul class="footer-section-navigation-menu-links">
922924

923925

926+
<li><a href="http://localhost:1313/post/6minutes-tech-rag/">6minutes Tech Rag</a></li>
927+
924928
<li><a href="http://localhost:1313/post/6minutes-tech-graphql/">6minutes Tech Graphql</a></li>
925929

926930
<li><a href="http://localhost:1313/post/6minutes-tech-progressive-web-app/">6minutes Tech Progressive Web App</a></li>
927931

928932
<li><a href="http://localhost:1313/post/flexbox-and-real-world-examples/">Flexbox and Real World Examples</a></li>
929933

930934
<li><a href="http://localhost:1313/post/react-native-examples-setup-working-place-for-react-native-developer/">[React Native Examples] Setup Working Place for React Native Developer</a></li>
931-
932-
<li><a href="http://localhost:1313/post/happy-new-year-2024/">Happy New Year 2024</a></li>
933935

934936
</ul>
935937
</div>
@@ -946,7 +948,7 @@ <h4 class="footer-heading">Cheatsheet</h4>
946948
Powered by <a class="font-bold text-primary" href="https://gohugo.io/">Go Hugo</a> - Made
947949
with love from <a class="font-bold text-primary" href="http://localhost:1313/">NextJSVietNam</a> -
948950
Build
949-
Version 2024-05-19 08:35:31 &#43;0700 &#43;07
951+
Version 2025-08-16 21:34:58 &#43;0700 &#43;07
950952
</div>
951953
</div>
952954
</footer>

public/categories/cheatsheet/index.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66
<description>Recent content in Cheatsheet on Useful NodeJS Tricks, JavaScript Tips, Tricks and Best Practices</description>
77
<generator>Hugo</generator>
88
<language>en-us</language>
9-
<lastBuildDate>Sun, 19 May 2024 08:35:31 +0700</lastBuildDate>
9+
<lastBuildDate>Sat, 16 Aug 2025 21:34:58 +0700</lastBuildDate>
1010
<atom:link href="http://localhost:1313/categories/cheatsheet/index.xml" rel="self" type="application/rss+xml" />
11+
<item>
12+
<title>6minutes Tech Rag</title>
13+
<link>http://localhost:1313/post/6minutes-tech-rag/</link>
14+
<pubDate>Sat, 16 Aug 2025 21:34:58 +0700</pubDate>
15+
<guid>http://localhost:1313/post/6minutes-tech-rag/</guid>
16+
<description>&lt;p&gt;&lt;img src=&#34;image-2.png&#34; alt=&#34;alt text&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://aws.amazon.com/what-is/retrieval-augmented-generation/&#34;&gt;https://aws.amazon.com/what-is/retrieval-augmented-generation/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://cloud.google.com/use-cases/retrieval-augmented-generation?hl=en&#34;&gt;https://cloud.google.com/use-cases/retrieval-augmented-generation?hl=en&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://aws.amazon.com/blogs/machine-learning/from-concept-to-reality-navigating-the-journey-of-rag-from-proof-of-concept-to-production/&#34;&gt;https://aws.amazon.com/blogs/machine-learning/from-concept-to-reality-navigating-the-journey-of-rag-from-proof-of-concept-to-production/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
17+
</item>
1118
<item>
1219
<title>6minutes Tech Graphql</title>
1320
<link>http://localhost:1313/post/6minutes-tech-graphql/</link>

0 commit comments

Comments
 (0)