Summarize indexed knowledge sources by topic in chat

This commit is contained in:
Mark Gregory
2026-11-17 10:29:53 +00:00
parent e4f9b5d42d
commit 47338fbeaa
3 changed files with 58 additions and 7 deletions
+11 -1
View File
@@ -879,7 +879,7 @@ final class ConnectedChatTests: XCTestCase {
let studio = StudioModel()
studio.open(databaseURL: folder.appending(path: "studio.sqlite"))
studio.connectMCP(.profile("local-knowledge"), name: "local-knowledge") { try profile.makeClient() }
studio.prompt = "List all topics in our knowledge base"
studio.prompt = "List all documents in our knowledge base"
studio.send(endpoint: "", model: "", mlxPath: "", thinking: .off, failover: false,
mlxOnly: false, compatible: false, recall: false, useDocuments: false,
instructions: "", settings: GenerationSettings())
@@ -892,6 +892,16 @@ final class ConnectedChatTests: XCTestCase {
let listed = reply.content.split(separator: "\n").filter { $0.hasPrefix("• ") }
XCTAssertGreaterThan(listed.count, 200)
XCTAssertEqual(Set(listed).count, listed.count)
studio.prompt = "List all topics in our knowledge base"
studio.send(endpoint: "", model: "", mlxPath: "", thinking: .off, failover: false,
mlxOnly: false, compatible: false, recall: false, useDocuments: false,
instructions: "", settings: GenerationSettings())
while studio.running && ContinuousClock.now < deadline { try await Task.sleep(for: .milliseconds(50)) }
XCTAssertFalse(studio.running)
let overview = try XCTUnwrap(studio.messages.last)
XCTAssertTrue(overview.content.contains("Topic overview for \(listed.count.formatted()) indexed sources"))
XCTAssertTrue(overview.content.contains("**Development standards**"))
XCTAssertTrue(overview.content.contains("**PHP and Laravel**"))
}
func testLiveLocalKnowledgeSearch() async throws {