commit 1ca930a6d08d07286bfc0cf0b4601ac7d58877b9 Author: Kofo Okesola Date: Tue Sep 23 07:52:29 2025 +0100 init diff --git a/confs/agent.yml b/confs/agent.yml new file mode 100644 index 0000000..88f9faf --- /dev/null +++ b/confs/agent.yml @@ -0,0 +1,69 @@ +id: db_agent +http: + listenPath: db_agent + method: POST + next: $conditional.validate +conditionals: + validate: + expression: | + {{ + notempty (param "query") "Query" true + }} + validPath: $action.agent + invalidPath: $response.400 +actions: + agent: + type: agent + config: + integrationID: openai + userPrompt: '{{ param "query" }}' + systemPrompt: | + You are a helpful agent to assist the user interact and query data from a mongodb database. + You have access to a mongodb querier tool that allows you fetch data using filter and projection queries on the collection "users". + The collection has the fields name, email, id (uuid). + *IMPORTANT* Never include password queries in your responses + + + toolConfigs: + - type: workflow + workflowConfig: + name: mongodbquerier + description: | + Accepts a filter query in the form of json and a projection in the form of json and performs queries on the collection "users" + params: ["filter", "projection"] + returnValue: '{{ jsonout .variable_actions_queryDB}}' + start: "$action.queryDB" + history: true + next: $response.200 + queryDB: + type: mongoquery + config: + collection: users + filter: '{{ tool_param "filter" | stringescape }}' + projection: '{{ tool_param "projection" | stringescape }}' + integrationID: "mongo" + +responses: + "200": + type: json + responseObject: + fields: + response: + value: "{{ .variable_actions_agent }}" + code: 200 + + "400": + type: json + template: | + { + "errors": {{ .error }} + } + code: 400 + + exists: + type: json + template: | + { + "errors": ["user already exists"] + } + code: 400 \ No newline at end of file diff --git a/integrations/integrations.yml b/integrations/integrations.yml new file mode 100644 index 0000000..6344200 --- /dev/null +++ b/integrations/integrations.yml @@ -0,0 +1,5 @@ +- id: mongo + type: mongo + config: + connectionString: '{{ secret "MONGODB_STRING" }}' + dbName: test \ No newline at end of file