{
  "openapi": "3.0.1",
  "info": {
    "title": "Ai Memory Engine",
    "description": "Give your AI persistent memory. Store conversations, search semantically, build knowledge graphs, and watch your AI get smarter with every interaction.",
    "version": "1.0",
    "x-build-id": "G3BXtbIu47JCtaLU1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ruv~ai-memory-engine/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ruv-ai-memory-engine",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/ruv~ai-memory-engine/runs": {
      "post": {
        "operationId": "runs-sync-ruv-ai-memory-engine",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/ruv~ai-memory-engine/run-sync": {
      "post": {
        "operationId": "run-sync-ruv-ai-memory-engine",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "title": "Action",
            "enum": [
              "demo",
              "store",
              "search",
              "get",
              "list",
              "delete",
              "update",
              "clear",
              "stats",
              "batch_search",
              "hybrid_search",
              "find_duplicates",
              "deduplicate",
              "chat",
              "build_knowledge",
              "recommend",
              "analyze",
              "feedback",
              "export",
              "import",
              "integrate_synthetic",
              "integrate_scraper",
              "integrate_actor",
              "integrate_trading",
              "template",
              "natural",
              "cluster",
              "export_vectordb",
              "learn"
            ],
            "type": "string",
            "description": "Select the operation to perform on your memory database",
            "default": "demo"
          },
          "sessionId": {
            "title": "Session ID",
            "type": "string",
            "description": "Unique identifier to persist memories across multiple Actor runs. Use the same Session ID to continue where you left off. Leave empty for one-time runs."
          },
          "namespace": {
            "title": "Memory Namespace",
            "type": "string",
            "description": "Organize memories into separate collections (like folders). Different namespaces are completely isolated.",
            "default": "default"
          },
          "memories": {
            "title": "Memories to Store",
            "type": "array",
            "description": "Text content to store in memory. Each item becomes a searchable memory with vector embeddings."
          },
          "query": {
            "title": "Search Query",
            "type": "string",
            "description": "What are you looking for? The engine uses semantic understanding to find relevant memories even with different wording."
          },
          "queries": {
            "title": "Batch Search Queries",
            "type": "array",
            "description": "Multiple search queries to run in parallel. Each query returns its own set of results."
          },
          "memoryId": {
            "title": "Memory ID",
            "type": "string",
            "description": "Unique identifier of a specific memory for get/delete/update operations"
          },
          "memoryIds": {
            "title": "Memory IDs (Batch)",
            "type": "array",
            "description": "Array of memory IDs for batch delete operation",
            "items": {
              "type": "string"
            }
          },
          "updates": {
            "title": "Memory Updates",
            "type": "object",
            "description": "Fields to update on a memory. You can update text, metadata, or both."
          },
          "metadataFilter": {
            "title": "Metadata Filter",
            "type": "object",
            "description": "Filter memories by metadata fields. Only memories matching ALL specified fields are affected."
          },
          "topK": {
            "title": "Number of Results",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of similar memories to return",
            "default": 10
          },
          "similarityThreshold": {
            "title": "Similarity Threshold",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Minimum similarity score required. Higher values return more relevant but fewer results.",
            "default": 0.7
          },
          "distanceMetric": {
            "title": "Distance Metric",
            "enum": [
              "cosine",
              "euclidean",
              "dot_product",
              "manhattan"
            ],
            "type": "string",
            "description": "Algorithm used to measure similarity between memory vectors",
            "default": "cosine"
          },
          "keywordWeight": {
            "title": "Keyword Weight (Hybrid Search)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Weight given to exact keyword matching in hybrid search. Set to 0 for pure semantic search.",
            "default": 0.3
          },
          "semanticWeight": {
            "title": "Semantic Weight (Hybrid Search)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Weight given to semantic similarity in hybrid search. Set to 1 for pure semantic search.",
            "default": 0.7
          },
          "limit": {
            "title": "Results per Page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of memories to return when listing",
            "default": 100
          },
          "offset": {
            "title": "Skip Results",
            "minimum": 0,
            "type": "integer",
            "description": "Number of memories to skip for pagination (e.g., offset=100 starts at the 101st result)",
            "default": 0
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "createdAt",
              "updatedAt",
              "accessCount"
            ],
            "type": "string",
            "description": "Field to sort list results by",
            "default": "createdAt"
          },
          "sortOrder": {
            "title": "Sort Order",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Sort direction for list results",
            "default": "desc"
          },
          "duplicateThreshold": {
            "title": "Duplicate Similarity Threshold",
            "minimum": 0.8,
            "maximum": 1,
            "type": "number",
            "description": "How similar memories must be to be considered duplicates. 0.95 = very similar, 1.0 = exact match.",
            "default": 0.95
          },
          "chatMessage": {
            "title": "Your Message",
            "type": "string",
            "description": "Your message to the AI assistant. The assistant will use stored memories to provide context-aware responses."
          },
          "chatHistory": {
            "title": "Conversation History",
            "type": "array",
            "description": "Previous messages in the conversation for context. Each message has a 'role' (user/assistant) and 'content'."
          },
          "provider": {
            "title": "AI Provider",
            "enum": [
              "gemini",
              "openrouter",
              "local"
            ],
            "type": "string",
            "description": "Which AI service to use for chat and advanced features",
            "default": "gemini"
          },
          "apiKey": {
            "title": "AI Provider API Key",
            "type": "string",
            "description": "Your API key for the selected provider. Get free Gemini key at ai.google.dev"
          },
          "model": {
            "title": "AI Model",
            "enum": [
              "gemini-2.0-flash-exp",
              "gemini-2.0-flash-thinking-exp",
              "gemini-1.5-pro",
              "openai/gpt-4o",
              "openai/gpt-4o-mini",
              "anthropic/claude-3.5-sonnet",
              "meta-llama/llama-3.3-70b-instruct"
            ],
            "type": "string",
            "description": "Which language model to use for chat and generation",
            "default": "gemini-2.0-flash-exp"
          },
          "sonaEnabled": {
            "title": "Enable SONA Learning",
            "type": "boolean",
            "description": "SONA (Self-Optimizing Neural Architecture) continuously improves search quality based on usage patterns",
            "default": true
          },
          "learningEnabled": {
            "title": "Enable Interaction Learning",
            "type": "boolean",
            "description": "Learn from search queries and feedback to improve future results",
            "default": true
          },
          "forceBackgroundLearning": {
            "title": "Force Learning Cycle",
            "type": "boolean",
            "description": "Run a SONA background learning cycle after this operation completes",
            "default": false
          },
          "ewcLambda": {
            "title": "Anti-Forgetting Strength (EWC++)",
            "minimum": 100,
            "maximum": 15000,
            "type": "number",
            "description": "How strongly to prevent forgetting old patterns when learning new ones. Higher = more conservative learning.",
            "default": 2000
          },
          "patternThreshold": {
            "title": "Pattern Confidence Threshold",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "Minimum confidence required to learn a new pattern. Higher = only learn strong patterns.",
            "default": 0.85
          },
          "knowledgeGraphEnabled": {
            "title": "Build Knowledge Graph",
            "type": "boolean",
            "description": "Automatically extract entities and relationships from stored memories to build a knowledge graph",
            "default": false
          },
          "feedbackRating": {
            "title": "Result Rating",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Rate the quality of a search result or recommendation to help SONA learn (5 = perfect, 1 = irrelevant)",
            "default": 5
          },
          "feedbackCorrection": {
            "title": "Correction Text",
            "type": "string",
            "description": "If a memory is incorrect, provide the correct text here. SONA will learn from this correction."
          },
          "exportFormat": {
            "title": "Export Format",
            "enum": [
              "json",
              "csv",
              "embeddings"
            ],
            "type": "string",
            "description": "File format for exporting your memory database",
            "default": "json"
          },
          "vectorDbFormat": {
            "title": "Vector DB Export Format",
            "enum": [
              "pinecone",
              "weaviate",
              "chromadb",
              "qdrant",
              "langchain",
              "openai"
            ],
            "type": "string",
            "description": "Export in a format compatible with popular vector databases",
            "default": "pinecone"
          },
          "importData": {
            "title": "Import Data",
            "type": "object",
            "description": "JSON data to import into memory. Should contain an array of memories with text and optional metadata."
          },
          "actorId": {
            "title": "Actor to Integrate",
            "enum": [
              "apify/google-maps-scraper",
              "apify/yelp-scraper",
              "apify/tripadvisor-scraper",
              "apify/instagram-scraper",
              "apify/twitter-scraper",
              "apify/tiktok-scraper",
              "apify/reddit-scraper",
              "apify/facebook-scraper",
              "apify/linkedin-scraper",
              "apify/youtube-scraper",
              "apify/amazon-scraper",
              "apify/shopify-scraper",
              "apify/ebay-scraper",
              "apify/walmart-scraper",
              "apify/booking-scraper",
              "apify/airbnb-scraper",
              "apify/expedia-scraper",
              "apify/glassdoor-scraper",
              "apify/indeed-scraper",
              "apify/crunchbase-scraper",
              "apify/google-search-scraper",
              "apify/news-scraper",
              "apify/rss-feed-scraper",
              "apify/zillow-scraper",
              "apify/realtor-scraper",
              "ruv/ai-synthetic-data-generator",
              "ruv/neural-trader-system",
              "custom"
            ],
            "type": "string",
            "description": "Select a popular actor or enter any Apify actor ID (owner/actor-name)",
            "default": "apify/google-maps-scraper"
          },
          "customActorId": {
            "title": "Custom Actor ID",
            "type": "string",
            "description": "Enter the full actor ID (e.g., username/actor-name) when using 'Custom Actor' option"
          },
          "actorCategory": {
            "title": "Filter by Category",
            "enum": [
              "all",
              "local",
              "social",
              "ecommerce",
              "travel",
              "professional",
              "content",
              "realestate",
              "data"
            ],
            "type": "string",
            "description": "Filter actors by category to find the right one faster",
            "default": "all"
          },
          "actorRunMode": {
            "title": "Data Source",
            "enum": [
              "latest",
              "specific",
              "fresh",
              "dataset",
              "discovery"
            ],
            "type": "string",
            "description": "Where to get the actor's data from",
            "default": "latest"
          },
          "actorRunId": {
            "title": "Specific Run ID",
            "type": "string",
            "description": "Run ID to fetch data from (when using 'Specific Run' mode)"
          },
          "actorDatasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Dataset ID to fetch data from (when using 'Dataset Only' mode)"
          },
          "actorInput": {
            "title": "Actor Input (Fresh Run)",
            "type": "object",
            "description": "Input configuration for starting a fresh actor run"
          },
          "actorConfig": {
            "title": "Memory Settings",
            "type": "object",
            "description": "Configure how actor data is processed and stored in memory"
          },
          "actorTimeout": {
            "title": "Actor Timeout",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "Maximum wait time for fresh actor runs (in seconds). Longer timeouts allow more data but cost more.",
            "default": 120
          },
          "actorMemoryLimit": {
            "title": "Actor Memory (MB)",
            "minimum": 256,
            "maximum": 8192,
            "type": "integer",
            "description": "Memory allocation for fresh actor runs (higher = faster but costs more)",
            "default": 1024
          },
          "integrationConfig": {
            "title": "Synthetic Data Configuration",
            "type": "object",
            "description": "Settings for generating and memorizing synthetic test data"
          },
          "scraperConfig": {
            "title": "Web Scraper Configuration",
            "type": "object",
            "description": "Configure web pages to scrape and memorize"
          },
          "tradingSymbols": {
            "title": "Trading Symbols",
            "type": "array",
            "description": "Crypto/stock symbols to analyze and generate trading signals for",
            "items": {
              "type": "string"
            }
          },
          "tradingStrategy": {
            "title": "Trading Strategy",
            "enum": [
              "ensemble",
              "neural_momentum",
              "lstm_prediction",
              "transformer_attention",
              "reinforcement"
            ],
            "type": "string",
            "description": "Neural network strategy to use for signal generation",
            "default": "ensemble"
          },
          "memorizeSignals": {
            "title": "Store Trading Signals",
            "type": "boolean",
            "description": "Save generated trading signals as searchable memories for later analysis",
            "default": true
          },
          "memorizeMarketData": {
            "title": "Store Market Data",
            "type": "boolean",
            "description": "Also store market data (price, volume, indicators) alongside signals",
            "default": false
          },
          "signalConfidenceThreshold": {
            "title": "Signal Confidence Threshold",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum confidence level required to store a signal (0-100). Higher = only store high-conviction signals.",
            "default": 70
          },
          "searchTradingHistory": {
            "title": "Search Trading History",
            "type": "boolean",
            "description": "Instead of generating new signals, search existing trading memories",
            "default": false
          },
          "tradingHistoryQuery": {
            "title": "Trading History Query",
            "type": "string",
            "description": "Search query for finding relevant trading signals and market data in memory"
          },
          "tradingActorConfig": {
            "title": "Neural Trader Actor Settings",
            "type": "object",
            "description": "Advanced configuration for the Neural Trader System actor"
          },
          "template": {
            "title": "Template",
            "enum": [
              "lead-intelligence",
              "customer-support",
              "research-assistant",
              "competitor-intelligence",
              "content-library",
              "product-catalog"
            ],
            "type": "string",
            "description": "Load a pre-built memory template optimized for specific use cases"
          },
          "command": {
            "title": "Natural Language Command",
            "type": "string",
            "description": "Tell the AI what you want in plain English. Examples: 'remember that John prefers email', 'what do you know about customers', 'find similar products'"
          },
          "numClusters": {
            "title": "Number of Clusters",
            "minimum": 2,
            "maximum": 20,
            "type": "integer",
            "description": "How many groups to organize your memories into based on similarity",
            "default": 5
          },
          "embeddingModel": {
            "title": "Embedding Model",
            "enum": [
              "ruvllm-768",
              "ruvllm-384",
              "gemini",
              "openai"
            ],
            "type": "string",
            "description": "Model used to convert text into vector embeddings for semantic search",
            "default": "ruvllm-768"
          },
          "seed": {
            "title": "Random Seed",
            "type": "string",
            "description": "Set a seed for reproducible results across runs"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}