diff --git a/OpenJibo/docs/feature-backlog.md b/OpenJibo/docs/feature-backlog.md index a8a4997..f928f29 100644 --- a/OpenJibo/docs/feature-backlog.md +++ b/OpenJibo/docs/feature-backlog.md @@ -830,6 +830,7 @@ Current release theme: - personality and capability questions - favorite-style prompts like `what is your favorite color` - mood / affect questions + - recognition follow-ups like `do you know me` - follow-up state prompts that should stay warm and locally grounded - Next pass targets: - document the remaining persona inventory so we keep a clean checklist for the next passes diff --git a/OpenJibo/docs/release-1.0.19-plan.md b/OpenJibo/docs/release-1.0.19-plan.md index 5fd48a9..4a721e2 100644 --- a/OpenJibo/docs/release-1.0.19-plan.md +++ b/OpenJibo/docs/release-1.0.19-plan.md @@ -31,6 +31,7 @@ Keep a running checklist of the legacy persona questions and identity surfaces w - affect and mood: `how are you`, `are you happy`, `are you sad`, `are you angry` - memory and identity recall: `who am i`, `what is my name`, `when is my birthday`, `what is my favorite music` - greeting and presence charm: `good morning`, `welcome back`, `who is this`, person-aware greeting follow-ups +- recognition follow-ups: `do you know me`, `do you remember me`, `can you recognize me` - seasonal and contextual charm: holiday prompts, pizza day, surprise offers, personal report personality hooks - conversational follow-ups that should stay local and warm instead of falling into generic chat diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.cs index eb28075..9b2f9ac 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/JiboInteractionService.cs @@ -3822,7 +3822,11 @@ public sealed class JiboInteractionService( "what s my name", "what's my name", "who am i", - "do you remember my name"); + "do you remember my name", + "do you know me", + "do you remember me", + "who is this", + "can you recognize me"); } private static string? TryExtractNameFact(string transcript) diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs index 04ca5c0..c9f14e3 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/WebSockets/JiboInteractionServiceTests.cs @@ -231,6 +231,49 @@ public sealed class JiboInteractionServiceTests Assert.Equal("I think you are Sam.", decision.ReplyText); } + [Theory] + [InlineData("do you know me")] + [InlineData("do you remember me")] + [InlineData("who is this")] + [InlineData("can you recognize me")] + public async Task BuildDecisionAsync_IdentityFollowUp_UsesPersonScopedNameWhenSpeakerIsKnown(string transcript) + { + var memoryStore = new InMemoryPersonalMemoryStore(); + memoryStore.SetName(new PersonalMemoryTenantScope("acct-c", "loop-c", "device-c", "person-3"), "taylor"); + var service = CreateService(memoryStore); + + var decision = await service.BuildDecisionAsync(new TurnContext + { + RawTranscript = transcript, + NormalizedTranscript = transcript, + Attributes = new Dictionary + { + ["accountId"] = "acct-c", + ["loopId"] = "loop-c", + ["context"] = """{"runtime":{"perception":{"speaker":"person-3"},"loop":{"users":[{"id":"person-3","firstName":"taylor"}]}}}""" + }, + DeviceId = "device-c" + }); + + Assert.Equal("memory_get_name", decision.IntentName); + Assert.Equal("I think you are Taylor.", decision.ReplyText); + } + + [Fact] + public async Task BuildDecisionAsync_IdentityFollowUp_RequestsNameWhenSpeakerIsUnknown() + { + var service = CreateService(); + + var decision = await service.BuildDecisionAsync(new TurnContext + { + RawTranscript = "do you know me", + NormalizedTranscript = "do you know me" + }); + + Assert.Equal("memory_get_name", decision.IntentName); + Assert.Equal("I do not know your name yet. You can say, my name is Alex.", decision.ReplyText); + } + [Fact] public async Task BuildDecisionAsync_TriggerWithKnownIdentity_BuildsProactiveGreetingAndContext() {