Skip to content

Commit 0a4fcc9

Browse files
Fixed the PR review comments
1 parent 97b0907 commit 0a4fcc9

4 files changed

Lines changed: 358 additions & 8 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Trace",
5+
"Microsoft.AspNetCore": "Trace"
6+
}
7+
},
8+
"AllowedHosts": "*",
9+
"ConnectionStrings": {
10+
"AppConfig": "https://<app-config-name>.azconfig.io" // Replace with the Azure App Configuration endpoint URL
11+
}
12+
}
13+
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
{
2+
"ConnectionStrings": {
3+
"AppConfig": "https://<app-config-name>.azconfig.io" // Replace with the "AppConfig": "https://<app-config-name>.azconfig.io" // Replace with the Azure App Configuration endpoint URL
4+
},
5+
"KernelMemory": {
6+
"Service": {
7+
"RunWebService": true,
8+
"RunHandlers": true,
9+
"OpenApiEnabled": true,
10+
"Handlers": {
11+
"extract": {
12+
"Assembly": "Microsoft.KernelMemory.Core.dll",
13+
"Class": "Microsoft.KernelMemory.Handlers.TextExtractionHandler"
14+
},
15+
"keyword_extract": {
16+
"Assembly": "Microsoft.KernelMemory.Core.dll",
17+
"Class": "Microsoft.KernelMemory.Handlers.KeywordExtractingHandler"
18+
},
19+
"partition": {
20+
"Assembly": "Microsoft.KernelMemory.Core.dll",
21+
"Class": "Microsoft.KernelMemory.Handlers.TextPartitioningHandler"
22+
},
23+
"gen_embeddings": {
24+
"Assembly": "Microsoft.KernelMemory.Core.dll",
25+
"Class": "Microsoft.KernelMemory.Handlers.GenerateEmbeddingsHandler"
26+
},
27+
"save_records": {
28+
"Assembly": "Microsoft.KernelMemory.Core.dll",
29+
"Class": "Microsoft.KernelMemory.Handlers.SaveRecordsHandler"
30+
},
31+
"summarize": {
32+
"Assembly": "Microsoft.KernelMemory.Core.dll",
33+
"Class": "Microsoft.KernelMemory.Handlers.SummarizationHandler"
34+
},
35+
"delete_generated_files": {
36+
"Assembly": "Microsoft.KernelMemory.Core.dll",
37+
"Class": "Microsoft.KernelMemory.Handlers.DeleteGeneratedFilesHandler"
38+
},
39+
"private_delete_document": {
40+
"Assembly": "Microsoft.KernelMemory.Core.dll",
41+
"Class": "Microsoft.KernelMemory.Handlers.DeleteDocumentHandler"
42+
},
43+
"private_delete_index": {
44+
"Assembly": "Microsoft.KernelMemory.Core.dll",
45+
"Class": "Microsoft.KernelMemory.Handlers.DeleteIndexHandler"
46+
},
47+
"disabled_handler_example": {
48+
"Assembly": "",
49+
"Class": ""
50+
}
51+
}
52+
},
53+
"ContentStorageType": "",
54+
"DocumentStorageType": "AzureBlobs",
55+
"TextGeneratorType": "AzureOpenAIText",
56+
"DefaultIndexName": "default",
57+
"ServiceAuthorization": {
58+
"Enabled": false,
59+
"AuthenticationType": "APIKey",
60+
"HttpHeaderName": "Authorization",
61+
"AccessKey1": "",
62+
"AccessKey2": ""
63+
},
64+
"DataIngestion": {
65+
"OrchestrationType": "Distributed",
66+
"DistributedOrchestration": {
67+
"QueueType": "AzureQueues"
68+
},
69+
"EmbeddingGenerationEnabled": true,
70+
"EmbeddingGeneratorTypes": [
71+
"AzureOpenAIEmbedding"
72+
],
73+
"MemoryDbTypes": [
74+
"AzureAISearch"
75+
],
76+
"MemoryDbUpsertBatchSize": 1,
77+
"ImageOcrType": "AzureAIDocIntel",
78+
"TextPartitioning": {
79+
"MaxTokensPerParagraph": 1000,
80+
"MaxTokensPerLine": 300,
81+
"OverlappingTokens": 100
82+
},
83+
"DefaultSteps": []
84+
},
85+
"Retrieval": {
86+
"MemoryDbType": "AzureAISearch",
87+
"EmbeddingGeneratorType": "AzureOpenAIEmbedding",
88+
"SearchClient": {
89+
"MaxAskPromptSize": -1,
90+
"MaxMatchesCount": 200,
91+
"AnswerTokens": 16384,
92+
"EmptyAnswer": "No Information",
93+
"FactTemplate": "==== [File:{{$source}};Relevance:{{$relevance}}]:\n{{$content}}",
94+
"Temperature": 0.0,
95+
"TopP": 0.0,
96+
"PresencePenalty": 0.0,
97+
"FrequencyPenalty": 0.0,
98+
"StopSequences": [],
99+
"TokenSelectionBiases": {}
100+
}
101+
},
102+
"Services": {
103+
"Anthropic": {
104+
"Endpoint": "https://api.anthropic.com",
105+
"EndpointVersion": "2023-06-01",
106+
"ApiKey": "",
107+
"TextModelName": "claude-3-haiku-20240307",
108+
"MaxTokenIn": 200000,
109+
"MaxTokenOut": 4096,
110+
"DefaultSystemPrompt": "You are an assistant that will answer user query based on a context",
111+
"HttpClientName": ""
112+
},
113+
"AWSS3": {
114+
"Auth": "AccessKey",
115+
"AccessKey": "",
116+
"SecretAccessKey": "",
117+
"BucketName": ""
118+
},
119+
"AzureAISearch": {
120+
"Auth": "ApiKey",
121+
"Endpoint": "",
122+
"APIKey": "",
123+
"UseHybridSearch": true
124+
},
125+
"AzureAIDocIntel": {
126+
"Auth": "ApiKey",
127+
"APIKey": "",
128+
"Endpoint": ""
129+
},
130+
"AzureBlobs": {
131+
"Auth": "AzureIdentity",
132+
"Account": "",
133+
"Container": "",
134+
"ConnectionString": "",
135+
"EndpointSuffix": "core.windows.net"
136+
},
137+
"AzureOpenAIEmbedding": {
138+
"Auth": "ApiKey",
139+
"Endpoint": "",
140+
"APIKey": "",
141+
"Deployment": "",
142+
"MaxTokenTotal": 8191,
143+
"EmbeddingDimensions": null,
144+
"MaxEmbeddingBatchSize": 1,
145+
"MaxRetries": 10,
146+
"APIType": "EmbeddingGeneration"
147+
},
148+
"AzureOpenAIText": {
149+
"Auth": "ApiKey",
150+
"Endpoint": "",
151+
"APIKey": "",
152+
"Deployment": "",
153+
"MaxTokenTotal": 128000,
154+
"APIType": "ChatCompletion",
155+
"MaxRetries": 10
156+
},
157+
"AzureQueues": {
158+
"Auth": "AzureIdentity",
159+
"Account": "",
160+
"ConnectionString": "",
161+
"EndpointSuffix": "core.windows.net",
162+
"PollDelayMsecs": 100,
163+
"FetchBatchSize": 3,
164+
"FetchLockSeconds": 300,
165+
"MaxRetriesBeforePoisonQueue": 20,
166+
"PoisonQueueSuffix": "-poison"
167+
},
168+
"Elasticsearch": {
169+
"CertificateFingerPrint": "",
170+
"Endpoint": "",
171+
"UserName": "",
172+
"Password": "",
173+
"IndexPrefix": "",
174+
"ShardCount": 1,
175+
"Replicas": 0
176+
},
177+
"LlamaSharp": {
178+
"ModelPath": "",
179+
"MaxTokenTotal": 4096
180+
},
181+
"MongoDbAtlas": {
182+
"ConnectionString": "mongodb://root:root@localhost:27777/?authSource=admin",
183+
"DatabaseName": "KernelMemory",
184+
"UseSingleCollectionForVectorSearch": false
185+
},
186+
"OpenAI": {
187+
"TextModel": "gpt-3.5-turbo-16k",
188+
"TextModelMaxTokenTotal": 16384,
189+
"TextGenerationType": "Auto",
190+
"EmbeddingModel": "text-embedding-ada-002",
191+
"EmbeddingModelMaxTokenTotal": 8191,
192+
"APIKey": "",
193+
"OrgId": "",
194+
"Endpoint": "",
195+
"MaxRetries": 10,
196+
"EmbeddingDimensions": null,
197+
"MaxEmbeddingBatchSize": 100
198+
},
199+
"Postgres": {
200+
"ConnectionString": "Host=localhost;Port=5432;Username=public;Password=;Database=public",
201+
"TableNamePrefix": "km-"
202+
},
203+
"Qdrant": {
204+
"Endpoint": "http://127.0.0.1:6333",
205+
"APIKey": ""
206+
},
207+
"RabbitMQ": {
208+
"Host": "127.0.0.1",
209+
"Port": "5672",
210+
"Username": "user",
211+
"Password": "",
212+
"VirtualHost": "/",
213+
"MessageTTLSecs": 3600,
214+
"SslEnabled": false
215+
},
216+
"Redis": {
217+
"ConnectionString": "",
218+
"Tags": {
219+
"type": ",",
220+
"user": ",",
221+
"ext": ","
222+
}
223+
},
224+
"SimpleFileStorage": {
225+
"StorageType": "Volatile",
226+
"Directory": "_files"
227+
},
228+
"SimpleQueues": {
229+
"StorageType": "Volatile",
230+
"Directory": "_queues"
231+
},
232+
"SimpleVectorDb": {
233+
"StorageType": "Volatile",
234+
"Directory": "_vectors"
235+
},
236+
"SqlServer": {
237+
"ConnectionString": "",
238+
"Schema": "dbo",
239+
"MemoryCollectionTableName": "KMCollections",
240+
"MemoryTableName": "KMMemories",
241+
"EmbeddingsTableName": "KMEmbeddings",
242+
"TagsTableName": "KMMemoriesTags"
243+
}
244+
}
245+
},
246+
"Logging": {
247+
"LogLevel": {
248+
"Default": "Trace",
249+
"ASPNETCore": "Trace"
250+
}
251+
},
252+
"AllowedHosts": "*"
253+
}

docs/LocalSetupGuide.md

Lines changed: 92 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,57 @@ corepack prepare yarn@stable --activate
6767
dotnet --version
6868
yarn --version
6969
```
70+
## Step 2: Azure Authentication Setup
7071

71-
## Step 2: Backend Setup
72+
Before configuring services, authenticate with Azure:
73+
74+
```bash
75+
# Login to Azure CLI
76+
az login
77+
78+
# Set your subscription
79+
az account set --subscription "your-subscription-id"
80+
81+
# Verify authentication
82+
az account show
83+
```
84+
85+
### Get Azure App Configuration URL
86+
87+
Navigate to your resource group and select the resource with prefix `appcs-` to get the configuration URL:
88+
89+
```bash
90+
APP_CONFIGURATION_URL=https://[Your app configuration service name].azconfig.io
91+
```
92+
93+
For reference, see the image below:
94+
![local_developement_setup_1](./images/local_development_setup_1.png)
95+
96+
### Required Azure RBAC Permissions
97+
98+
To run the application locally, your Azure account needs the following role assignments on the deployed resources:
99+
100+
#### App Configuration Access
101+
```bash
102+
# Get your principal ID
103+
PRINCIPAL_ID=$(az ad signed-in-user show --query id -o tsv)
104+
105+
# Assign App Configuration Data Reader role
106+
az role assignment create \
107+
--assignee $PRINCIPAL_ID \
108+
--role "App Configuration Data Reader" \
109+
--scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.AppConfiguration/configurationStores/<appconfig-name>"
110+
```
111+
112+
#### Other Required Roles
113+
Depending on the features you use, you may also need:
114+
- **Storage Blob Data Contributor** - For Azure Storage operations
115+
- **Storage Queue Data Contributor** - For queue-based processing
116+
- **Storage Blob Data Reader** - For read-only access to blob data
117+
118+
**Note**: RBAC permission changes can take 5-10 minutes to propagate. If you encounter "Forbidden" errors after assigning roles, wait a few minutes and try again.
119+
120+
## Step 3: Backend Setup
72121

73122
### 1. Clone the Repository
74123

@@ -92,15 +141,50 @@ Navigate to the cloned repository and open the following solution files from Vis
92141

93142
---
94143

95-
### 3. Verify `appsettings.Development.json`
144+
### 3. Create/Verify `appsettings.Development.json` Files
96145

97-
After deploying the accelerator, the `appsettings.Development.json` file will be created automatically.
146+
**After deploying the accelerator**, the `appsettings.Development.json` file should be created automatically. If you are using a deployed resource group that was **not deployed from your machine**, you will need to create these files manually.
98147

99-
- **KernelMemory Solution:**
100-
Expand the `appsettings.json` file under the **Service** project (inside the `service` folder) and confirm that `appsettings.Development.json` exists.
148+
#### KernelMemory Solution
101149

102-
- **Microsoft.GS.DPS Solution:**
103-
Expand the `appsettings.json` file under the **Microsoft.GS.DPS.Host** project and confirm that `appsettings.Development.json` exists.
150+
1. In the **Service** project (inside the `service` folder), expand the `appsettings.json` file.
151+
2. Confirm that `appsettings.Development.json` exists.
152+
3. If it does not exist, create it manually by copying the sample file:
153+
154+
```bash
155+
cd "document-knowledge-Mining-Solution-Accelerator\App\kernel-memory\service\Service"
156+
# Copy the example file
157+
cp appsettings.Development.json.sample appsettings.Development.json # Linux
158+
# or
159+
Copy-Item appsettings.Development.json.sample appsettings.Development.json # Windows PowerShell
160+
```
161+
162+
4. Edit the `appsettings.Development.json` file with your Azure App Configuration URL:
163+
164+
```json
165+
"AppConfig": "https://<app-config-name>.azconfig.io"
166+
// replace the app configuration name from the deployed resource group.
167+
```
168+
#### Microsoft.GS.DPS Solution
169+
170+
1. In the **Microsoft.GS.DPS.Host** project, expand the `appsettings.json` file.
171+
2. Confirm that `appsettings.Development.json` exists.
172+
3. If it does not exist, create it manually by copying the sample file:
173+
174+
```bash
175+
cd "document-knowledge-Mining-Solution-Accelerator\App\backend-api\Microsoft.GS.DPS.Host"
176+
# Copy the example file
177+
cp appsettings.Development.json.sample appsettings.Development.json # Linux
178+
# or
179+
Copy-Item appsettings.Development.json.sample appsettings.Development.json # Windows PowerShell
180+
```
181+
182+
4. Edit the `appsettings.Development.json` file with your Azure App Configuration URL:
183+
184+
```json
185+
"AppConfig": "https://<app-config-name>.azconfig.io"
186+
// replace the app configuration name from the deployed resource group.
187+
```
104188

105189
---
106190

@@ -166,7 +250,7 @@ After deploying the accelerator, the `appsettings.Development.json` file will be
166250
---
167251
168252
169-
## Step 3: Frontend Setup
253+
## Step 4: Frontend Setup
170254
171255
1. Open the repo in **VS Code**.
172256
2. Navigate to the `App/frontend-app` folder and locate the `.env` file.
129 KB
Loading

0 commit comments

Comments
 (0)