diff --git a/apps/server/src/main/kotlin/com/correx/apps/server/Main.kt b/apps/server/src/main/kotlin/com/correx/apps/server/Main.kt index 6aa71dee..b6773db9 100644 --- a/apps/server/src/main/kotlin/com/correx/apps/server/Main.kt +++ b/apps/server/src/main/kotlin/com/correx/apps/server/Main.kt @@ -58,6 +58,7 @@ import com.correx.core.toolintent.rules.NetworkHostRule import com.correx.core.toolintent.rules.PathContainmentRule import com.correx.apps.server.freestyle.FreestyleDriver import com.correx.apps.server.inference.summarizeWithInference +import com.correx.core.kernel.orchestration.JournalCompactionService import com.correx.apps.server.personalization.ProfileAdaptationService import com.correx.core.artifacts.kind.DefaultArtifactKindRegistry import com.correx.core.events.types.ArtifactId @@ -247,6 +248,11 @@ fun main() { sandboxRoot = sandboxRoot, defaultSystemPromptPath = toolsConfig.defaultSystemPromptPath, ) + val journalCompactionService = JournalCompactionService( + artifactStore = artifactStore, + summarize = { prompt -> summarizeWithInference(prompt, SessionId("system"), inferenceRouter) }, + tokenThreshold = defaultOrchestrationConfig.journalCompactionTokenThreshold, + ) val orchestrator = DefaultSessionOrchestrator( repositories = repositories, engines = engines, @@ -254,6 +260,7 @@ fun main() { artifactStore = artifactStore, tokenizer = firstProvider.tokenizer, decisionJournalRepository = decisionJournalRepository, + compactionService = journalCompactionService, ) val routerConfig = correxConfig.router val embedder = InfrastructureModule.createEmbedderFromConfig(routerConfig.embedder)