You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: community/gemini/README.md
+27-4
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,27 @@
1
-
# Restack AI - Gemini Example
1
+
# Restack AI - Gemini Example for Autonomous Agents
2
2
3
-
This example demonstrates how to build reliable and scalable AI applications using Google's Gemini API with Restack. It shows how to handle rate limits, concurrent API calls, and workflow orchestration effectively.
3
+
This example demonstrates how to build reliable and scalable autonomous AI agents using Google's Gemini API with Restack. It shows how to handle rate limits (10 requests per minute for free tier with 1500 requests per day limit, concurrency limit), concurrent API calls, and workflow orchestration effectively to create agents that can independently perform complex tasks.
4
4
5
-
We build four example workflows: a basic content generation workflow, a function calling workflow, a multi-function calling workflow, and a swarm workflow that demonstrates parallel execution.
5
+
Example workflows in `src/workflows/`:
6
+
-[Content Generation](src/workflows/generate_content.py): Basic natural language understanding
-[Multi-Function Calling](src/workflows/multi_function_call.py): Complex decision making
9
+
-[Multi-Function Calling](src/workflows/multi_function_call_advanced.py): Complex decision making with tools, executed as restack functions (e.g. third party APIs)
10
+
-[Swarm](src/workflows/swarm.py): Parallel execution of multiple coordinated agents
6
11
7
12
8
13
## Motivation
9
14
10
15
When building AI applications with Gemini, you need to handle various production challenges:
11
16
12
-
1.**API Rate Limits**: Gemini API has concurrent request limits (e.g., 3 concurrent calls)([1](https://googleapis.github.io/python-genai)) that need to be managed across multiple workflows.
17
+
1.**API Rate Limits**: Gemini API has concurrent request limits that need to be managed across multiple workflows.
13
18
14
19
2.**Reliability**: AI workflows need retry mechanisms and graceful failure handling for production use.
15
20
16
21
3.**Scalability**: As your application grows to handle thousands of concurrent agents or requests, you need robust queue management and execution control.
17
22
23
+
4.**Scheduling**: Coordinating and managing multiple workflows running at different frequencies requires robust scheduling capabilities.
24
+
18
25
### How Restack Helps
19
26
20
27
Restack provides built-in solutions for these challenges:
@@ -35,6 +42,8 @@ client.start_service(
35
42
36
43
3.**Queue Management**: Efficiently manages thousands of concurrent workflows while respecting API limits.
37
44
45
+
4.**Scheduling**: Run workflows on various schedules (minutely, hourly, daily) or with custom cron expressions.
46
+
38
47
## Prerequisites
39
48
40
49
- Python 3.9 or higher
@@ -96,6 +105,20 @@ client.start_service(
96
105
97
106
8. Schedule workflows via the UI
98
107
108
+
All workflows are auto-exposed with an RestAPI endpoint, ready to be run or scheduled via api request, or directly from the UI during development.
109
+
110
+

111
+
112
+
Run or schedule individual workflows.
113
+
114
+

115
+
116
+
Run or schedule a workflow, triggering many agents as childworkflows.
0 commit comments