11package database
22
33import (
4+ "context"
45 "time"
56
67 "github.com/kagent-dev/kagent/go/api/v1alpha2"
@@ -20,63 +21,63 @@ type LangGraphCheckpointTuple struct {
2021
2122type Client interface {
2223 // Store methods
23- StoreFeedback (feedback * Feedback ) error
24- StoreSession (session * Session ) error
25- StoreAgent (agent * Agent ) error
26- StoreTask (task * protocol.Task ) error
27- StorePushNotification (config * protocol.TaskPushNotificationConfig ) error
28- StoreToolServer (toolServer * ToolServer ) (* ToolServer , error )
29- StoreEvents (messages ... * Event ) error
24+ StoreFeedback (ctx context. Context , feedback * Feedback ) error
25+ StoreSession (ctx context. Context , session * Session ) error
26+ StoreAgent (ctx context. Context , agent * Agent ) error
27+ StoreTask (ctx context. Context , task * protocol.Task ) error
28+ StorePushNotification (ctx context. Context , config * protocol.TaskPushNotificationConfig ) error
29+ StoreToolServer (ctx context. Context , toolServer * ToolServer ) (* ToolServer , error )
30+ StoreEvents (ctx context. Context , messages ... * Event ) error
3031
3132 // Delete methods
32- DeleteSession (sessionID string , userID string ) error
33- DeleteAgent (agentID string ) error
34- DeleteToolServer (serverName string , groupKind string ) error
35- DeleteTask (taskID string ) error
36- DeletePushNotification (taskID string ) error
37- DeleteToolsForServer (serverName string , groupKind string ) error
33+ DeleteSession (ctx context. Context , sessionID string , userID string ) error
34+ DeleteAgent (ctx context. Context , agentID string ) error
35+ DeleteToolServer (ctx context. Context , serverName string , groupKind string ) error
36+ DeleteTask (ctx context. Context , taskID string ) error
37+ DeletePushNotification (ctx context. Context , taskID string ) error
38+ DeleteToolsForServer (ctx context. Context , serverName string , groupKind string ) error
3839
3940 // Get methods
40- GetSession (sessionID string , userID string ) (* Session , error )
41- GetAgent (name string ) (* Agent , error )
42- GetTask (id string ) (* protocol.Task , error )
43- GetTool (name string ) (* Tool , error )
44- GetToolServer (name string ) (* ToolServer , error )
45- GetPushNotification (taskID string , configID string ) (* protocol.TaskPushNotificationConfig , error )
41+ GetSession (ctx context. Context , sessionID string , userID string ) (* Session , error )
42+ GetAgent (ctx context. Context , name string ) (* Agent , error )
43+ GetTask (ctx context. Context , id string ) (* protocol.Task , error )
44+ GetTool (ctx context. Context , name string ) (* Tool , error )
45+ GetToolServer (ctx context. Context , name string ) (* ToolServer , error )
46+ GetPushNotification (ctx context. Context , taskID string , configID string ) (* protocol.TaskPushNotificationConfig , error )
4647
4748 // List methods
48- ListTools () ([]Tool , error )
49- ListFeedback (userID string ) ([]Feedback , error )
50- ListTasksForSession (sessionID string ) ([]* protocol.Task , error )
51- ListSessions (userID string ) ([]Session , error )
52- ListSessionsForAgent (agentID string , userID string ) ([]Session , error )
53- ListAgents () ([]Agent , error )
54- ListToolServers () ([]ToolServer , error )
55- ListToolsForServer (serverName string , groupKind string ) ([]Tool , error )
56- ListEventsForSession (sessionID , userID string , options QueryOptions ) ([]* Event , error )
57- ListPushNotifications (taskID string ) ([]* protocol.TaskPushNotificationConfig , error )
49+ ListTools (ctx context. Context ) ([]Tool , error )
50+ ListFeedback (ctx context. Context , userID string ) ([]Feedback , error )
51+ ListTasksForSession (ctx context. Context , sessionID string ) ([]* protocol.Task , error )
52+ ListSessions (ctx context. Context , userID string ) ([]Session , error )
53+ ListSessionsForAgent (ctx context. Context , agentID string , userID string ) ([]Session , error )
54+ ListAgents (ctx context. Context ) ([]Agent , error )
55+ ListToolServers (ctx context. Context ) ([]ToolServer , error )
56+ ListToolsForServer (ctx context. Context , serverName string , groupKind string ) ([]Tool , error )
57+ ListEventsForSession (ctx context. Context , sessionID , userID string , options QueryOptions ) ([]* Event , error )
58+ ListPushNotifications (ctx context. Context , taskID string ) ([]* protocol.TaskPushNotificationConfig , error )
5859
5960 // Helper methods
60- RefreshToolsForServer (serverName string , groupKind string , tools ... * v1alpha2.MCPTool ) error
61+ RefreshToolsForServer (ctx context. Context , serverName string , groupKind string , tools ... * v1alpha2.MCPTool ) error
6162
6263 // LangGraph Checkpoint methods
63- StoreCheckpoint (checkpoint * LangGraphCheckpoint ) error
64- StoreCheckpointWrites (writes []* LangGraphCheckpointWrite ) error
65- ListCheckpoints (userID , threadID , checkpointNS string , checkpointID * string , limit int ) ([]* LangGraphCheckpointTuple , error )
66- DeleteCheckpoint (userID , threadID string ) error
64+ StoreCheckpoint (ctx context. Context , checkpoint * LangGraphCheckpoint ) error
65+ StoreCheckpointWrites (ctx context. Context , writes []* LangGraphCheckpointWrite ) error
66+ ListCheckpoints (ctx context. Context , userID , threadID , checkpointNS string , checkpointID * string , limit int ) ([]* LangGraphCheckpointTuple , error )
67+ DeleteCheckpoint (ctx context. Context , userID , threadID string ) error
6768
6869 // CrewAI methods
69- StoreCrewAIMemory (memory * CrewAIAgentMemory ) error
70- SearchCrewAIMemoryByTask (userID , threadID , taskDescription string , limit int ) ([]* CrewAIAgentMemory , error )
71- ResetCrewAIMemory (userID , threadID string ) error
72- StoreCrewAIFlowState (state * CrewAIFlowState ) error
73- GetCrewAIFlowState (userID , threadID string ) (* CrewAIFlowState , error )
70+ StoreCrewAIMemory (ctx context. Context , memory * CrewAIAgentMemory ) error
71+ SearchCrewAIMemoryByTask (ctx context. Context , userID , threadID , taskDescription string , limit int ) ([]* CrewAIAgentMemory , error )
72+ ResetCrewAIMemory (ctx context. Context , userID , threadID string ) error
73+ StoreCrewAIFlowState (ctx context. Context , state * CrewAIFlowState ) error
74+ GetCrewAIFlowState (ctx context. Context , userID , threadID string ) (* CrewAIFlowState , error )
7475
7576 // Agent memory (vector search) methods
76- StoreAgentMemory (memory * Memory ) error
77- StoreAgentMemories (memories []* Memory ) error
78- SearchAgentMemory (agentName , userID string , embedding pgvector.Vector , limit int ) ([]AgentMemorySearchResult , error )
79- ListAgentMemories (agentName , userID string ) ([]Memory , error )
80- DeleteAgentMemory (agentName , userID string ) error
81- PruneExpiredMemories () error
77+ StoreAgentMemory (ctx context. Context , memory * Memory ) error
78+ StoreAgentMemories (ctx context. Context , memories []* Memory ) error
79+ SearchAgentMemory (ctx context. Context , agentName , userID string , embedding pgvector.Vector , limit int ) ([]AgentMemorySearchResult , error )
80+ ListAgentMemories (ctx context. Context , agentName , userID string ) ([]Memory , error )
81+ DeleteAgentMemory (ctx context. Context , agentName , userID string ) error
82+ PruneExpiredMemories (ctx context. Context ) error
8283}
0 commit comments