The WebAPI backend should invoke CreateCollectionAsync once at least for each chat session when use PostgresMemoryStore and local postgresql database as vectors MemoryStore
"MemoryStore": {
"Type": "postgres",
"Qdrant": {
"Host": "http://localhost",
"Port": "6333",
"VectorSize": 1536
// "Key": ""
},
"AzureCognitiveSearch": {
"Endpoint": ""
// "Key": ""
},
"Chroma": {
"Host": "http://localhost",
"Port": "8000"
},
"Postgres": {
"VectorSize": 1536
// "ConnectionString": // dotnet user-secrets set "MemoryStore:Postgres:ConnectionString" "MY_POSTGRES_CONNECTION_STRING"
}
},
{
"AIService:Key": "eeXXXXXXXXXXXXXXXXXXXXXXX",
"MemoryStore:Postgres:ConnectionString": "Host=localhost;Database=postgres;User Id=postgres;Password=password01!"
}
fail: Microsoft.SemanticKernel.IKernel[0]
Something went wrong while executing the native function. Function: <GetDelegateInfo>b__0. Error: 42P01: relation "public.d8ff415b-167b-4b1a-8dd8-7d62f97f120d-LongTermMemory" does not exist
POSITION: 115
Npgsql.PostgresException (0x80004005): 42P01: relation "public.d8ff415b-167b-4b1a-8dd8-7d62f97f120d-LongTermMemory" does not exist
POSITION: 115
at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|221_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Microsoft.SemanticKernel.Connectors.Memory.Postgres.PostgresDbClient.GetNearestMatchesAsync(String tableName, Vector embedding, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext() in D:\MyGitHub\semantic-kernel@microshaoft-Debug\dotnet\src\Connectors\Connectors.Memory.Postgres\PostgresDbClient.cs:line 166
at Microsoft.SemanticKernel.Connectors.Memory.Postgres.PostgresDbClient.GetNearestMatchesAsync(String tableName, Vector embedding, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext() in D:\MyGitHub\semantic-kernel@microshaoft-Debug\dotnet\src\Connectors\Connectors.Memory.Postgres\PostgresDbClient.cs:line 173
at Microsoft.SemanticKernel.Connectors.Memory.Postgres.PostgresDbClient.GetNearestMatchesAsync(String tableName, Vector embedding, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at Microsoft.SemanticKernel.Connectors.Memory.Postgres.PostgresMemoryStore.GetNearestMatchesAsync(String collectionName, ReadOnlyMemory`1 embedding, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext() in D:\MyGitHub\semantic-kernel@microshaoft-Debug\dotnet\src\Connectors\Connectors.Memory.Postgres\PostgresMemoryStore.cs:line 160
at Microsoft.SemanticKernel.Connectors.Memory.Postgres.PostgresMemoryStore.GetNearestMatchesAsync(String collectionName, ReadOnlyMemory`1 embedding, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext() in D:\MyGitHub\semantic-kernel@microshaoft-Debug\dotnet\src\Connectors\Connectors.Memory.Postgres\PostgresMemoryStore.cs:line 160
at Microsoft.SemanticKernel.Connectors.Memory.Postgres.PostgresMemoryStore.GetNearestMatchesAsync(String collectionName, ReadOnlyMemory`1 embedding, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at Microsoft.SemanticKernel.Memory.SemanticTextMemory.SearchAsync(String collection, String query, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext() in D:\MyGitHub\semantic-kernel@microshaoft-Debug\dotnet\src\SemanticKernel\Memory\SemanticTextMemory.cs:line 114
at Microsoft.SemanticKernel.Memory.SemanticTextMemory.SearchAsync(String collection, String query, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext() in D:\MyGitHub\semantic-kernel@microshaoft-Debug\dotnet\src\SemanticKernel\Memory\SemanticTextMemory.cs:line 114
at Microsoft.SemanticKernel.Memory.SemanticTextMemory.SearchAsync(String collection, String query, Int32 limit, Double minRelevanceScore, Boolean withEmbeddings, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at CopilotChat.WebApi.Skills.ChatSkills.SemanticChatMemorySkill.QueryMemoriesAsync(String query, String chatId, Int32 tokenLimit, ISemanticTextMemory textMemory) in D:\MyGitHub\semantic-kernel@microshaoft-Debug\chat-copilot\webapi\Skills\ChatSkills\SemanticChatMemorySkill.cs:line 78
at CopilotChat.WebApi.Skills.ChatSkills.SemanticChatMemorySkill.QueryMemoriesAsync(String query, String chatId, Int32 tokenLimit, ISemanticTextMemory textMemory) in D:\MyGitHub\semantic-kernel@microshaoft-Debug\chat-copilot\webapi\Skills\ChatSkills\SemanticChatMemorySkill.cs:line 78
at CopilotChat.WebApi.Skills.ChatSkills.ChatSkill.GetChatResponseAsync(String chatId, String userId, SKContext chatContext, CancellationToken cancellationToken) in D:\MyGitHub\semantic-kernel@microshaoft-Debug\chat-copilot\webapi\Skills\ChatSkills\ChatSkill.cs:line 377
at CopilotChat.WebApi.Skills.ChatSkills.ChatSkill.ChatAsync(String message, String userId, String userName, String chatId, String messageType, String planJson, String messageId, SKContext context, CancellationToken cancellationToken) in D:\MyGitHub\semantic-kernel@microshaoft-Debug\chat-copilot\webapi\Skills\ChatSkills\ChatSkill.cs:line 299 at Microsoft.SemanticKernel.SkillDefinition.NativeFunction.InvokeAsync(SKContext context, CompleteRequestSettings settings, CancellationToken cancellationToken) in D:\MyGitHub\semantic-kernel@microshaoft-Debug\dotnet\src\SemanticKernel\SkillDefinition\NativeFunction.cs:line 165
Exception data:
Severity: ERROR
SqlState: 42P01
MessageText: relation "public.d8ff415b-167b-4b1a-8dd8-7d62f97f120d-LongTermMemory" does not exist
Position: 115
File: parse_relation.c
Line: 1371
Routine: parserOpenTable
Describe the bug
The WebAPI backend should invoke CreateCollectionAsync once at least for each chat session when use PostgresMemoryStore and local postgresql database as vectors MemoryStore
To Reproduce
Steps to reproduce the behavior:
CopilotChatWebApiappsettings.jsonExpected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
error when search vector in PostgresMemoryStore, but maybe it's not root cause

For reference, the below code is in

Connectors.Memory.Postgresproject , it belongs toSemantic-Kernel, not belong tochat-copilotI have debugged chat-copilot and semantic-kernel code ,I can't break in the break points in below screenshot:
Platform
Additional context
Add any other context about the problem here.