peichao.dong commited on
Commit
90729fc
1 Parent(s): 8e967a7

add local index

Browse files
Files changed (27) hide show
  1. app.py +28 -1
  2. documents/business_context.faiss/index.faiss +0 -0
  3. documents/business_context.faiss/index.pkl +0 -0
  4. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6.md +46 -0
  5. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/ABstract(插件化AB Testing平台) 746b87acd94643ca871ec661b63f196c.md +123 -0
  6. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/ABstract(插件化AB Testing平台) 746b87acd94643ca871ec661b63f196c/业务模型 d31846027b4f40ca99f6e76f897663a4.md +198 -0
  7. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/ABstract(插件化AB Testing平台) 746b87acd94643ca871ec661b63f196c/进程间架构 d50744212b044d06a4b29fe931df391b.md +40 -0
  8. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/AWS b022fe0cb7084cc0b64624f7bc8cde2c.md +5 -0
  9. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Backend 137c41fa386f43249b249e956eb06bb0.md +27 -0
  10. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/CircleCI 719905fcb593423cad302d3fdc1c5dff.md +5 -0
  11. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Code Reviews 2b60c26d2a2e4a348f8f14c77023c385.md +44 -0
  12. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Development Lifecycle e20a5470e52f49e9bbc4f255cf81db4b.md +34 -0
  13. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Guidelines 4208cbd4733d4f6f94982f3fb24f6379.md +39 -0
  14. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Interviews 4be8039581d04456b0151f2cc4b22130.md +30 -0
  15. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Interviews 4be8039581d04456b0151f2cc4b22130/Questions ede8818b3a0e447f80145905690eb3f6/Alphabet Ordering a3c46877392e4fff85a9dcf594f4e066.md +41 -0
  16. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Interviews 4be8039581d04456b0151f2cc4b22130/Questions ede8818b3a0e447f80145905690eb3f6/FizzBuzz 70828a5e5e6846a48686f66bb9ccc8b6.md +46 -0
  17. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Interviews 4be8039581d04456b0151f2cc4b22130/Questions ede8818b3a0e447f80145905690eb3f6/To Do List Design 9d9cb6c13b4b4a0a8f7ab03a8c98a2d8.md +41 -0
  18. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Wiki 8da06b3dcf1b4eaaa3e90aa70feefe56.md +1 -0
  19. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Getting Started 6bc871dcdd4a4554b5b22c0c40740841.md +66 -0
  20. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/How to Deploy b7c4f3fd308944af8ba4637ec40fa4f9.md +33 -0
  21. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/How to QA 2f036148193a4fccac2c9e8ae9e6d197.md +31 -0
  22. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Redis 9e063b60eca24a1783c225cfdc21dd8c.md +5 -0
  23. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Smart Domain 3b0daf8bb0d740439426cfab214f1fa6.md +69 -0
  24. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Useful Commands 8a05b1de77ec44b6a55e388c2cc7fe47.md +40 -0
  25. documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/VUE 9501304a2b03470cad0eea93992d65ae.md +20 -0
  26. documents/{business_context.md → bussiness_context/business_context.md} +0 -0
  27. embedding.py +43 -0
app.py CHANGED
@@ -2,7 +2,9 @@ import gradio as gr
2
  from langchain.chains import LLMChain
3
  from langchain.chat_models import ChatOpenAI
4
  from langchain.document_loaders import TextLoader
 
5
  from memories import HumenFeedbackBufferMemory
 
6
  from promopts import FEEDBACK, FEEDBACK_PROMPT
7
 
8
  llm = ChatOpenAI(temperature=0.1)
@@ -18,7 +20,7 @@ llmchain = LLMChain(
18
  )
19
 
20
  """读取document/business_context.py文件内容作为context"""
21
- context_path = "./documents/business_context.md"
22
  textloader = TextLoader(context_path)
23
  CONTEXT = textloader.load()[0].page_content
24
 
@@ -47,6 +49,22 @@ def feedBack(context, story, chatbot=[], input=""):
47
  return chatbot, "", context
48
 
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  with gr.Blocks() as demo:
51
  with gr.Row():
52
  with gr.Column():
@@ -55,6 +73,9 @@ with gr.Blocks() as demo:
55
  with gr.Row():
56
  txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(
57
  container=False)
 
 
 
58
  with gr.Column():
59
  with gr.Row():
60
  context = gr.Textbox(show_label=True, label="Context", value=CONTEXT, placeholder="Enter Context").style(
@@ -67,9 +88,15 @@ with gr.Blocks() as demo:
67
  with gr.Row():
68
  button = gr.Button("Generate Scenarios")
69
 
 
 
 
 
70
  button.click(clearMemory, [chatbot], [chatbot, txt]).then(sendMessage, [chatbot, txt], [chatbot]).then(
71
  feedBack, [context, story, chatbot], [chatbot, txt])
72
  txt.submit(sendMessage, [chatbot, txt], [chatbot]).then(
73
  feedBack, [context, story, chatbot, txt], [chatbot, txt, context])
 
 
74
 
75
  demo.launch()
 
2
  from langchain.chains import LLMChain
3
  from langchain.chat_models import ChatOpenAI
4
  from langchain.document_loaders import TextLoader
5
+ from embedding import CustomEmbedding
6
  from memories import HumenFeedbackBufferMemory
7
+ from langchain.memory import ConversationBufferMemory
8
  from promopts import FEEDBACK, FEEDBACK_PROMPT
9
 
10
  llm = ChatOpenAI(temperature=0.1)
 
20
  )
21
 
22
  """读取document/business_context.py文件内容作为context"""
23
+ context_path = "./documents/bussiness_context/business_context.md"
24
  textloader = TextLoader(context_path)
25
  CONTEXT = textloader.load()[0].page_content
26
 
 
49
  return chatbot, "", context
50
 
51
 
52
+ customerEmbedding = CustomEmbedding()
53
+
54
+ faqChain = customerEmbedding.getFAQChain()
55
+
56
+
57
+ def faqFromLocal(input, chatbot=[]):
58
+ response = faqChain.run(input)
59
+ chatbot.append((input, response))
60
+ return chatbot, ""
61
+
62
+
63
+ def generateEmbeddings():
64
+ customerEmbedding.calculateBusinessContextEmbedding()
65
+ customerEmbedding.calculateNotionEmbedding()
66
+
67
+
68
  with gr.Blocks() as demo:
69
  with gr.Row():
70
  with gr.Column():
 
73
  with gr.Row():
74
  txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(
75
  container=False)
76
+ with gr.Row():
77
+ faq = gr.Textbox(show_label=False, placeholder="A&Q from local context").style(
78
+ container=False)
79
  with gr.Column():
80
  with gr.Row():
81
  context = gr.Textbox(show_label=True, label="Context", value=CONTEXT, placeholder="Enter Context").style(
 
88
  with gr.Row():
89
  button = gr.Button("Generate Scenarios")
90
 
91
+ with gr.Blocks():
92
+ with gr.Row():
93
+ generateEmbedding = gr.Button("Generate embedding")
94
+
95
  button.click(clearMemory, [chatbot], [chatbot, txt]).then(sendMessage, [chatbot, txt], [chatbot]).then(
96
  feedBack, [context, story, chatbot], [chatbot, txt])
97
  txt.submit(sendMessage, [chatbot, txt], [chatbot]).then(
98
  feedBack, [context, story, chatbot, txt], [chatbot, txt, context])
99
+ faq.submit(faqFromLocal, [faq, chatbot], [chatbot, faq])
100
+ generateEmbedding.click(generateEmbeddings)
101
 
102
  demo.launch()
documents/business_context.faiss/index.faiss ADDED
Binary file (618 kB). View file
 
documents/business_context.faiss/index.pkl ADDED
Binary file (81.9 kB). View file
 
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Engineering Wiki
2
+
3
+ <aside>
4
+ 💡 **Notion Tip:** Use this template to organize important information for your team. Add owners, verification, and tags to pages to keep them up to date. Just replace this sample content with your own.
5
+
6
+ </aside>
7
+
8
+ ## Codebase
9
+
10
+ ---
11
+
12
+ [Code Reviews](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Code%20Reviews%202b60c26d2a2e4a348f8f14c77023c385.md)
13
+
14
+ [ABstract(插件化AB Testing平台)](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/ABstract%EF%BC%88%E6%8F%92%E4%BB%B6%E5%8C%96AB%20Testing%E5%B9%B3%E5%8F%B0%EF%BC%89%20746b87acd94643ca871ec661b63f196c.md)
15
+
16
+ [VUE](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/VUE%209501304a2b03470cad0eea93992d65ae.md)
17
+
18
+ [Backend](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Backend%20137c41fa386f43249b249e956eb06bb0.md)
19
+
20
+ [AWS](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/AWS%20b022fe0cb7084cc0b64624f7bc8cde2c.md)
21
+
22
+ [Redis](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Redis%209e063b60eca24a1783c225cfdc21dd8c.md)
23
+
24
+ [CircleCI](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/CircleCI%20719905fcb593423cad302d3fdc1c5dff.md)
25
+
26
+ [Smart Domain](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Smart%20Domain%203b0daf8bb0d740439426cfab214f1fa6.md)
27
+
28
+ ## Guides & Processes
29
+
30
+ ---
31
+
32
+ [Getting Started](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Getting%20Started%206bc871dcdd4a4554b5b22c0c40740841.md)
33
+
34
+ [Engineering Guidelines](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Engineering%20Guidelines%204208cbd4733d4f6f94982f3fb24f6379.md)
35
+
36
+ [Development Lifecycle ](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Development%20Lifecycle%20e20a5470e52f49e9bbc4f255cf81db4b.md)
37
+
38
+ [How to Deploy](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/How%20to%20Deploy%20b7c4f3fd308944af8ba4637ec40fa4f9.md)
39
+
40
+ [Useful Commands](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Useful%20Commands%208a05b1de77ec44b6a55e388c2cc7fe47.md)
41
+
42
+ [Engineering Interviews](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Engineering%20Interviews%204be8039581d04456b0151f2cc4b22130.md)
43
+
44
+ [How to QA ](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/How%20to%20QA%202f036148193a4fccac2c9e8ae9e6d197.md)
45
+
46
+ [Engineering Wiki](Engineering%20Wiki%202402f5396a3244fdb3f1d135bdb0f3d6/Engineering%20Wiki%208da06b3dcf1b4eaaa3e90aa70feefe56.md)
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/ABstract(插件化AB Testing平台) 746b87acd94643ca871ec661b63f196c.md ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ABstract(插件化AB Testing平台)
2
+
3
+ Last edited time: April 23, 2023 3:58 PM
4
+ Owner: Anonymous
5
+
6
+ Project name: "ABstract". It plays on the words "AB testing" while also hinting at the concept of abstracting away the complexity of building and managing an AB testing platform.
7
+
8
+ > 这篇文档介绍了一个插件化AB Testing平台的产品愿景、项目目标、核心业务能力、业务模型和进程间架构。该平台提供配置管理、实验管理、数据收集和配置发布等核心能力,可以帮助公司业务/开发人员基于AB测试实现数据驱动产品迭代,同时提供核心能力插件化管理和最小实现,支持开发人员结合实际需求进行剪裁或扩展。
9
+ >
10
+
11
+ ## 产品愿景
12
+
13
+ 对于:我们的目标客户/用户
14
+
15
+ <aside>
16
+ 💡 想要基于AB测试实现数据驱动产品迭代的公司业务/开发人员
17
+
18
+ </aside>
19
+
20
+ 他们想:目标客户的痛点或者希望
21
+
22
+ <aside>
23
+ 💡 想要自建AB测试平台,方便与自身业务系统集成
24
+
25
+ </aside>
26
+
27
+ 这个:产品名称
28
+
29
+ <aside>
30
+ 💡 插件化AB Testing平台
31
+
32
+ </aside>
33
+
34
+ 是一个:什么样的产品类型(平台?工具?)
35
+
36
+ <aside>
37
+ 💡 AB测试平台核心能力套件
38
+
39
+ </aside>
40
+
41
+ 它可以:通过什么样的功能,为用户带来什么样的价值。
42
+
43
+ <aside>
44
+ 💡 提供AB测试平台核心能力:配置管理、实验管理、数据采集、实验结果分析能力,实现Feature管理和AB实验统一,做到数据驱动产品迭代
45
+
46
+ </aside>
47
+
48
+ 不同于:市场上的竞品及其特点
49
+
50
+ <aside>
51
+ 💡 商业化AB测试平台缺乏与实际业务结合的灵活性
52
+
53
+ </aside>
54
+
55
+ <aside>
56
+ 💡 大而全的开源AB测试平台难以与现有系统集成或进行二次开发
57
+
58
+ </aside>
59
+
60
+ 它的优势是:我们产品的独特价值
61
+
62
+ <aside>
63
+ 💡 提供核心能力插件化管理,并提供最小实现,即能满足独立部署运行需求,亦可支持开发人员结合实际需求进行剪裁或扩展
64
+
65
+ </aside>
66
+
67
+ ## 项目目标
68
+
69
+ > 完成插件化AB Testing 平台核心功能开发
70
+ >
71
+
72
+ > 探索AI在软件开发中的应用实践
73
+ >
74
+
75
+ ## 核心业务能力
76
+
77
+ - 配置管理
78
+ 1. Feature Flag管理
79
+ 1. 提供Feature Config的元数据
80
+ 2. Feature Config管理
81
+ 1. 提供依据Feature Flag生产Feature Config 配置界面的能力
82
+ - 实验管理
83
+ 1. 实验管理
84
+ 1. 提供实验、分组、指标配置的管理功能
85
+ 2. 提供实验实验运行结果查看
86
+ 2. 实验分级管理
87
+ 1. 提供互斥组管理
88
+ 2. 互斥组中的实验流量之间互斥
89
+ 3. 实验执行阶段分组结果查询能力
90
+ - Tracking 数据收集
91
+
92
+ 埋点事件上报收集
93
+
94
+ - 配置发布
95
+
96
+ 提供统一的通过featureKey 获取配置的结果,统一Feature Config 和实验配置下发结果
97
+
98
+
99
+ ```mermaid
100
+ graph LR
101
+ subgraph "AB Testing 平台"
102
+ AB测试核心能力 --> 配置管理
103
+ AB测试核心能力 --> 实验管理
104
+ AB测试核心能力 --> 数据收集
105
+ AB测试核心能力 --> 配置发布
106
+ 数据收集 --> 指标分析
107
+ 配置管理 --> FeatureFlag
108
+ 配置管理 --> FeatureConfig
109
+ 实验管理 --> 实验配置
110
+ 实验管理 --> 实验分级
111
+ 配置发布 --> 实验结果
112
+ 配置发布 --> FeatureConfig结果
113
+ end
114
+
115
+ ```
116
+
117
+ ## 业务模型
118
+
119
+ [业务模型](ABstract%EF%BC%88%E6%8F%92%E4%BB%B6%E5%8C%96AB%20Testing%E5%B9%B3%E5%8F%B0%EF%BC%89%20746b87acd94643ca871ec661b63f196c/%E4%B8%9A%E5%8A%A1%E6%A8%A1%E5%9E%8B%20d31846027b4f40ca99f6e76f897663a4.md)
120
+
121
+ ## 进程间架构
122
+
123
+ [进程间架构](ABstract%EF%BC%88%E6%8F%92%E4%BB%B6%E5%8C%96AB%20Testing%E5%B9%B3%E5%8F%B0%EF%BC%89%20746b87acd94643ca871ec661b63f196c/%E8%BF%9B%E7%A8%8B%E9%97%B4%E6%9E%B6%E6%9E%84%20d50744212b044d06a4b29fe931df391b.md)
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/ABstract(插件化AB Testing平台) 746b87acd94643ca871ec661b63f196c/业务模型 d31846027b4f40ca99f6e76f897663a4.md ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 业务模型
2
+
3
+ Last edited time: April 23, 2023 3:58 PM
4
+ Owner: Anonymous
5
+
6
+ ## 模型图
7
+
8
+ ```
9
+ @startuml
10
+ 'https://plantuml.com/class-diagram
11
+
12
+ left to right direction
13
+ package "Feature Flag" {
14
+ entity FeatureFlag #pink{
15
+ id: FeatureFlagId
16
+ featureKey: String
17
+ description: FeatureFlagDescription
18
+ featureConfigs: FeatureConfigs
19
+ }
20
+
21
+ entity FeatureConfig #pink{
22
+ id: FeatureConfigId
23
+ featureKey: String
24
+ data: Object
25
+ trackData: Object
26
+ condition: FilterCondition
27
+ description: FeatureConfigDescription
28
+ status: FeatureConfigStatus
29
+ }
30
+
31
+ interface FeatureFlags #Orange {
32
+ getFeatureFlag(featureKey: String): FeatureFlag
33
+ }
34
+
35
+ interface FeatureConfigs #Orange {
36
+ getFeatureConfigs(featureKey: String): List<FeatureConfig>
37
+ }
38
+
39
+ interface CustomerFeatureConfigs #Orange {
40
+ getFeatureConfigs(featureKey: String, customer: Customer): List<FeatureConfig>
41
+ }
42
+
43
+ FeatureFlags "1" -- "0..N" FeatureFlag
44
+ FeatureFlag "1" -- "1" FeatureConfigs
45
+ FeatureConfigs "1" -- "0..N" FeatureConfig
46
+ CustomerFeatureConfigs "1" -- "0..N" FeatureConfig
47
+ }
48
+
49
+ package "Experiment" as ExperimentPackage{
50
+ entity ExperimentGroup #pink {
51
+ id: ExperimentGroupId
52
+ description: ExperimentGroupDescription
53
+ }
54
+
55
+ entity Experiment #pink {
56
+ id: ExperimentId
57
+ groupId: ExperimentGroupId
58
+ description: ExperimentDescription
59
+ condition: FilterCondition
60
+ percentage: Percentage
61
+ }
62
+
63
+ entity Bucket #pink {
64
+ key: String
65
+ config: Object
66
+ percentage: Percentage
67
+ }
68
+
69
+ entity Assignment #pink {
70
+ id: AssignmentId
71
+ experimentId: ExperimentId
72
+ bucketKey: String
73
+ clientId: String
74
+ customerId: String
75
+ description: AssignmentDescription
76
+ }
77
+
78
+ interface ExperimentGroups #Orange {
79
+ getExperimentGroup(groupId: ExperimentGroupId): ExperimentGroup
80
+ }
81
+
82
+ interface ExperimentGroupExperiments #Orange {
83
+ getExperiments(groupId: ExperimentGroupId): List<Experiment>
84
+ }
85
+
86
+ interface Experiments #Orange {
87
+ getExperiment(experimentId: ExperimentId): Experiment
88
+ }
89
+
90
+ interface CustomerAssignments #Orange {
91
+ getAssignments(experimentId: ExperimentId, customer: Customer): Assignment
92
+ }
93
+
94
+ interface ExperimentAssignments #Orange {
95
+ getAssignments(experimentId: ExperimentId): List<Assignment>
96
+ getAssignments(experimentId: ExperimentId, bucketKey: String): List<Assignment>
97
+ }
98
+
99
+ ExperimentGroups "1" -- "0..N" ExperimentGroup
100
+ ExperimentGroup "1" -- "1" ExperimentGroupExperiments
101
+ ExperimentGroupExperiments "1" -- "0..N" Experiment
102
+ Experiments "1" -- "0..N" Experiment
103
+ Experiment "1" -- "1..N" Bucket
104
+ ExperimentAssignments "1" -- "1" Experiment
105
+ ExperimentAssignments "1" -- "0..N" Assignment
106
+ CustomerAssignments "1" -- "0..N" Assignment
107
+ }
108
+
109
+ package "Tracking" {
110
+ entity TrackingEvent #pink {
111
+ id: TrackingEventId
112
+ clientId: String
113
+ experimentId: ExperimentId
114
+ bucketKey: String
115
+ name: TrackingEventName
116
+ description: TrackingEventDescription
117
+ }
118
+
119
+ interface TrackingEvents #Orange {
120
+ getTrackingEvents(experimentId: ExperimentId, bucketKey: String): List<TrackingEvent>
121
+ }
122
+
123
+ TrackingEvents "1" -- "0..N" TrackingEvent
124
+ TrackingEvent "1..N" .. "1" Experiment
125
+ TrackingEvent "1..N" .. "1" Bucket
126
+ }
127
+
128
+ package "metrics" {
129
+ entity MetricMeta #pink {
130
+ id: MetricMetaId
131
+ name: MetricMeta
132
+ description: MetricDescription
133
+ }
134
+
135
+ entity Metric #pink {
136
+ id: MetricId
137
+ name: MetricName
138
+ description: MetricDescription
139
+ }
140
+
141
+ interface Metrics #Orange {
142
+ getMetrics(metricMetaId: MetricMetaId): List<Metric>
143
+ }
144
+
145
+ interface MetricMetas #Orange {
146
+ getMetricMetas(): List<MetricMeta>
147
+ }
148
+
149
+ interface MetricMetaMetrics #Orange {
150
+ getMetrics(metricMetaId: MetricMetaId): List<Metric>
151
+ }
152
+ MetricMetas "1" -- "0..N" MetricMeta
153
+ MetricMeta "1" -- "1" MetricMetaMetrics
154
+ MetricMetaMetrics "1" -- "0..N" Metric
155
+ Metrics "1" -- "0..N" Metric
156
+
157
+ }
158
+
159
+ package MemberCriteria {
160
+ entity Segment #pink {
161
+ id: SegmentId
162
+ name: String
163
+ description: SegmentDescription
164
+ }
165
+
166
+ interface Segments #Orange {
167
+ getSegments(): List<Segment>
168
+ }
169
+
170
+ interface CustomerSegments #Orange {
171
+ getSegments(customer: Customer): List<Segment>
172
+ }
173
+
174
+ Segments "1" -- "0..N" Segment
175
+ CustomerSegments "1" -- "0..N" Segment
176
+ }
177
+
178
+ entity Customer #Green {
179
+ id: CustomerId
180
+ clientId: String
181
+ description: CustomerDescription
182
+ }
183
+
184
+ Customer -- CustomerFeatureConfigs
185
+ Customer -- CustomerAssignments
186
+ CustomerAssignments -- CustomerSegments
187
+ CustomerFeatureConfigs -- CustomerSegments
188
+
189
+ Experiment "1" -- "0..N" MetricMeta
190
+ Experiment "1" -- "0..N" Metric
191
+ CustomerFeatureConfigs "1" -- "1" CustomerAssignments
192
+ Experiment "1" -- "0..N" Segment
193
+ FeatureConfig "1" -- "0..N" Segment
194
+ "metrics" .. "Tracking"
195
+ @enduml
196
+ ```
197
+
198
+ ![Untitled](%E4%B8%9A%E5%8A%A1%E6%A8%A1%E5%9E%8B%20d31846027b4f40ca99f6e76f897663a4/Untitled.png)
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/ABstract(插件化AB Testing平台) 746b87acd94643ca871ec661b63f196c/进程间架构 d50744212b044d06a4b29fe931df391b.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 进程间架构
2
+
3
+ Last edited time: April 23, 2023 3:58 PM
4
+ Owner: Anonymous
5
+
6
+ ```
7
+ @startuml
8
+ 'https://plantuml.com/component-diagram
9
+ package "前端" {
10
+ [APP]
11
+ [H5]
12
+ [小程序]
13
+ }
14
+
15
+ package "BFF" {
16
+ [APP] --> [APP BFF]
17
+ [H5] --> [H5 BFF]
18
+ [小程序] --> [小程序 BFF]
19
+ }
20
+
21
+ package "AB Testing" {
22
+ package "数据埋点" {
23
+ [APP BFF] --> [数据埋点]
24
+ [H5 BFF] --> [数据埋点]
25
+ [小程序 BFF] --> [数据埋点]
26
+ [数据埋点] -- [数据仓库]
27
+ }
28
+ [APP BFF] --> [Feature Flag]
29
+ [H5 BFF] --> [Feature Flag]
30
+ [小程序 BFF] --> [Feature Flag]
31
+ [Feature Flag] -- [Feature Configs]
32
+ [Feature Flag] -Right- [Experiments]
33
+ [Experiments] -- [Experiments Analytics]
34
+ [Experiments Analytics] -Right-> [数据仓库]
35
+ }
36
+
37
+ @enduml
38
+ ```
39
+
40
+ ![Untitled](%E8%BF%9B%E7%A8%8B%E9%97%B4%E6%9E%B6%E6%9E%84%20d50744212b044d06a4b29fe931df391b/Untitled.png)
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/AWS b022fe0cb7084cc0b64624f7bc8cde2c.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # AWS
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Infrastructure
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Backend 137c41fa386f43249b249e956eb06bb0.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Backend
2
+
3
+ Last edited time: April 23, 2023 3:58 PM
4
+ Owner: Anonymous
5
+ Tags: Codebase
6
+
7
+ ## 技术栈
8
+
9
+ 我们的技术栈是Sprig WebFlux + Spring Boot + Spring Reactive Data Couchbase
10
+
11
+ **Sprig WebFlux**是Spring Framework 5.0引入的一种新的反应式Web框架,可以用于构建高性能的Web应用程序。它支持异步编程模型,可以处理大量的并发请求,适用于高负载的Web应用程序。与传统的Servlet API相比,Sprig WebFlux提供了更好的性能、更高的吞吐量和更少的资源消耗。
12
+
13
+ **Spring Boot**是一个用于构建独立的、生产级别的Spring应用程序的框架。它提供了许多开箱即用的功能,如自动配置、嵌入式Web服务器和健康检查等,可以帮助开发人员快速构建Spring应用程序。
14
+
15
+ **Spring Reactive Data Couchbase**是一个基于反应式编程模型的Couchbase客户端库,可以与Sprig WebFlux和Spring Boot一起使用。它提供了异步的、非阻塞的API,可以处理大量的并发请求。同时,它还提供了一些有用的功能,如自动映射、复杂查询和事务管理等。
16
+
17
+ ## 架构风格
18
+
19
+ Smart Domain是一种软件架构风格,旨在通过将业务逻辑与数据访问逻辑分离来提高可维护性和可扩展性。在Smart Domain架构中,业务逻辑被定义为一个领域模型,它包含了应用程序的核心概念和行为。与此同时,数据访问逻辑被封装在一个或多个数据访问对象中,它们负责与数据库交互。通过这种方式,Smart Domain架构可以使开发人员更加专注于业务逻辑,从而提高应用程序的质量和可维护性。
20
+
21
+ ## Couchbase
22
+
23
+ Couchbase是一款面向企业应用的NoSQL数据库。它提供了高性能、高可用性和可扩展性,使得它成为了许多企业的首选。Couchbase支持类JSON文档、键值对和图形数据模型,非常适合用于Web应用、移动应用和物联网应用等场景。
24
+
25
+ 对于需要高可用性和可扩展性的企业来说,Couchbase提供了一些非常有用的功能,如动态数据分片、自动故障转移和跨数据中心复制。Couchbase还提供了一个灵活的查询引擎,使得查询数据变得非常容易。同时,Couchbase还支持各种各样的客户端库,包括Java、Python、C#和Node.js等。
26
+
27
+ 有关Couchbase的更多信息,请查看[Couchbase官方网站](https://www.couchbase.com/)。
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/CircleCI 719905fcb593423cad302d3fdc1c5dff.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # CircleCI
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Infrastructure
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Code Reviews 2b60c26d2a2e4a348f8f14c77023c385.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Code Reviews
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Codebase
6
+
7
+ <aside>
8
+ 💡 This template documents how to review code. Helpful for new and remote employees to get and stay aligned.
9
+
10
+ </aside>
11
+
12
+ # Philosophy
13
+
14
+ Why do you perform code reviews? What are your guiding principles for these reviews?
15
+
16
+ You may want to mention other pages here. Like Engineering Guidelines. To link to another page inline, type `@` followed by the name of the page: [Engineering Guidelines](Engineering%20Guidelines%204208cbd4733d4f6f94982f3fb24f6379.md)
17
+
18
+ # Preparing Code for Review
19
+
20
+ Preparation sets your reviewers up for success.
21
+
22
+ ### Commit Messages
23
+
24
+ Make sure your commit messages are descriptive.
25
+
26
+ ### Github PR Descriptions
27
+
28
+ Your PR descriptions should be an extension of your commit messages. Write about both what the commit changes, and how you implemented the change.
29
+
30
+ # Performing Code Reviews
31
+
32
+ ### How to Review
33
+
34
+ - Make two passes over the PR if it's substantial.
35
+ - On the first pass, come to an understanding of the code change at a high level.
36
+ - On the second pass, pay more attention to semantic details.
37
+
38
+ # Examples
39
+
40
+ ```jsx
41
+ var commentCount = 0;
42
+ ```
43
+
44
+ You might suggest that this be a `let` instead of `var`.
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Development Lifecycle e20a5470e52f49e9bbc4f255cf81db4b.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Development Lifecycle
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Guides and Processes
6
+
7
+ <aside>
8
+ 💡 This page documents the development process engineers should follow at your company. Helpful for getting new employees up to speed.
9
+
10
+ </aside>
11
+
12
+ # 1. Create a branch off of `master`
13
+
14
+ Name the branch with your first name pre-pended:
15
+ `leslie/cool-feature`
16
+
17
+ # 2. Writing code
18
+
19
+ You can link to other pages in your workspace in a couple ways:
20
+
21
+ - Type `/link`, press `enter`, and type the name of the page you want. This creates a link like this one:
22
+
23
+ [Engineering Guidelines](Engineering%20Guidelines%204208cbd4733d4f6f94982f3fb24f6379.md)
24
+
25
+ - To create a link inline, type `@` followed by the title of the page, then press `enter`. The result looks like this: [Engineering Guidelines](Engineering%20Guidelines%204208cbd4733d4f6f94982f3fb24f6379.md)
26
+
27
+ # 3. Create a pull request on Github
28
+
29
+ Include the Notion task link in your PR description.
30
+
31
+ # 4. Submit for review
32
+
33
+ - Assign the task in Notion to the appropriate reviewer.
34
+ - You can always tag a person on a Notion page by typing `@` followed by their name.
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Guidelines 4208cbd4733d4f6f94982f3fb24f6379.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Engineering Guidelines
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Guides and Processes
6
+
7
+ <aside>
8
+ 💡 Use this template to create guidelines for all of the engineers on your team. Add a table of contents by typing `/table of` and pressing `enter`.
9
+
10
+ </aside>
11
+
12
+ # Engineering philosophy
13
+
14
+ Summarize your team's approach to engineering here.
15
+
16
+ ## History
17
+
18
+ Notes about how the current codebase evolved.
19
+
20
+ # Patterns to follow
21
+
22
+ - List patterns that engineers should follow here.
23
+ - You can create `inline code snippets` with the shortcut `cmd/ctrl + e`.
24
+
25
+ # Code samples
26
+
27
+ Add code blocks for common snippets. Type `/code` and press `enter`. Choose the language you're using from the dropdown at the bottom right corner. Hover to copy with one click.
28
+
29
+ ```jsx
30
+ var a = 1;
31
+ while (a <= 10) {
32
+ document.write(a + "<br />");
33
+ a++;
34
+ }
35
+ ```
36
+
37
+ # Further Reading
38
+
39
+ Check out this [Notion guide](https://www.notion.so/68c7c67047494fdb87d50185429df93e) to learn about more ways to create content.
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Interviews 4be8039581d04456b0151f2cc4b22130.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Engineering Interviews
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Guides and Processes
6
+
7
+ <aside>
8
+ 💡 Use this template to document your approach to interviewing engineers!
9
+
10
+ </aside>
11
+
12
+ # Philosophy
13
+
14
+ Create a quote by typing `/quote` and pressing `enter`.
15
+
16
+ > Before you build a better mousetrap, it helps to know if there are any mice out there. —Yogi Berra
17
+ >
18
+
19
+ # Interview Question Database
20
+
21
+ <aside>
22
+ 💡 [Inline databases](https://www.notion.so/c523297c17634873a52317dd7a3e0b77) can be added to any page as tables, boards, calendars, lists or galleries. Just type `/database` to see your options.
23
+
24
+ </aside>
25
+
26
+ [Questions](Engineering%20Interviews%204be8039581d04456b0151f2cc4b22130/Questions%20ede8818b3a0e447f80145905690eb3f6.md)
27
+
28
+ # Further Reading
29
+
30
+ For more on databases, check out this [Notion guide](https://www.notion.so/fd8cd2d212f74c50954c11086d85997e).
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Interviews 4be8039581d04456b0151f2cc4b22130/Questions ede8818b3a0e447f80145905690eb3f6/Alphabet Ordering a3c46877392e4fff85a9dcf594f4e066.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Alphabet Ordering
2
+
3
+ Difficulty: Hard
4
+ Skills: Algorithms, Data Structures
5
+
6
+ # Description
7
+
8
+ Write a description for the interview question here.
9
+
10
+ # Sample Inputs
11
+
12
+ Give some valid inputs the candidate can expect to test their solution with.
13
+
14
+ - ...
15
+ - ...
16
+
17
+ # Expected Outputs
18
+
19
+ For each sample input above, list the expected output.
20
+
21
+ - ...
22
+ - ...
23
+
24
+ # Solutions
25
+
26
+ Provide possible solutions in common languages to this problem.
27
+
28
+ ### Javascript
29
+
30
+ ```jsx
31
+ function solution() {
32
+
33
+ }
34
+ ```
35
+
36
+ ### Python
37
+
38
+ ```python
39
+ def solution():
40
+ pass
41
+ ```
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Interviews 4be8039581d04456b0151f2cc4b22130/Questions ede8818b3a0e447f80145905690eb3f6/FizzBuzz 70828a5e5e6846a48686f66bb9ccc8b6.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FizzBuzz
2
+
3
+ Difficulty: Easy
4
+ Skills: Algorithms, Front end
5
+
6
+ <aside>
7
+ 💡 Create a new question in this database and choose `Interview Question` from the list of templates to automatically generate the format below.
8
+
9
+ </aside>
10
+
11
+ # Description
12
+
13
+ Write a description for the interview question here.
14
+
15
+ # Sample Inputs
16
+
17
+ Give some valid inputs the candidate can expect to test their solution with.
18
+
19
+ - ...
20
+ - ...
21
+
22
+ # Expected Outputs
23
+
24
+ For each sample input above, list the expected output.
25
+
26
+ - ...
27
+ - ...
28
+
29
+ # Solutions
30
+
31
+ Provide possible solutions in common languages to this problem.
32
+
33
+ ### Javascript
34
+
35
+ ```jsx
36
+ function solution() {
37
+
38
+ }
39
+ ```
40
+
41
+ ### Python
42
+
43
+ ```python
44
+ def solution():
45
+ pass
46
+ ```
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Interviews 4be8039581d04456b0151f2cc4b22130/Questions ede8818b3a0e447f80145905690eb3f6/To Do List Design 9d9cb6c13b4b4a0a8f7ab03a8c98a2d8.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # To Do List Design
2
+
3
+ Difficulty: Medium
4
+ Skills: Architecture, Backend, Front end
5
+
6
+ # Description
7
+
8
+ Write a description for the interview question here.
9
+
10
+ # Sample Inputs
11
+
12
+ Give some valid inputs the candidate can expect to test their solution with.
13
+
14
+ - ...
15
+ - ...
16
+
17
+ # Expected Outputs
18
+
19
+ For each sample input above, list the expected output.
20
+
21
+ - ...
22
+ - ...
23
+
24
+ # Solutions
25
+
26
+ Provide possible solutions in common languages to this problem.
27
+
28
+ ### Javascript
29
+
30
+ ```jsx
31
+ function solution() {
32
+
33
+ }
34
+ ```
35
+
36
+ ### Python
37
+
38
+ ```python
39
+ def solution():
40
+ pass
41
+ ```
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Engineering Wiki 8da06b3dcf1b4eaaa3e90aa70feefe56.md ADDED
@@ -0,0 +1 @@
 
 
1
+ # Engineering Wiki
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Getting Started 6bc871dcdd4a4554b5b22c0c40740841.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Getting Started
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Guides and Processes
6
+
7
+ <aside>
8
+ 💡 Notion Tip: When creating a page, it's important to give it a clear title and provide some content. This could include verifying the information, summarizing the topic, or sharing your thoughts and opinions on something that matters to you.
9
+
10
+ </aside>
11
+
12
+ # The Basics
13
+
14
+ ## Create a Page
15
+
16
+ In your sidebar, click the `+` that appears next to the word **Workspace** on hover. A new page will appear. Give it a title and start typing like you would in any other document.
17
+
18
+ ## Headings
19
+
20
+ You can add headings and subheadings in one of two ways:
21
+
22
+ - Type `/heading` or `/h1`, `/h2`, or `/h3` to choose the heading size you want.
23
+ - Use Markdown shortcuts, like `#`, `##`, and `###`.
24
+ - Create inline code by wrapping text with ``` (or with the shortcut `cmd/ctrl + e`).
25
+
26
+ ## Toggle Lists
27
+
28
+ - Toggle lists streamline your content. Click the arrow to open.
29
+ - Click the arrow again to hide this content.
30
+ - Create a toggle by typing `/toggle` and pressing `enter`.
31
+ - You can add anything to toggles, including images and embeds.
32
+
33
+ ## Callout Blocks
34
+
35
+ <aside>
36
+ 💡 Create a callout block like this by typing `/call` and pressing `enter`.
37
+ Helpful for adding inline instructions, warnings, disclaimers, and tips.
38
+ Change the emoji icon by clicking on it.
39
+
40
+ </aside>
41
+
42
+ ## Code Blocks
43
+
44
+ You can add code notation to any Notion page:
45
+
46
+ - Type `/code` and press `enter`.
47
+ - Choose the language from the dropdown in the bottom right corner.
48
+ - Here's an example:
49
+
50
+ ```html
51
+ Hover over this block to see the <b>Copy to Clipboard</b> option!
52
+ ```
53
+
54
+ - Your teammates can select any code to comment on it.
55
+
56
+ ## Organizing Pages
57
+
58
+ Instead of using folders, Notion lets you nest pages inside pages.
59
+
60
+ - Type `/page` and press `enter` to create a sub-page inside a page. Like this:
61
+
62
+ [Example sub-page](Getting%20Started%206bc871dcdd4a4554b5b22c0c40740841/Example%20sub-page%2048f64d6186ec4428b2e4180475245a9c.md)
63
+
64
+ # Advanced Techniques
65
+
66
+ Check out this [Notion Editor 101](https://www.notion.so/68c7c67047494fdb87d50185429df93e) guide for more advanced tips and how-to's.
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/How to Deploy b7c4f3fd308944af8ba4637ec40fa4f9.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # How to Deploy
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Guides and Processes
6
+
7
+ <aside>
8
+ 💡 Use this template to describe the steps engineers should follow to deploy.
9
+
10
+ </aside>
11
+
12
+ # 1. Ping in Slack #deploys channel
13
+
14
+ Let everyone know you're about to start a deploy.
15
+
16
+ # 2. SSH into the deployment server
17
+
18
+ <aside>
19
+ 💡 Create a code block by typing `/code` and pressing `enter`.
20
+
21
+ </aside>
22
+
23
+ ```bash
24
+ ssh deployments.acmecorp.com
25
+ ```
26
+
27
+ - You can create `inline code snippets` with the shortcut `cmd/ctrl + e`.
28
+
29
+ # 3. Run the following commands
30
+
31
+ ```bash
32
+ acme deploy --prod
33
+ ```
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/How to QA 2f036148193a4fccac2c9e8ae9e6d197.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # How to QA
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Guides and Processes, Testing
6
+
7
+ <aside>
8
+ 💡 This template explains our QA process for shipping bug-free software.
9
+
10
+ </aside>
11
+
12
+ # QA Philosophy
13
+
14
+ Write about your approach to QA and why it's critical to success.
15
+
16
+ # Processes
17
+
18
+ ### Making Code Changes
19
+
20
+ - Test PRs rigorously before requesting review.
21
+ - Include test cases you've checked for in your PR description.
22
+
23
+ ### Reviewing Code
24
+
25
+ - If the change is substantial and user-facing, pull down the branch.
26
+ - Test for cases (particularly edge cases) that the PR author may have missed.
27
+
28
+ ### QA
29
+
30
+ - Look at the list of items going out for release the next day.
31
+ - Go down the list one-by-one and thoroughly test changes.
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Redis 9e063b60eca24a1783c225cfdc21dd8c.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Redis
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Infrastructure
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Smart Domain 3b0daf8bb0d740439426cfab214f1fa6.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Smart Domain
2
+
3
+ Last edited time: April 23, 2023 3:59 PM
4
+ Owner: Anonymous
5
+ Tags: Architecture, DDD
6
+
7
+ [Smart Domain](https://github.com/Re-engineering-Domain-Driven-Design/Accounting/blob/main/public/Smart%20Domain%20Pattern.pdf?raw=true)是一种新的软件架构模式,主要用于实现领域驱动设计(DDD)。相较于传统的分层架构,Smart Domain更加注重从业务领域的角度去划分层次,并在每一层次上都使用领域专家和开发人员共同理解的通用语言进行交流,从而建立起完整的领域模型。与此同时,Smart Domain还摒弃了服务层的概念,将原本在服务层实现的逻辑下沉到领域模型中,从而让领域模型更加丰满和清晰。
8
+
9
+ 总之,Smart Domain是一种新的软件架构模式,通过从业务领域的角度去划分层次和使用通用语言建立领域模型,以及将服务层逻辑下沉到领域模型中,提高了领域驱动设计的实现效果。
10
+
11
+ [https://github.com/Re-engineering-Domain-Driven-Design/Accounting](https://github.com/Re-engineering-Domain-Driven-Design/Accounting)
12
+
13
+ [直播加餐02|如何使用Smart Domain实现DDD?-极客时间](https://time.geekbang.org/column/article/556440)
14
+
15
+ ## SmartDomain 分层
16
+
17
+ 1. Domain层
18
+ Domain层是整个系统的核心,主要定义业务相关的实体(Entity)和表示实体之间关联关系的关联对象。该层定义的实体和关联对象是业务模型的核心,反映了整个系统的业务规则和逻辑。同时,该层仅提供接口或抽象类定义,不包含具体实现。这样做可以避免业务逻辑和实现细节的混淆,也方便后续的扩展和维护。
19
+ 2. 集成层
20
+ 集成层主要负责Domain层中关系对象的实现,该层会依赖数据库、Http接口访问进行功能实现。该层的职责是将Domain层的抽象定义转换成具体实现,包括数据持久化、网络通信等。该层还可以处理一些跨域访问和数据加密解密等底层功能。
21
+ 3. API层
22
+ API层是整个系统的入口,基于Domain层的Entity或关联对象提供的能力,提供外部访问的RestFul接口。该层负责处理外部请求,将请求参数转换成业务对象并调用Domain层的业务逻辑实现,返回结果给客户端。该层还可以对请求参数进行验证、安全过滤等操作,保证系统的安全性和可靠性。
23
+
24
+ - chat prompt
25
+
26
+ Smart Domain 架构模式,将系统架构分为三层:
27
+
28
+ 1. Domain层 - 定义与业务相关的实体(Entity),表示业务概念和实体之间的关联关系的关联对象。关联对象通常是一个集合概念,表示实体的集合。关联对象仅提供接口或抽象类的定义,不包含具体实现。Domain层没有Repository、Service等技术型组件。
29
+ 2. 集成层 - 提供Domain层中关联对象的实现。该层会依赖数据库、Http接口等进行功能实现。
30
+ 3. API层 - 基于Domain层的实体或关联对象提供的能力,提供外部访问的RestFul接口。
31
+
32
+ ## 构建项目脚手架
33
+
34
+ 使用 Smart Domain 架构模式,本系统采用 Spring Boot 3.X、Java 17、Spring WebFlux、Spring Data reactive CouchBase、WebClient、Spring RSocket 等技术栈,并通过多模块实现分层管理。
35
+
36
+ 创建脚手架项目步骤:
37
+
38
+ > 请给出脚手架项目搭建总体步骤,先不用给出具体操作
39
+ >
40
+ - 创建 Gradle 多模块项目
41
+
42
+ > 请仅给出创建 Gradle 多模块项目时root project的创建步骤
43
+ >
44
+ - 创建root project
45
+ 1. 创建 Gradle 多模块项目(如果未安装 Gradle,需要先安装)
46
+ 1. 打开Intellij IDEA,选择"Create New Project"。
47
+ 2. 在新建项目向导中,选择"Gradle"。
48
+ 3. 选择"Create New Project"并点击"Next"。
49
+ 4. 在"Project SDK"下拉菜单中选择您想要使用的Java JDK版本,并点击"Next"。
50
+ 5. 输入项目名称和项目路径,并点击"Finish"。
51
+ 6. 删除src目录
52
+ - 创建sub module
53
+
54
+ 创建sub module的步骤为:
55
+
56
+ 1. 在root project的根目录下,使用命令行或终端创建一个新的子目录。
57
+ 2. 进入子目录,并在其中创建一个新的Gradle项目。
58
+ 3. 在root project的settings.gradle文件中,添加新的sub module。
59
+ 4. 在root project的build.gradle文件中,定义新的sub module的依赖关系和构建任务。
60
+
61
+ - 创建root project
62
+ 1. 创建 Gradle 多模块项目(如果未安装 Gradle,需要先安装)
63
+ 1. 打开Intellij IDEA,选择"Create New Project"。
64
+ 2. 在新建项目向导中,选择"Gradle"。
65
+ 3. 选择"Create New Project"并点击"Next"。
66
+ 4. 在"Project SDK"下拉菜单中选择您想要使用的Java JDK版本,并点击"Next"。
67
+ 5. ��入项目名称和项目路径,并点击"Finish"。
68
+ 6. 删除src目录
69
+ - 创建sub module
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Useful Commands 8a05b1de77ec44b6a55e388c2cc7fe47.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Useful Commands
2
+
3
+ Last edited time: March 31, 2023 1:49 PM
4
+ Owner: Anonymous
5
+ Tags: Codebase, Guides and Processes
6
+
7
+ <aside>
8
+ 💡 Frequently used commands. This is a helpful page to [add to your Favorites](https://www.notion.so/7ef7287cee00464d9a813073b02ce24a).
9
+
10
+ </aside>
11
+
12
+ # 🚚 Run Locally
13
+
14
+ In the `acme` directory, run:
15
+
16
+ ```bash
17
+ acme run --local
18
+ ```
19
+
20
+ For a full list of options, use:
21
+
22
+ ```bash
23
+ acme --help
24
+ ```
25
+
26
+ To run the typechecker on the entire codebase:
27
+
28
+ ```bash
29
+ acme typecheck
30
+ ```
31
+
32
+ # 🚢 Deployment
33
+
34
+ When you deploy to staging or production, run the following on the deployment server:
35
+
36
+ ```bash
37
+ acme deploy --staging
38
+ ```
39
+
40
+ Replace `--staging` with `--prod` if deploying production.
documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/VUE 9501304a2b03470cad0eea93992d65ae.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VUE
2
+
3
+ Last edited time: March 31, 2023 1:56 PM
4
+ Owner: Anonymous
5
+ Tags: Codebase
6
+
7
+ <aside>
8
+ 💡 This template provides context/instructions for the languages you use.
9
+
10
+ </aside>
11
+
12
+ # TypeScript
13
+
14
+ We use VUE3 with TypeScript for our frontend codebase.
15
+
16
+ # Code Style Guide
17
+
18
+ We largely follow Airbnb's React/JSX Style Guide:
19
+
20
+ [Style Guide | Vue.js](https://vuejs.org/style-guide/)
documents/{business_context.md → bussiness_context/business_context.md} RENAMED
File without changes
embedding.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain.document_loaders import TextLoader, NotionDirectoryLoader
2
+ from langchain.text_splitter import SpacyTextSplitter
3
+ from langchain.embeddings import HuggingFaceEmbeddings
4
+ from langchain.vectorstores import FAISS
5
+ from langchain.chains import RetrievalQA
6
+ from langchain.document_loaders import TextLoader, NotionDirectoryLoader
7
+ from langchain.vectorstores.base import VectorStoreRetriever
8
+ from langchain.llms import OpenAI
9
+
10
+
11
+ class CustomEmbedding:
12
+ notionDirectoryLoader = NotionDirectoryLoader(
13
+ "documents/bussiness_context")
14
+ embeddings = HuggingFaceEmbeddings()
15
+
16
+ def calculateEmbedding(self):
17
+ documents = self.notionDirectoryLoader.load()
18
+ text_splitter = SpacyTextSplitter(
19
+ chunk_size=256, pipeline="zh_core_web_sm", chunk_overlap=200)
20
+ texts = text_splitter.split_documents(documents)
21
+
22
+ docsearch = FAISS.from_documents(texts, self.embeddings)
23
+ docsearch.save_local(
24
+ folder_path="./documents/business_context.faiss")
25
+
26
+ def getFAQChain(self, llm=OpenAI(temperature=0.7)):
27
+ docsearch = FAISS.load_local(
28
+ "./documents/business_context.faiss", self.embeddings)
29
+ retriever = VectorStoreRetriever(vectorstore=docsearch)
30
+ faq_chain = RetrievalQA.from_llm(
31
+ llm=llm, retriever=retriever, verbose=True)
32
+ return faq_chain
33
+
34
+
35
+ # customerEmbedding = CustomEmbedding()
36
+ # # customerEmbedding.calculateEmbedding()
37
+ # # customerEmbedding.calculateNotionEmbedding()
38
+
39
+ # faq_chain = customerEmbedding.getFAQChain()
40
+ # result = faq_chain.run(
41
+ # "Smart Domain 分层架构")
42
+
43
+ # print(result)