1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "sessionId": "my-project",
10 "memories": [
11 {
12 "text": "The customer prefers fast shipping over lower prices",
13 "metadata": {
14 "type": "preference",
15 "customer_id": "123",
16 },
17 },
18 {
19 "text": "Product X works best with Product Y for home automation",
20 "metadata": {
21 "type": "knowledge",
22 "category": "products",
23 },
24 },
25 {
26 "text": "User asked about return policy on December 10th",
27 "metadata": {
28 "type": "conversation",
29 "date": "2024-12-10",
30 },
31 },
32 ],
33 "query": "What does the customer prefer?",
34 "queries": [
35 "What does the customer prefer?",
36 "Product recommendations",
37 "Support history",
38 ],
39 "memoryIds": [
40 "mem_123",
41 "mem_456",
42 ],
43 "updates": {
44 "text": "Updated memory text",
45 "metadata": {
46 "updated": True,
47 "version": 2,
48 },
49 },
50 "metadataFilter": { "type": "preference" },
51 "chatMessage": "What products would you recommend based on my preferences?",
52 "chatHistory": [
53 {
54 "role": "user",
55 "content": "What products do you recommend?",
56 },
57 {
58 "role": "assistant",
59 "content": "Based on your preferences, I recommend Product X.",
60 },
61 ],
62 "importData": { "memories": [{
63 "text": "Sample memory to import",
64 "metadata": { "source": "import" },
65 }] },
66 "actorInput": {
67 "searchStrings": ["coffee shops in NYC"],
68 "maxResults": 50,
69 },
70 "actorConfig": {
71 "memorizeFields": [
72 "title",
73 "description",
74 "address",
75 "rating",
76 ],
77 "limit": 100,
78 "skipDuplicates": True,
79 "enrichWithMetadata": True,
80 },
81 "integrationConfig": {
82 "syntheticDataActor": "ruv/ai-synthetic-data-generator",
83 "dataType": "ecommerce",
84 "count": 100,
85 "memorizeFields": [
86 "title",
87 "description",
88 "category",
89 ],
90 },
91 "scraperConfig": {
92 "urls": ["https://example.com/docs"],
93 "selector": "article",
94 "maxPages": 10,
95 },
96 "tradingSymbols": [
97 "BTC",
98 "ETH",
99 "SOL",
100 ],
101 "tradingHistoryQuery": "high confidence BUY signals for BTC",
102 "tradingActorConfig": {
103 "actorId": "ruv/neural-trader-system",
104 "action": "analyze",
105 "riskProfile": "moderate",
106 "memory": 2048,
107 "timeout": 300,
108 },
109 "command": "what do you know about customers",
110}
111
112
113run = client.actor("ruv/ai-memory-engine").call(run_input=run_input)
114
115
116print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
117for item in client.dataset(run["defaultDatasetId"]).iterate_items():
118 print(item)
119
120