Skip to content

Commit d9ee003

Browse files
feat: add configurable event compaction support
1 parent 460496e commit d9ee003

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

MaxKernel/auto_agent/agent.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
from google.adk.apps.app import App, EventsCompactionConfig
8+
89
from auto_agent.subagents.autotuning.agent import autotune_agent
910
from auto_agent.subagents.kernel_writing import (
1011
implement_kernel_agent,
@@ -30,10 +31,13 @@
3031
max_iterations=5,
3132
)
3233

33-
compaction_config = EventsCompactionConfig(
34-
token_threshold=200000,
35-
event_retention_size=100,
36-
)
34+
if EVENTS_COMPACTION:
35+
compaction_config = EventsCompactionConfig(
36+
token_threshold=200000,
37+
event_retention_size=100,
38+
)
39+
else:
40+
compaction_config = None
3741

3842
app = App(
3943
name="auto_agent",
@@ -42,4 +46,3 @@
4246
)
4347

4448
__all__ = ["root_agent", "app"]
45-

MaxKernel/auto_agent/config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
from google.adk.planners import BuiltInPlanner
66
from google.genai import types
77

8-
from auto_agent.constants import TOP_K, TOP_P
8+
from auto_agent.constants import EVENTS_COMPACTION, TEMPERATURE, TOP_K, TOP_P
99

1010
# Environment variables
1111
WORKDIR = os.environ.get("WORKDIR", os.path.dirname(os.path.abspath(__file__)))
1212
TPU_VERSION = os.environ.get("TPU_VERSION", "")
1313
RAG_CORPUS = os.environ.get("RAG_CORPUS", "")
1414
INCLUDE_THOUGHTS = os.environ.get("INCLUDE_THOUGHTS", "true").lower() == "true"
1515

16+
# Events Compaction Configuration
17+
EVENTS_COMPACTION = EVENTS_COMPACTION
18+
1619
# Model configuration
1720
model_config = types.GenerateContentConfig(
18-
temperature=0.5,
21+
temperature=TEMPERATURE,
1922
top_p=TOP_P,
2023
top_k=TOP_K,
2124
)

MaxKernel/auto_agent/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
MODEL_NAME = "gemini-3.1-pro-preview"
22
MAX_ITERATIONS = 5
33
LLM_GEN_RETRY_COUNT = 3
4-
TEMPERATURE = 0.1
4+
TEMPERATURE = 0.5
55
TOP_P = 0.9
66
TOP_K = 5
77
REQUEST_TIMEOUT = 3600 * 3
88
TPU_SERVER_PORT = 5463
99
CPU_SERVER_PORT = 5464
1010
EVAL_SERVER_PORT = 1245
11+
EVENTS_COMPACTION = True

0 commit comments

Comments
 (0)