-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
338 lines (272 loc) Β· 6.06 KB
/
index.html
File metadata and controls
338 lines (272 loc) Β· 6.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>CAIRO β AI Agent Platform & Developer SDK</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
background: #0d1117;
color: #c9d1d9;
max-width: 980px;
margin: auto;
padding: 2rem;
line-height: 1.6;
}
h1, h2, h3 {
color: #f0f6fc;
}
code, pre {
background: #161b22;
border-radius: 8px;
}
pre {
padding: 1rem;
overflow-x: auto;
}
hr {
border-color: #30363d;
}
table {
border-collapse: collapse;
width: 100%;
margin: 12px 0;
}
th, td {
border: 1px solid #30363d;
padding: 8px;
}
th {
background: #161b22;
}
a { color:#58a6ff; }
</style>
</head>
<body>
<h1>π CAIRO β AI Agent Platform & Developer SDK</h1>
<p>
CAIRO is a powerful <strong>AI agent platform</strong> and <strong>developer SDK</strong> designed to help teams build, orchestrate, and deploy intelligent automation workflows safely and at scale.
It enables developers to connect LLMs, APIs, tools, and data sources into production-ready agent systems with built-in billing, usage tracking, and multi-tenant organization management.
</p>
<hr>
<h2>π Key Features</h2>
<h3>π€ AI Agents & Task Execution</h3>
<ul>
<li>Tool-calling agents with full reasoning pipelines</li>
<li>Multi-step task orchestration</li>
<li>Memory support and state persistence</li>
<li>Streaming and async agent responses</li>
</ul>
<hr>
<h3>π¦ Cairo SDK</h3>
<ul>
<li>Task building and execution APIs</li>
<li>Agent orchestration utilities</li>
<li>Authentication helpers</li>
<li>Token management and usage tracking</li>
</ul>
<h4>Example</h4>
<pre><code>
import { Cairo } from "cairo-sdk";
const cairo = new Cairo({ apiKey: process.env.CAIRO_API_KEY });
const result = await cairo.runTask({
prompt: "Draft a product launch announcement",
});
</code></pre>
<hr>
<h3>π Integrations</h3>
<ul>
<li><strong>Stripe</strong> β payments, wallet top-ups, metered billing</li>
<li><strong>GitHub</strong> β issues, PR creation, code automation</li>
<li>APIs & Webhooks for custom integrations</li>
</ul>
<b>Planned:</b>
<ul>
<li>Slack</li>
<li>Notion</li>
<li>Google Workspace</li>
<li>Jira</li>
</ul>
<hr>
<h2>π³ Wallet, Credits & Billing (Stripe)</h2>
<h3>πΌ User Wallet System</h3>
<ul>
<li>Organization wallet balances</li>
<li>Stripe Checkout top-ups</li>
<li>Usage-based credit deduction</li>
<li>Real-time webhook updates</li>
</ul>
<hr>
<h3>π Billing Flow</h3>
<h4>1οΈβ£ Add Balance</h4>
<pre><code>POST /payment/create-checkout-session</code></pre>
<h4>2οΈβ£ Stripe Checkout Metadata</h4>
<ul>
<li><code>org_id</code></li>
<li><code>user_id</code></li>
<li><code>payment_type = wallet_topup</code></li>
</ul>
<h4>3οΈβ£ Redirect to Stripe</h4>
<p>User completes payment securely.</p>
<h4>4οΈβ£ Webhook</h4>
<pre><code>checkout.session.completed</code></pre>
<ul>
<li>Signature verification</li>
<li>Balance update</li>
<li>Credit ledger insert</li>
</ul>
<h4>5οΈβ£ Wallet Update</h4>
<pre><code>
UPDATE organizations
SET wallet_balance = wallet_balance + <amount>
WHERE id = <org_id>;
</code></pre>
<h4>6οΈβ£ Credit Ledger Insert</h4>
<pre><code>
INSERT INTO credit_transactions (
org_id,
transaction_type,
amount,
source,
stripe_session_id
)
VALUES (...);
</code></pre>
<hr>
<h2>π Backend Architecture</h2>
<pre>
api/
ββ auth/
ββ integrations/
ββ payments/
ββ agents/
ββ usage/
</pre>
<table>
<tr><th>Component</th><th>Description</th></tr>
<tr><td>Auth Service</td><td>JWT authentication & org verification</td></tr>
<tr><td>Wallet Service</td><td>Balance validation & credit accounting</td></tr>
<tr><td>Stripe Service</td><td>Checkout + webhook handling</td></tr>
<tr><td>Agent Service</td><td>AI task execution engine</td></tr>
<tr><td>Usage Service</td><td>Token metering</td></tr>
</table>
<hr>
<h2>π Database Schema</h2>
<h4>Organizations</h4>
<pre><code>
organizations(
id UUID,
name TEXT,
wallet_balance DECIMAL,
created_at TIMESTAMP
)
</code></pre>
<h4>Credit Ledger</h4>
<pre><code>
credit_transactions(
id UUID,
org_id UUID,
transaction_type TEXT,
amount DECIMAL,
source TEXT,
stripe_session_id TEXT,
created_at TIMESTAMP
)
</code></pre>
<h4>API Keys</h4>
<pre><code>
api_keys(
id UUID,
org_id UUID,
key_hash TEXT,
is_active BOOLEAN,
created_at TIMESTAMP
)
</code></pre>
<hr>
<h2>π Authentication</h2>
<ul>
<li>JWT tokens per session</li>
<li>Includes <code>user_id</code>, <code>org_id</code>, expiry</li>
<li>API keys tied to organizations</li>
<li>Every request validates auth + wallet balance</li>
</ul>
<hr>
<h2>β Agent Execution Flow</h2>
<ol>
<li>User submits task</li>
<li>Wallet balance check</li>
<li>Agent pipeline execution</li>
<li>Tool invocation</li>
<li>LLM calls</li>
<li>Token tracking</li>
<li>Credit deduction</li>
<li>Results streamed</li>
</ol>
<hr>
<h2>π Usage & Metering</h2>
<pre><code>
{
"model": "gpt-4",
"prompt_tokens": 230,
"completion_tokens": 470,
"credits_used": 3.93
}
</code></pre>
<hr>
<h2>π Platform Frontend</h2>
<ul>
<li>Wallet dashboard</li>
<li>Stripe top-ups</li>
<li>Task execution panels</li>
<li>Usage reporting</li>
<li>API key management</li>
</ul>
<hr>
<h2>πΊ Roadmap</h2>
<p><b>Released</b></p>
<ul>
<li>SDK</li>
<li>Stripe billing</li>
<li>GitHub integration</li>
</ul>
<p><b>In Progress</b></p>
<ul>
<li>Collaboration agents</li>
<li>Usage alerts</li>
<li>Multi-agent workflows</li>
</ul>
<p><b>Planned</b></p>
<ul>
<li>Slack</li>
<li>Marketplace</li>
<li>Templates</li>
</ul>
<hr>
<h2>π€ Contributing</h2>
<pre><code>
git checkout -b feature/my-feature
</code></pre>
<hr>
<h2>π¬ Contact</h2>
<p>
π§ support@cairo.ai<br>
π <a href="https://cairo.ai">https://cairo.ai</a>
</p>
<hr>
<h2>π Getting Started</h2>
<pre><code>
npm install cairo-sdk
</code></pre>
<pre><code>
const cairo = new Cairo({ apiKey: "YOUR_API_KEY" });
</code></pre>
<pre><code>
await cairo.runTask({
prompt: "Summarize today's market news",
});
</code></pre>
<hr>
<p><strong>Build smarter with CAIRO β where AI agents go to production.</strong></p>
</body>
</html>