Skip to content

Commit 3fa34cf

Browse files
authored
Cleanup Memory sections from UI following v1alpha2 API migration (#833)
This PR removes all memory-related functionality from the UI as part of the v1alpha2 API migration. 1. Memory Pages/Routes: -Removed memory listing page (/memories) -Removed memory creation page (/memories/new) 2. Agent Creation / Edit Forms: -Removed memory selection section from ui/src/app/agents/new/page.tsx -Removed memory references from ui/src/components/AgentDetailsSidebar.tsx -Cleaned up imports 3. Agent Display Components: -Cleaned up AgentDetailsSidebar 4. Navigation & Routing: -Removed memory navigation items 5. Types & Interfaces: -Removed MemoryResponse, CreateMemoryRequest, and UpdateMemoryRequest types -Deleted API client methods for memory Fixes: issue #738 Who can review: @peterj --------- Signed-off-by: Tanuj Rai <tanujrai19@gmail.com> Signed-off-by: Tanuj-rai <tanujrai898@gmail.com>
1 parent c247414 commit 3fa34cf

File tree

11 files changed

+3
-957
lines changed

11 files changed

+3
-957
lines changed

ui/cypress/e2e/smoke.cy.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,5 @@ describe('Main page', () => {
5151
cy.wait(1000)
5252
cy.visit('/servers')
5353
cy.contains('h1', 'Tool Servers').should('be.visible');
54-
55-
cy.visit('/memories')
56-
cy.contains('h1', 'Memories').should('be.visible');
57-
58-
cy.visit('/memories/new')
59-
cy.contains('div', 'Create New Memory').should('be.visible');
6054
})
6155
})

ui/src/app/actions/memories.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

ui/src/app/actions/providers.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,3 @@ export async function getSupportedModelProviders(): Promise<BaseResponse<Provide
1616
return createErrorResponse<Provider[]>(error, "Error getting supported providers");
1717
}
1818
}
19-
20-
/**
21-
* Gets the list of supported memory providers
22-
* @returns A promise with the list of supported memory providers
23-
*/
24-
export async function getSupportedMemoryProviders(): Promise<BaseResponse<Provider[]>> {
25-
try {
26-
const response = await fetchApi<BaseResponse<Provider[]>>("/providers/memories");
27-
28-
if (!response) {
29-
throw new Error("Failed to get supported memory providers");
30-
}
31-
32-
return {
33-
message: "Supported memory providers fetched successfully",
34-
data: response.data,
35-
};
36-
} catch (error) {
37-
return createErrorResponse<Provider[]>(error, "Error getting supported memory providers");
38-
}
39-
}

ui/src/app/agents/new/page.tsx

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import { Button } from "@/components/ui/button";
55
import { Textarea } from "@/components/ui/textarea";
66
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
77
import { Loader2, Settings2, PlusCircle, Trash2 } from "lucide-react";
8-
import { ModelConfig, MemoryResponse, AgentType } from "@/types";
8+
import { ModelConfig, AgentType } from "@/types";
99
import { SystemPromptSection } from "@/components/create/SystemPromptSection";
1010
import { ModelSelectionSection } from "@/components/create/ModelSelectionSection";
1111
import { ToolsSection } from "@/components/create/ToolsSection";
12-
import { MemorySelectionSection } from "@/components/create/MemorySelectionSection";
1312
import { useRouter, useSearchParams } from "next/navigation";
1413
import { useAgents } from "@/components/AgentsProvider";
1514
import { LoadingState } from "@/components/LoadingState";
@@ -18,7 +17,6 @@ import KagentLogo from "@/components/kagent-logo";
1817
import { AgentFormData } from "@/components/AgentsProvider";
1918
import { Tool, EnvVar } from "@/types";
2019
import { toast } from "sonner";
21-
import { listMemories } from "@/app/actions/memories";
2220
import { NamespaceCombobox } from "@/components/NamespaceCombobox";
2321
import { Label } from "@/components/ui/label";
2422
import { Checkbox } from "@/components/ui/checkbox";
@@ -33,7 +31,6 @@ interface ValidationErrors {
3331
model?: string;
3432
knowledgeSources?: string;
3533
tools?: string;
36-
memory?: string;
3734
}
3835

3936
interface AgentPageContentProps {
@@ -70,8 +67,6 @@ function AgentPageContent({ isEditMode, agentName, agentNamespace }: AgentPageCo
7067
systemPrompt: string;
7168
selectedModel: SelectedModelType | null;
7269
selectedTools: Tool[];
73-
availableMemories: MemoryResponse[];
74-
selectedMemories: string[];
7570
byoImage: string;
7671
byoCmd: string;
7772
byoArgs: string;
@@ -92,8 +87,6 @@ function AgentPageContent({ isEditMode, agentName, agentNamespace }: AgentPageCo
9287
systemPrompt: isEditMode ? "" : DEFAULT_SYSTEM_PROMPT,
9388
selectedModel: null,
9489
selectedTools: [],
95-
availableMemories: [],
96-
selectedMemories: [],
9790
byoImage: "",
9891
byoCmd: "",
9992
byoArgs: "",
@@ -161,11 +154,7 @@ function AgentPageContent({ isEditMode, agentName, agentNamespace }: AgentPageCo
161154
)).concat((agent.spec?.byo?.deployment?.env || []).length === 0 ? [{ name: "", value: "", isSecret: false }] : []),
162155
}));
163156
}
164-
165-
// Set selected memories if they exist
166-
if (agentResponse.memoryRefs && Array.isArray(agentResponse.memoryRefs)) {
167-
setState(prev => ({ ...prev, selectedMemories: agentResponse.memoryRefs }));
168-
}
157+
169158
} catch (extractError) {
170159
console.error("Error extracting assistant data:", extractError);
171160
toast.error("Failed to extract agent data");
@@ -185,19 +174,6 @@ function AgentPageContent({ isEditMode, agentName, agentNamespace }: AgentPageCo
185174
void fetchAgentData();
186175
}, [isEditMode, agentName, agentNamespace, getAgent]);
187176

188-
useEffect(() => {
189-
const fetchMemories = async () => {
190-
try {
191-
const memories = await listMemories();
192-
setState(prev => ({ ...prev, availableMemories: memories }));
193-
} catch (error) {
194-
console.error("Error fetching memories:", error);
195-
toast.error("Failed to load available memories.");
196-
}
197-
};
198-
fetchMemories();
199-
}, []);
200-
201177
const validateForm = () => {
202178
const formData = {
203179
name: state.name,
@@ -229,7 +205,6 @@ function AgentPageContent({ isEditMode, agentName, agentNamespace }: AgentPageCo
229205
case 'systemPrompt': formData.systemPrompt = value; break;
230206
case 'model': formData.modelName = value; break;
231207
case 'tools': formData.tools = value; break;
232-
case 'memory': formData.memory = value; break;
233208
}
234209

235210
const fieldErrors = validateAgentData(formData);
@@ -265,7 +240,6 @@ function AgentPageContent({ isEditMode, agentName, agentNamespace }: AgentPageCo
265240
modelName: state.selectedModel?.ref || "",
266241
stream: true,
267242
tools: state.selectedTools,
268-
memory: state.selectedMemories,
269243
// BYO
270244
byoImage: state.byoImage,
271245
byoCmd: state.byoCmd || undefined,
@@ -585,25 +559,6 @@ function AgentPageContent({ isEditMode, agentName, agentNamespace }: AgentPageCo
585559
</Card>
586560
{state.agentType === "Declarative" && (
587561
<>
588-
<Card>
589-
<CardHeader>
590-
<CardTitle className="flex items-center gap-2">
591-
<Settings2 className="h-5 w-5" />
592-
Memory
593-
</CardTitle>
594-
<p className="text-xs mb-2 block text-muted-foreground">
595-
The memories that the agent will use to answer the user&apos;s questions.
596-
</p>
597-
</CardHeader>
598-
<CardContent>
599-
<MemorySelectionSection
600-
availableMemories={state.availableMemories}
601-
selectedMemories={state.selectedMemories}
602-
onSelectionChange={(mems) => setState(prev => ({ ...prev, selectedMemories: mems }))}
603-
disabled={state.isSubmitting || state.isLoading}
604-
/>
605-
</CardContent>
606-
</Card>
607562
<Card>
608563
<CardHeader>
609564
<CardTitle className="flex items-center gap-2">

0 commit comments

Comments
 (0)