Add FTS lookup for seeded Civitai Krea2 prompt examples.

Index Assistent/civitai-examples.jsonl without embeddings and expose AssistentLookupExamples plus ask:examples hop for remix references.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-23 08:15:40 +03:00
co-authored by Cursor
parent 7aadb40a11
commit e2d48b4bf9
8 changed files with 454 additions and 3 deletions
+31
View File
@@ -240,6 +240,37 @@ public partial class SwarmAssistentExtension
}
}
public async Task<JObject> AssistentLookupExamples(Session session, string query, int limit = 5, string rating = null)
{
await Task.CompletedTask;
if (Memory is null)
{
return new JObject { ["error"] = "memory not ready" };
}
query = (query ?? "").Trim();
if (query.Length < 1)
{
return new JObject { ["error"] = "query required" };
}
try
{
JArray examples = Memory.LookupExamples(query, limit, rating);
return new JObject
{
["success"] = true,
["query"] = query,
["rating"] = rating ?? "",
["examples"] = examples,
["indexed"] = Memory.ExampleCount(),
["path"] = Memory.FindCivitaiExamplesJsonl() ?? "",
};
}
catch (Exception ex)
{
return new JObject { ["error"] = $"example lookup: {ex.Message}" };
}
}
public async Task<JObject> AssistentClearMemory(Session session, string scope = null, string kind = null, string persona = null)
{
await Task.CompletedTask;