Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ MEMORY_GRAPH_LLM_EXTRACTION_MAX_EPISODES=2
MEMORY_GRAPH_LLM_EXTRACTION_MIN_CONFIDENCE=0.8
MEMORY_GOVERNANCE_AUTO_CLEANUP_ENABLED=true
MEMORY_GOVERNANCE_INTERVAL_SECONDS=86400
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_ENABLED=false
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_LLM_ENABLED=false
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_INTERVAL_SECONDS=3600
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_LOOKBACK_DAYS=7
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_MAX_SESSIONS_PER_TICK=10
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_MAX_WINDOWS_PER_SESSION=20
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_WINDOW_SIZE=50
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_TIME_BUDGET_SECONDS=180
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_ROLES=scheduler
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_SYNC_ENABLED=false
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_SYNC_MAX_MESSAGES=200
MEMORY_NEEDS_REVIEW_RETENTION_DAYS=30
MEMORY_REJECTED_RETENTION_DAYS=7
MEMORY_AUTO_EXPIRE_DAYS=180
Expand Down Expand Up @@ -392,6 +403,17 @@ COMPOSE_MEMORY_GRAPH_LLM_EXTRACTION_MAX_EPISODES=2
COMPOSE_MEMORY_GRAPH_LLM_EXTRACTION_MIN_CONFIDENCE=0.8
COMPOSE_MEMORY_GOVERNANCE_AUTO_CLEANUP_ENABLED=true
COMPOSE_MEMORY_GOVERNANCE_INTERVAL_SECONDS=86400
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_ENABLED=false
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_LLM_ENABLED=false
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_INTERVAL_SECONDS=3600
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_LOOKBACK_DAYS=7
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_MAX_SESSIONS_PER_TICK=10
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_MAX_WINDOWS_PER_SESSION=20
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_WINDOW_SIZE=50
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_TIME_BUDGET_SECONDS=180
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_ROLES=scheduler
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_SYNC_ENABLED=false
COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_SYNC_MAX_MESSAGES=200
COMPOSE_MEMORY_NEEDS_REVIEW_RETENTION_DAYS=30
COMPOSE_MEMORY_REJECTED_RETENTION_DAYS=7
COMPOSE_MEMORY_AUTO_EXPIRE_DAYS=180
Expand Down
11 changes: 11 additions & 0 deletions app/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,17 @@ def guarded_dotenv_settings() -> dict[str, Any]:
memory_graph_llm_extraction_min_confidence: float = Field(default=0.8, ge=0.0, le=1.0)
memory_governance_auto_cleanup_enabled: bool = True
memory_governance_interval_seconds: float = Field(default=86_400.0, gt=0)
memory_group_graph_auto_extract_enabled: bool = False
memory_group_graph_auto_extract_llm_enabled: bool = False
memory_group_graph_auto_extract_interval_seconds: float = Field(default=3_600.0, gt=0)
memory_group_graph_auto_extract_lookback_days: int = Field(default=7, ge=1, le=14)
memory_group_graph_auto_extract_max_sessions_per_tick: int = Field(default=10, ge=1, le=20)
memory_group_graph_auto_extract_max_windows_per_session: int = Field(default=20, ge=1, le=100)
memory_group_graph_auto_extract_window_size: int = Field(default=50, ge=10, le=100)
memory_group_graph_auto_extract_time_budget_seconds: int = Field(default=180, ge=5, le=180)
memory_group_graph_auto_extract_roles: str = "scheduler"
memory_group_graph_auto_extract_sync_enabled: bool = False
memory_group_graph_auto_extract_sync_max_messages: int = Field(default=200, ge=20, le=500)
memory_needs_review_retention_days: int = Field(default=30, ge=1)
memory_rejected_retention_days: int = Field(default=7, ge=1)
memory_auto_expire_days: int = Field(default=180, ge=1)
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ x-app-env: &app-env
MEMORY_GRAPH_LLM_EXTRACTION_MIN_CONFIDENCE: ${COMPOSE_MEMORY_GRAPH_LLM_EXTRACTION_MIN_CONFIDENCE:-0.8}
MEMORY_GOVERNANCE_AUTO_CLEANUP_ENABLED: ${COMPOSE_MEMORY_GOVERNANCE_AUTO_CLEANUP_ENABLED:-true}
MEMORY_GOVERNANCE_INTERVAL_SECONDS: ${COMPOSE_MEMORY_GOVERNANCE_INTERVAL_SECONDS:-86400}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_ENABLED: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_ENABLED:-false}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_LLM_ENABLED: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_LLM_ENABLED:-false}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_INTERVAL_SECONDS: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_INTERVAL_SECONDS:-3600}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_LOOKBACK_DAYS: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_LOOKBACK_DAYS:-7}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_MAX_SESSIONS_PER_TICK: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_MAX_SESSIONS_PER_TICK:-10}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_MAX_WINDOWS_PER_SESSION: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_MAX_WINDOWS_PER_SESSION:-20}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_WINDOW_SIZE: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_WINDOW_SIZE:-50}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_TIME_BUDGET_SECONDS: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_TIME_BUDGET_SECONDS:-180}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_ROLES: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_ROLES:-scheduler}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_SYNC_ENABLED: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_SYNC_ENABLED:-false}
MEMORY_GROUP_GRAPH_AUTO_EXTRACT_SYNC_MAX_MESSAGES: ${COMPOSE_MEMORY_GROUP_GRAPH_AUTO_EXTRACT_SYNC_MAX_MESSAGES:-200}
MEMORY_NEEDS_REVIEW_RETENTION_DAYS: ${COMPOSE_MEMORY_NEEDS_REVIEW_RETENTION_DAYS:-30}
MEMORY_REJECTED_RETENTION_DAYS: ${COMPOSE_MEMORY_REJECTED_RETENTION_DAYS:-7}
MEMORY_AUTO_EXPIRE_DAYS: ${COMPOSE_MEMORY_AUTO_EXPIRE_DAYS:-180}
Expand Down
64 changes: 60 additions & 4 deletions frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,9 @@ export type GroupGraphEdge = {
extraction_method?: string;
review_state?: string;
acceptance?: Record<string, unknown>;
acceptance_score?: number | null;
acceptance_reason?: string | null;
evidence_dates?: string[];
history?: unknown[];
};

Expand Down Expand Up @@ -763,6 +766,7 @@ export type GroupGraphWindowExtractionRequest = {
max_windows?: number;
cursor_event_id?: number;
dry_run?: boolean;
include_llm?: boolean;
};

export type GroupGraphWindowCatchupRequest = {
Expand All @@ -777,6 +781,7 @@ export type GroupGraphWindowCatchupRequest = {
cursor_event_id?: number;
dry_run?: boolean;
time_budget_seconds?: number;
include_llm?: boolean;
};

export type GroupGraphWindowExtractionResponse = {
Expand Down Expand Up @@ -866,8 +871,35 @@ export type GroupGraphWindowStatsResponse = {
[key: string]: unknown;
};

export async function getGroupGraph(config: ConsoleConfig, query: GroupGraphQuery) {
return apiRequest<GroupGraphResponse>(config, "/plugins/memory/group-graph", { query });
export type GroupGraphEdgeReviewAction = "accept" | "reject" | "needs_review" | "expire" | "supersede";

export type GroupGraphEdgeReviewRequest = {
tenant_id: string;
channel?: string;
source_key?: string;
session_id?: string;
action: GroupGraphEdgeReviewAction;
review_reason?: string;
superseded_by_item_id?: number;
supersedes_item_id?: number;
};

export type GroupGraphEdgeReviewResponse = {
ok?: boolean;
edge_id?: string;
action?: string;
result?: Record<string, unknown>;
[key: string]: unknown;
};

export async function getGroupGraph(
config: ConsoleConfig,
query: GroupGraphQuery,
) {
return apiRequest<GroupGraphResponse>(config, "/plugins/memory/group-graph", {
auth: true,
query,
});
}

export async function getGroupGraphEdgeEvidence(
Expand All @@ -878,12 +910,15 @@ export async function getGroupGraphEdgeEvidence(
return apiRequest<GroupGraphEdgeEvidenceResponse>(
config,
`/plugins/memory/group-graph/evidence/${encodeURIComponent(edgeId)}`,
{ query },
{ auth: true, query },
);
}

export async function getGroupGraphHistoryDates(config: ConsoleConfig, query: GroupGraphHistoryDatesQuery) {
return apiRequest<GroupGraphHistoryDatesResponse>(config, "/plugins/memory/group-graph/history-dates", { query });
return apiRequest<GroupGraphHistoryDatesResponse>(config, "/plugins/memory/group-graph/history-dates", {
auth: true,
query,
});
}

export async function getMemoryExtractionJobStats(config: ConsoleConfig, query: MemoryExtractionJobStatsQuery) {
Expand Down Expand Up @@ -933,6 +968,27 @@ export async function runGroupGraphWindowCatchup(config: ConsoleConfig, body: Gr
});
}

export async function reviewGroupGraphEdge(
config: ConsoleConfig,
edgeId: string,
body: GroupGraphEdgeReviewRequest,
) {
return apiRequest<GroupGraphEdgeReviewResponse>(
config,
`/plugins/memory/group-graph/edges/${encodeURIComponent(edgeId)}/acceptance-review`,
{
auth: true,
init: {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(body),
},
},
);
}

export async function backfillMemoryHistory(config: ConsoleConfig, body: MemoryBackfillRequest) {
return apiRequest<MemoryBackfillResponse>(config, "/plugins/memory/backfill", {
init: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/ScopedDomainSafety.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("scoped domain pages with HttpOnly authentication", () => {
await waitFor(() => expect(action).toBeEnabled());
const writeCall = apiRequestMock.mock.calls.find(([, path]) => path === "/plugins/memory/group-graph/extract-daily");
expect(writeCall?.[2]?.auth).toBe(true);
expect((writeCall?.[2]?.init?.headers as Record<string, string>)["Idempotency-Key"]).toMatch(/^agent-console:/);
expect((writeCall?.[2]?.init?.headers as Record<string, string>)["Idempotency-Key"]).toBeUndefined();
unmount();
});

Expand Down
Loading
Loading