# Lucid Documentation > Public documentation for Lucid, generated from source-controlled docs, OpenAPI, and SDK references. ## lucid-cloud-gateway-sdk - [Gateway SDK Reference](/reference/gateway-sdk/index): Generated gateway SDK namespace index. # Gateway SDK Reference Gateway SDK namespace pages are generated from the current gateway SDK docs. | Namespace | Operations | | --- | ---: | | [`agents`](/reference/gateway-sdk/namespaces/agents) | 4 | | [`auditlogs`](/reference/gateway-sdk/namespaces/auditlogs) | 1 | | [`auth`](/reference/gateway-sdk/namespaces/auth) | 2 | | [`billing`](/reference/gateway-sdk/namespaces/billing) | 2 | | [`catalog`](/reference/gateway-sdk/namespaces/catalog) | 1 | | [`chains`](/reference/gateway-sdk/namespaces/chains) | 1 | | [`entitlements`](/reference/gateway-sdk/namespaces/entitlements) | 6 | | [`health`](/reference/gateway-sdk/namespaces/health) | 1 | | [`inference`](/reference/gateway-sdk/namespaces/inference) | 2 | | [`keys`](/reference/gateway-sdk/namespaces/keys) | 4 | | [`models`](/reference/gateway-sdk/namespaces/models) | 1 | | [`payment`](/reference/gateway-sdk/namespaces/payment) | 7 | | [`plans`](/reference/gateway-sdk/namespaces/plans) | 4 | | [`plugins`](/reference/gateway-sdk/namespaces/plugins) | 3 | | [`quotas`](/reference/gateway-sdk/namespaces/quotas) | 3 | | [`reputation`](/reference/gateway-sdk/namespaces/reputation) | 1 | | [`servers`](/reference/gateway-sdk/namespaces/servers) | 3 | | [`sessions`](/reference/gateway-sdk/namespaces/sessions) | 3 | | [`tenants`](/reference/gateway-sdk/namespaces/tenants) | 5 | | [`tools`](/reference/gateway-sdk/namespaces/tools) | 3 | | [`usage`](/reference/gateway-sdk/namespaces/usage) | 2 | - [Agents SDK](/reference/gateway-sdk/namespaces/agents): Agent identity and scope management (MCPGate) # Agents SDK ## Overview Agent identity and scope management (MCPGate) ### Available Operations * [createAgent](#createagent) - Create an agent identity * [listAgents](#listagents) - List agents * [getAgent](#getagent) - Get agent details * [revokeAgent](#revokeagent) - Revoke an agent ## createAgent Create an agent identity ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.agents.createAgent({ name: "", scopes: [ "", ], }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { agentsCreateAgent } from "@lucid/gateway/funcs/agents-create-agent.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await agentsCreateAgent(lucidGateway, { name: "", scopes: [ "", ], }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("agentsCreateAgent failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [models.CreateAgentRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/create-agent-request.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.CreateAgentResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-agent-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## listAgents List agents ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.agents.listAgents(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { agentsListAgents } from "@lucid/gateway/funcs/agents-list-agents.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await agentsListAgents(lucidGateway); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("agentsListAgents failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `page` | *number* | :heavy_minus_sign: | N/A | | `perPage` | *number* | :heavy_minus_sign: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. A - [Auditlogs SDK](/reference/gateway-sdk/namespaces/auditlogs): Tool call audit trail (MCPGate) # Auditlogs SDK ## Overview Tool call audit trail (MCPGate) ### Available Operations * [getAuditLogs](#getauditlogs) - Query tool call audit logs ## getAuditLogs Query tool call audit logs ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.auditLogs.getAuditLogs({}); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { auditLogsGetAuditLogs } from "@lucid/gateway/funcs/audit-logs-get-audit-logs.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await auditLogsGetAuditLogs(lucidGateway, {}); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("auditLogsGetAuditLogs failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.GetAuditLogsRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-audit-logs-request.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetAuditLogsResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-audit-logs-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | - [Auth SDK](/reference/gateway-sdk/namespaces/auth): OAuth credential connections (MCPGate) # Auth SDK ## Overview OAuth credential connections (MCPGate) ### Available Operations * [oauthConnect](#oauthconnect) - Start OAuth connection flow * [oauthCallback](#oauthcallback) - OAuth callback handler ## oauthConnect Start OAuth connection flow ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.auth.oauthConnect(""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { authOauthConnect } from "@lucid/gateway/funcs/auth-oauth-connect.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await authOauthConnect(lucidGateway, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("authOauthConnect failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `provider` | *string* | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.OauthConnectResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/oauth-connect-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## oauthCallback OAuth callback handler ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.auth.oauthCallback("", ""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { authOauthCallback } from "@lucid/gateway/funcs/auth-oauth-callback.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await authOauthCallback(lucidGateway, "", ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("authOauthCallback failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `providerConfigKey` | *string* | :heavy_check_mark: | N/A | | `connectionId` | *string* | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/luci - [Billing SDK](/reference/gateway-sdk/namespaces/billing): Stripe billing integration (Control-Plane) # Billing SDK ## Overview Stripe billing integration (Control-Plane) ### Available Operations * [createCheckout](#createcheckout) - Create Stripe checkout session * [createPortal](#createportal) - Create Stripe billing portal ## createCheckout Create Stripe checkout session ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.billing.createCheckout({ adminKey: "", }, "", { plan: "", successUrl: "https://glorious-dwell.com/", cancelUrl: "https://wiggly-reorganisation.info/", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { billingCreateCheckout } from "@lucid/gateway/funcs/billing-create-checkout.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await billingCreateCheckout(lucidGateway, { adminKey: "", }, "", { plan: "", successUrl: "https://glorious-dwell.com/", cancelUrl: "https://wiggly-reorganisation.info/", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("billingCreateCheckout failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.CreateCheckoutSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-checkout-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `tenantId` | *string* | :heavy_check_mark: | N/A | | `body` | [models.CreateCheckoutRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/create-checkout-request.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.CreateCheckoutResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-checkout-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## createPortal Create Stripe billing portal ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.billing.createPortal({ adminKey: "", }, "", { returnUrl: "https://selfish-republican.info/", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { billingCreatePortal } from "@lucid/gateway/funcs/billing-create-portal.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await billingCreatePortal(lucidGateway, { adminKey: "", }, "", { returnUrl: "https://selfish-republican.info/", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("billingCreatePortal failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.CreatePortalSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-portal-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `tenantId` - [Catalog SDK](/reference/gateway-sdk/namespaces/catalog): Builtin server catalog (MCPGate) # Catalog SDK ## Overview Builtin server catalog (MCPGate) ### Available Operations * [listBuiltinServers](#listbuiltinservers) - List builtin MCP servers ## listBuiltinServers List builtin MCP servers ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.catalog.listBuiltinServers(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { catalogListBuiltinServers } from "@lucid/gateway/funcs/catalog-list-builtin-servers.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await catalogListBuiltinServers(lucidGateway); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("catalogListBuiltinServers failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListBuiltinServersResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/list-builtin-servers-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | - [Chains SDK](/reference/gateway-sdk/namespaces/chains): Multi-step tool execution chains (MCPGate) # Chains SDK ## Overview Multi-step tool execution chains (MCPGate) ### Available Operations * [executeChain](#executechain) - Execute a multi-step tool chain ## executeChain Requires 'chains' feature in tenant plan. ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.chains.executeChain({ steps: [ { id: "", server: "", tool: "", arguments: {}, }, ], }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { chainsExecuteChain } from "@lucid/gateway/funcs/chains-execute-chain.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await chainsExecuteChain(lucidGateway, { steps: [ { id: "", server: "", tool: "", arguments: {}, }, ], }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("chainsExecuteChain failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `body` | [models.ChainRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/chain-request.md) | :heavy_check_mark: | N/A | | `xSessionID` | *string* | :heavy_minus_sign: | Optional session binding | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ExecuteChainResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/execute-chain-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | - [Entitlements SDK](/reference/gateway-sdk/namespaces/entitlements): Subscription entitlements and feature gates (Control-Plane) # Entitlements SDK ## Overview Subscription entitlements and feature gates (Control-Plane) ### Available Operations * [getEntitlements](#getentitlements) - Get tenant entitlements * [listAvailablePlans](#listavailableplans) - List available plans * [getAvailablePlan](#getavailableplan) - Get plan details * [trackUsage](#trackusage) - Track usage metric * [getUsageMetric](#getusagemetric) - Get usage metric value * [syncSubscription](#syncsubscription) - Sync subscription from billing ## getEntitlements Get tenant entitlements ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.entitlements.getEntitlements(""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { entitlementsGetEntitlements } from "@lucid/gateway/funcs/entitlements-get-entitlements.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await entitlementsGetEntitlements(lucidGateway, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("entitlementsGetEntitlements failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `tenantId` | *string* | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetEntitlementsResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-entitlements-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## listAvailablePlans List available plans ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.entitlements.listAvailablePlans(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { entitlementsListAvailablePlans } from "@lucid/gateway/funcs/entitlements-list-available-plans.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await entitlementsListAvailablePlans(lucidGateway); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("entitlementsListAvailablePlans failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListAvailablePlansResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/list-available-plans-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | --------------------- - [Health SDK](/reference/gateway-sdk/namespaces/health): [healthCheck](#healthcheck) - Service health check # Health SDK ## Overview Health checks ### Available Operations * [healthCheck](#healthcheck) - Service health check ## healthCheck Service health check ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.health.healthCheck(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { healthHealthCheck } from "@lucid/gateway/funcs/health-health-check.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await healthHealthCheck(lucidGateway); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("healthHealthCheck failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.HealthResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/health-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | - [Inference SDK](/reference/gateway-sdk/namespaces/inference): OpenAI-compatible chat completions and embeddings (TrustGate) # Inference SDK ## Overview OpenAI-compatible chat completions and embeddings (TrustGate) ### Available Operations * [chatCompletions](#chatcompletions) - Create chat completion * [createEmbedding](#createembedding) - Create embedding ## chatCompletions OpenAI-compatible chat completions through TrustGate. Supports x402 payment — if tenant has payment enabled, requests without valid payment proof receive HTTP 402 with payment instructions. ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.inference.chatCompletions({ body: { model: "Prius", messages: [], }, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { inferenceChatCompletions } from "@lucid/gateway/funcs/inference-chat-completions.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await inferenceChatCompletions(lucidGateway, { body: { model: "Prius", messages: [], }, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("inferenceChatCompletions failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.ChatCompletionsRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/chat-completions-request.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ChatCompletionResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/chat-completion-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.ErrorT | 401 | application/json | | errors.X402PaymentRequiredError | 402 | application/json | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## createEmbedding Create embedding ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.inference.createEmbedding({ model: "Prius", input: [ "", "", "", ], }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { inferenceCreateEmbedding } from "@lucid/gateway/funcs/inference-create-embedding.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await inferenceCreateEmbedding(lucidGateway, { model: "Prius", input: [ "", "", "", ], }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("inferenceCreateEmbedding failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `body` | [models.EmbeddingRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/embedding-request.md) | :heavy_check_mark: | N/A | | `xPaymentProof` | *string* | :heavy_minus_sign: | N/A | | `xPaymentSession` | *string* | :heavy_minus_sign: | N/A - [Keys SDK](/reference/gateway-sdk/namespaces/keys): API key management (Control-Plane) # Keys SDK ## Overview API key management (Control-Plane) ### Available Operations * [createKey](#createkey) - Create API key (raw key returned once) * [listKeys](#listkeys) - List API keys (no raw keys) * [deleteKey](#deletekey) - Disable API key * [updateKeyScopes](#updatekeyscopes) - Update key scopes ## createKey Create API key (raw key returned once) ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.keys.createKey({ adminKey: "", }, ""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { keysCreateKey } from "@lucid/gateway/funcs/keys-create-key.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await keysCreateKey(lucidGateway, { adminKey: "", }, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("keysCreateKey failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.CreateKeySecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-key-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `tenantId` | *string* | :heavy_check_mark: | N/A | | `body` | [operations.CreateKeyRequestBody](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-key-request-body.md) | :heavy_minus_sign: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.CreateKeyResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-key-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## listKeys List API keys (no raw keys) ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.keys.listKeys({ adminKey: "", }, ""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { keysListKeys } from "@lucid/gateway/funcs/keys-list-keys.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await keysListKeys(lucidGateway, { adminKey: "", }, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("keysListKeys failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.ListKeysSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/list-keys-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `tenantId` | *string* | :heavy_check_mark: | N/A - [Models SDK](/reference/gateway-sdk/namespaces/models): Model catalog (TrustGate) # Models SDK ## Overview Model catalog (TrustGate) ### Available Operations * [listModels](#listmodels) - List available models ## listModels List available models ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.models.listModels(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { modelsListModels } from "@lucid/gateway/funcs/models-list-models.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await modelsListModels(lucidGateway); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("modelsListModels failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListModelsResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/list-models-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | - [Payment SDK](/reference/gateway-sdk/namespaces/payment): x402 payment configuration and pipelines (Control-Plane) # Payment SDK ## Overview x402 payment configuration and pipelines (Control-Plane) ### Available Operations * [getPaymentConfig](#getpaymentconfig) - Get tenant payment config * [setPaymentConfig](#setpaymentconfig) - Enable/configure x402 payment * [disablePayment](#disablepayment) - Disable payment (free access) * [createPipeline](#createpipeline) - Create payment pipeline * [listPipelines](#listpipelines) - List payment pipelines * [getPipeline](#getpipeline) - Get pipeline by name * [deletePipeline](#deletepipeline) - Delete pipeline ## getPaymentConfig Get tenant payment config ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.payment.getPaymentConfig({ adminKey: "", }, ""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { paymentGetPaymentConfig } from "@lucid/gateway/funcs/payment-get-payment-config.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await paymentGetPaymentConfig(lucidGateway, { adminKey: "", }, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("paymentGetPaymentConfig failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.GetPaymentConfigSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-payment-config-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `id` | *string* | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetPaymentConfigResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-payment-config-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## setPaymentConfig Enable/configure x402 payment ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.payment.setPaymentConfig({ adminKey: "", }, "", {}); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { paymentSetPaymentConfig } from "@lucid/gateway/funcs/payment-set-payment-config.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await paymentSetPaymentConfig(lucidGateway, { adminKey: "", }, "", {}); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("paymentSetPaymentConfig failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.SetPaymentConfigSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/set-payment-config-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `id` | *string* | :heavy_check_mark: | N/A | | `body` | [models.PaymentConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/l - [Plans SDK](/reference/gateway-sdk/namespaces/plans): Plan tiers and upgrades (Control-Plane) # Plans SDK ## Overview Plan tiers and upgrades (Control-Plane) ### Available Operations * [listPlans](#listplans) - List all plans with limits * [getPlan](#getplan) - Get plan details * [upgradePlan](#upgradeplan) - Upgrade tenant plan * [getPlanHistory](#getplanhistory) - Get plan change history ## listPlans List all plans with limits ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.plans.listPlans({ adminKey: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { plansListPlans } from "@lucid/gateway/funcs/plans-list-plans.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await plansListPlans(lucidGateway, { adminKey: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("plansListPlans failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.ListPlansSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/list-plans-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListPlansResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/list-plans-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## getPlan Get plan details ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.plans.getPlan({ adminKey: "", }, ""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { plansGetPlan } from "@lucid/gateway/funcs/plans-get-plan.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await plansGetPlan(lucidGateway, { adminKey: "", }, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("plansGetPlan failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.GetPlanSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-plan-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `plan` | *string* | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. - [Plugins SDK](/reference/gateway-sdk/namespaces/plugins): Plugin bundles for MCP servers (MCPGate) # Plugins SDK ## Overview Plugin bundles for MCP servers (MCPGate) ### Available Operations * [listPlugins](#listplugins) - List plugins * [createPlugin](#createplugin) - Create a plugin * [getPlugin](#getplugin) - Get plugin details ## listPlugins Requires 'plugins' feature in tenant plan. ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.plugins.listPlugins(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { pluginsListPlugins } from "@lucid/gateway/funcs/plugins-list-plugins.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await pluginsListPlugins(lucidGateway); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("pluginsListPlugins failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `category` | *string* | :heavy_minus_sign: | N/A | | `page` | *number* | :heavy_minus_sign: | N/A | | `perPage` | *number* | :heavy_minus_sign: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.ListPluginsResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/list-plugins-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## createPlugin Requires 'plugins' feature in tenant plan. ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.plugins.createPlugin({ name: "", category: "", riskLevel: "read", serverPassportIds: [ "", ], skills: [ {}, ], }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { pluginsCreatePlugin } from "@lucid/gateway/funcs/plugins-create-plugin.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await pluginsCreatePlugin(lucidGateway, { name: "", category: "", riskLevel: "read", serverPassportIds: [ "", ], skills: [ {}, ], }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("pluginsCreatePlugin failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [models.CreatePluginRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/create-plugin-request.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: - [Quotas SDK](/reference/gateway-sdk/namespaces/quotas): Quota limits and usage (Control-Plane) # Quotas SDK ## Overview Quota limits and usage (Control-Plane) ### Available Operations * [getQuotas](#getquotas) - Get tenant quota usage * [setQuotaLimits](#setquotalimits) - Set quota limits * [resetQuotas](#resetquotas) - Reset quota usage ## getQuotas Get tenant quota usage ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.quotas.getQuotas({ adminKey: "", }, ""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { quotasGetQuotas } from "@lucid/gateway/funcs/quotas-get-quotas.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await quotasGetQuotas(lucidGateway, { adminKey: "", }, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("quotasGetQuotas failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.GetQuotasSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-quotas-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `tenantId` | *string* | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetQuotasResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-quotas-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## setQuotaLimits Set quota limits ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.quotas.setQuotaLimits({ adminKey: "", }, "", { maxRequests: 706802, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { quotasSetQuotaLimits } from "@lucid/gateway/funcs/quotas-set-quota-limits.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await quotasSetQuotaLimits(lucidGateway, { adminKey: "", }, "", { maxRequests: 706802, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("quotasSetQuotaLimits failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.SetQuotaLimitsSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/set-quota-limits-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `tenantId` | *string* | :heavy_check_mark: | N/A | | `body` | [operations.SetQuotaLimitsRequestBody](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/set-quota-limits-request-body.md) | :heavy_check_mark: - [Reputation SDK](/reference/gateway-sdk/namespaces/reputation): Agent payment reputation (Control-Plane) # Reputation SDK ## Overview Agent payment reputation (Control-Plane) ### Available Operations * [getAgentReputation](#getagentreputation) - Get agent reputation score ## getAgentReputation Get agent reputation score ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.reputation.getAgentReputation({ adminKey: "", }, ""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { reputationGetAgentReputation } from "@lucid/gateway/funcs/reputation-get-agent-reputation.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await reputationGetAgentReputation(lucidGateway, { adminKey: "", }, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("reputationGetAgentReputation failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.GetAgentReputationSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-agent-reputation-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `agentId` | *string* | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ReputationScore](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/reputation-score.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | - [Servers SDK](/reference/gateway-sdk/namespaces/servers): MCP server registration and management (MCPGate) # Servers SDK ## Overview MCP server registration and management (MCPGate) ### Available Operations * [registerServer](#registerserver) - Register an MCP server * [listServers](#listservers) - List registered servers * [deleteServer](#deleteserver) - Delete a registered server ## registerServer Register an MCP server ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.servers.registerServer({ name: "", transport: "streamable-http", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { serversRegisterServer } from "@lucid/gateway/funcs/servers-register-server.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await serversRegisterServer(lucidGateway, { name: "", transport: "streamable-http", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("serversRegisterServer failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [models.ServerRegistration](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/server-registration.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.RegisterServerResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/register-server-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## listServers List registered servers ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.servers.listServers(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { serversListServers } from "@lucid/gateway/funcs/servers-list-servers.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await serversListServers(lucidGateway); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("serversListServers failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `page` | *number* | :heavy_minus_sign: | N/A | | `perPage` | *number* | :heavy_minus_sign: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be - [Sessions SDK](/reference/gateway-sdk/namespaces/sessions): Budget-scoped sessions for agent tool use (MCPGate) # Sessions SDK ## Overview Budget-scoped sessions for agent tool use (MCPGate) ### Available Operations * [createSession](#createsession) - Create a budget-scoped session * [getSession](#getsession) - Get session details and usage * [deleteSession](#deletesession) - Close a session ## createSession Create a budget-scoped session ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.sessions.createSession({ budget: {}, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { sessionsCreateSession } from "@lucid/gateway/funcs/sessions-create-session.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await sessionsCreateSession(lucidGateway, { budget: {}, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("sessionsCreateSession failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [models.CreateSessionRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/create-session-request.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.CreateSessionResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-session-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## getSession Get session details and usage ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.sessions.getSession(""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { sessionsGetSession } from "@lucid/gateway/funcs/sessions-get-session.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await sessionsGetSession(lucidGateway, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("sessionsGetSession failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `id` | *string* | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under cer - [Tenants SDK](/reference/gateway-sdk/namespaces/tenants): Tenant CRUD (Control-Plane) # Tenants SDK ## Overview Tenant CRUD (Control-Plane) ### Available Operations * [createTenant](#createtenant) - Create a tenant * [listTenants](#listtenants) - List tenants * [getTenant](#gettenant) - Get tenant by ID * [updateTenant](#updatetenant) - Update tenant * [deleteTenant](#deletetenant) - Delete tenant ## createTenant Create a tenant ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.tenants.createTenant({ adminKey: "", }, { id: "", name: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { tenantsCreateTenant } from "@lucid/gateway/funcs/tenants-create-tenant.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await tenantsCreateTenant(lucidGateway, { adminKey: "", }, { id: "", name: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("tenantsCreateTenant failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [models.CreateTenantRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/create-tenant-request.md) | :heavy_check_mark: | The request object to use for the request. | | `security` | [operations.CreateTenantSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/create-tenant-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.Tenant](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/tenant.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## listTenants List tenants ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.tenants.listTenants({ adminKey: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { tenantsListTenants } from "@lucid/gateway/funcs/tenants-list-tenants.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await tenantsListTenants(lucidGateway, { adminKey: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("tenantsListTenants failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.ListTenantsSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/list-tenants-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `limit` | *number* | :heavy_minus_sign: | N/A | | `offset` | *number* | :heavy_minus_sign: - [Tools SDK](/reference/gateway-sdk/namespaces/tools): MCP tool execution and discovery (MCPGate) # Tools SDK ## Overview MCP tool execution and discovery (MCPGate) ### Available Operations * [callTool](#calltool) - Execute an MCP tool * [listTools](#listtools) - List available tools * [discoverTools](#discovertools) - Semantic tool discovery ## callTool Execute an MCP tool ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.tools.callTool({ serverId: "", toolName: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { toolsCallTool } from "@lucid/gateway/funcs/tools-call-tool.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await toolsCallTool(lucidGateway, { serverId: "", toolName: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("toolsCallTool failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [models.ToolCallRequest](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/tool-call-request.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ToolCallResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/tool-call-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.ErrorT | 403 | application/json | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## listTools List available tools ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway({ bearerAuth: "", }); async function run() { const result = await lucidGateway.tools.listTools(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { toolsListTools } from "@lucid/gateway/funcs/tools-list-tools.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore({ bearerAuth: "", }); async function run() { const res = await toolsListTools(lucidGateway); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("toolsListTools failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `server` | *string* | :heavy_minus_sign: | Filter by server ID | | `search` | *string* | :heavy_minus_sign: | Filter by tool name | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` - [Usage SDK](/reference/gateway-sdk/namespaces/usage): Usage analytics (Control-Plane) # Usage SDK ## Overview Usage analytics (Control-Plane) ### Available Operations * [getTenantUsage](#gettenantusage) - Get tenant usage stats * [getUsageOverview](#getusageoverview) - Platform usage overview ## getTenantUsage Get tenant usage stats ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.usage.getTenantUsage({ adminKey: "", }, ""); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { usageGetTenantUsage } from "@lucid/gateway/funcs/usage-get-tenant-usage.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await usageGetTenantUsage(lucidGateway, { adminKey: "", }, ""); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("usageGetTenantUsage failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` | [operations.GetTenantUsageSecurity](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-tenant-usage-security.md) | :heavy_check_mark: | The security requirements to use for the request. | | `tenantId` | *string* | :heavy_check_mark: | N/A | | `from` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | | `to` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | | `product` | *string* | :heavy_minus_sign: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[operations.GetTenantUsageResponse](https://github.com/lucid-fdn/lucid-cloud/blob/main/sdk/lucid-gateway-typescript/docs/models/operations/get-tenant-usage-response.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LucidGatewayDefaultError | 4XX, 5XX | \*/\* | ## getUsageOverview Platform usage overview ### Example Usage ```typescript import { LucidGateway } from "@lucid/gateway"; const lucidGateway = new LucidGateway(); async function run() { const result = await lucidGateway.usage.getUsageOverview({ adminKey: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LucidGatewayCore } from "@lucid/gateway/core.js"; import { usageGetUsageOverview } from "@lucid/gateway/funcs/usage-get-usage-overview.js"; // Use `LucidGatewayCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const lucidGateway = new LucidGatewayCore(); async function run() { const res = await usageGetUsageOverview(lucidGateway, { adminKey: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("usageGetUsageOverview failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `security` ## lucid-l2-modules - [Anchoring](/reference/lucid-l2/modules/anchoring): The anchoring module in the Lucid L2 platform is designed to manage the lifecycle of digital artifacts by anchoring them to decentralized storage. This module ensures that artifact # Anchoring # Anchoring ## Purpose The anchoring module in the Lucid L2 platform is designed to manage the lifecycle of digital artifacts by anchoring them to decentralized storage. This module ensures that artifacts are stored reliably and can be verified for existence and integrity over time. It addresses the problem of maintaining a verifiable and persistent record of artifacts, which is crucial for applications requiring auditability and data integrity. ### Architecture The module is structured around three main components: `AnchorDispatcher`, `AnchorVerifier`, and `IAnchorRegistry`. The `AnchorDispatcher` handles the uploading of artifacts to decentralized storage and records their metadata in a registry. The `AnchorVerifier` checks the existence of these artifacts in storage to ensure their continued availability. The `IAnchorRegistry` interface, with implementations for both in-memory and Postgres-backed storage, manages the metadata records of anchored artifacts. Key design choices include: - **Storage Tiering**: Artifacts can be stored in either "permanent" or "evolving" storage tiers, determined by the `StorageTier` type. This allows for flexibility in storage cost and persistence requirements. - **Registry Implementations**: The choice between `InMemoryAnchorRegistry` and `PostgresAnchorRegistry` allows for different persistence strategies, with the latter supporting more robust, production-grade deployments. - **Singleton Pattern**: The use of singleton factory functions (`getAnchorDispatcher`, `getAnchorVerifier`, `getAnchorRegistry`) ensures that only one instance of each component is used throughout the application, optimizing resource usage. ### Data Flow 1. **Artifact Anchoring**: - File: `index.ts` → Function: `getAnchorDispatcher` → Class: `AnchorDispatcher` - The `dispatch` method in `dispatcher.ts` uploads the artifact to the appropriate storage tier (`permanent` or `evolving`) using `IDepinStorage`. - The artifact's metadata, including its content hash and storage details, is recorded in the registry via `IAnchorRegistry.create`. 2. **Artifact Verification**: - File: `index.ts` → Function: `getAnchorVerifier` → Class: `AnchorVerifier` - The `verify` method in `verifier.ts` checks the existence of the artifact in storage using its CID. - The artifact's status is updated in the registry to either "verified" or "unreachable" using `IAnchorRegistry.updateStatus`. 3. **Registry Management**: - File: `index.ts` → Function: `getAnchorRegistry` → Interface: `IAnchorRegistry` - The registry methods (`create`, `getById`, `getByArtifact`, etc.) in `registry.ts` manage the lifecycle and retrieval of artifact metadata. ### Patterns & Gotchas - **Deduplication Logic**: In both registry implementations, deduplication is performed based on `artifact_type`, `artifact_id`, and `content_hash`. This ensures that identical artifacts are not redundantly stored. - **Environment Configuration**: The choice between in-memory and Postgres registry is controlled by the `ANCHOR_REGISTRY_STORE` environment variable. Ensure this is correctly set in production environments. - **Kill Switch**: The `dispatch` method includes a kill switch controlled by the `DEPIN_UPLOAD_ENABLED` environment variable. If set to 'false', uploads are silently skipped, which can be useful for testing or maintenance. - **Recursive Lineage Retrieval**: The `getLineage` method in `registry.ts` uses recursion to trace the ancestry of an artifact. Be cautious of potential infinite loops if the lineage data is malformed. - **Timestamp Handling**: Timestamps are stored as Unix milliseconds, and care should be taken when converting between different time formats, especially in the `PostgresAnchorRegistry` implementation. ## Architecture The module is structured around three main components: `AnchorDispatcher`, `AnchorVerifier`, and `IAnchorRegistry`. The `AnchorDispatcher` handles the uploading of artifacts to decentralized storage and records their metadata in a registry. The `AnchorVerifier` checks the existence of these artifacts in storage to ensure their continued availability. The `IAnchorRegistry` interface, with implementations for both in-memory and Postgres-backed storage, manages the metadata records of anchored artifacts. Key design choices include: - **Storage Tiering**: Artifacts can be stored in either "permanent" or "evolving" storage tiers, determined by the `StorageTier` type. This allows for flexibility in storage cost and persistence requirements. - **Registry Implementations**: The choice between `InMemoryAnchorRegistry` and `PostgresAnchorRegistry` allows for different persistence strategies, with the latter supporting more robust, production-grade deployments. - **Singleton Pattern**: The use of singleton factory functions (`getAnchorDispatcher`, `getAnchorVerifier`, `getAnchorRegistry`) ensures that only one instance of each component is used throughout the application, optimizing resource usage. ### Data Flow 1. **Artifact Anchoring**: - File: `index.ts` → Function: `getAnchorDispatcher` → Class: `AnchorDispatcher` - The `dispatch` method in `dispatcher.ts` uploads the artifact to the appropriate storage tier (`permanent` or `evolving`) using `IDepinStorage`. - The artifact's metadata, including its content hash and storage details, is recorded in the registry via `IAnchorRegistry.create`. 2. **Artifact Verification**: - File: `index.ts` → Function: `getAnchorVerifier` → Class: `AnchorVerifier` - The `verify` method in `verifier.ts` checks the existence of the artifact in storage using its CID. - The artifact's status is updated in the registry to either "verified" or "unreachable" using `IAnchorRegistry.updateStatus`. 3. **Registry Management**: - File: `index.ts` → Function: `getAnchorRegistry` → Interface: `IAnchorRegistry` - The registry methods (`create`, `getById`, `getByArtifact`, etc.) in `registry.ts` manage the lifecycle and retrieval of artifact metadata. ### Patterns & Gotchas - **Deduplication Logic**: In both registry implementations, deduplication is performed based on `artifact_type`, `artifact_id`, and `content_hash`. This ensures that identical artifacts are not redundantly stored. - **Environment Configuration**: The choice between in-memory and Postgres registry is controlled by the `ANCHOR_REGISTRY_STORE` environment variable. Ensure this is correctly set in production environments. - **Kill Switch**: The `dispatch` method includes a kill switch controlled by the `DEPIN_UPLOAD_ENABLED` environment variable. If set to 'false', uploads are silently skipped, which can be useful for testing or maintenance. - **Recursive Lineage Retrieval**: The `getLineage` method in `registry.ts` uses recursion to trace the ancestry of an artifact. Be cautious of potential infinite loops if the lineage data is malformed. - **Timestamp Handling**: Timestamps are stored as Unix milliseconds, and care should be taken when converting between different time formats, especially in the `PostgresAnchorRegistry` implementation. ## Data Flow 1. **Artifact Anchoring**: - File: `index.ts` → Function: `getAnchorDispatcher` → Class: `AnchorDispatcher` - The `dispatch` method in `dispatcher.ts` uploads the artifact to the appropriate storage tier (`permanent` or `evolving`) using `IDepinStorage`. - The artifact's metadata, including its content hash and storage details, is recorded in the registry via `IAnchorRegistry.create`. 2. **Artifact Verification**: - File: `index.ts` → Function: `getAnchorVerifier` → Class: `AnchorVerifier` - The `verify` method in `verifier.ts` checks the existence of the artifact in storage using its CID. - The artifact's status is updated in the registry to either "verified" or "unreachable" using `IAnchorRegistry.updateStatus`. 3. **Registry Management**: - File: `index.ts` → Function: `getAnchorRegistry` → Interface: `IAnchorRegistry` - The registry methods (`create`, `getById`, `getByArtifact`, etc.) in `registry.ts` manage the lifecycle and retrieval of artifact metadata. ### Patterns & Gotchas - **Deduplication Logic**: In both registry implementations, deduplication is performed based on `artifact_type`, `artifact_id`, and `content_hash`. This ensures that identical artifacts are not redundantly stored. - **Environment Configuration**: The choice between in-memory and Postgres registry is controlled by the `ANCHOR_REGISTRY_STORE` environment variable. Ensure this is correctly set in production environments. - **Kill Switch**: The `dispatch` method includes a kill switch controlled by the `DEPIN_UPLOAD_ENABLED` environment variable. If set to 'false', uploads are silently skipped, which can be useful for testing or maintenance. - **Recursive Lineage Retrieval**: The `getLineage` method in `registry.ts` uses recursion to trace the ancestry of an artifact. Be cautious of potential infinite loops if the lineage data is malformed. - **Timestamp Handling**: Timestamps are stored as Unix milliseconds, and care should be taken when converting between different time formats, especially in the `PostgresAnchorRegistry` implementation. ## Key Interfaces | Interface | File | Role | |-----------|------|------| | `AnchorRecord` | `types.ts` | — | | `AnchorRequest` | `types.ts` | — | | `AnchorResult` | `types.ts` | — | | `IAnchorRegistry` | `registry.ts` | — | ## Cross-Domain Dependencies | Direction | Domain | Symbols | Purpose | |-----------|--------|---------|---------| | imports | shared | `IDepinStorage`, `UploadResult`, `canonicalJson`, `getEvolvingStorage`, `getPermanentStorage` | — | ## Patterns & Gotchas - **Deduplication Logic**: In both registry implementations, deduplication is performed based on `artifact_type`, `artifact_id`, and `content_hash`. This ensures that identical artifacts are not redundantly stored. - **Environment Configuration**: The choice between in-memory and Postgres registry is controlled by the `ANCHOR_REGISTRY_STORE` environment variable. Ensure this is correctly set in production environments. - **Kill Switch**: The `dispatch` method includes a kill switch controlled by the `DEPIN_UPLOAD_ENABLED` environment variable. If set to 'false', uploads are silently skipped, which can be useful for testing or maintenance. - **Recursive Lineage Retrieval**: The `getLineage` method in `registry.ts` uses recursion to trace the ancestry of an artifact. Be cautious of potential infinite loops if the lineage data is malformed. - **Timestamp Handling**: Timestamps are stored as Unix milliseconds, and care should be taken when converting between different time formats, especially in the `PostgresAnchorRegistry` implementation. - [Compute](/reference/lucid-l2/modules/compute): The compute domain module in the Lucid L2 platform is designed to manage the lifecycle of AI agents, from deployment to revenue management. It provides a comprehensive framework fo # Compute # Compute ## Purpose The `compute` domain module in the Lucid L2 platform is designed to manage the lifecycle of AI agents, from deployment to revenue management. It provides a comprehensive framework for deploying AI agents to various runtime environments, handling agent-to-agent (A2A) communication, and managing agent revenue streams. This module solves the problem of orchestrating complex deployment workflows, ensuring seamless integration with runtime environments, and facilitating revenue distribution for deployed agents. ## Architecture The module is structured around several key components: 1. **Deployment Management**: The `AgentDeploymentService` orchestrates the deployment pipeline, integrating schema validation, runtime adapter selection, and deployment execution via the `IDeployer` interface. It ensures durable state management through `IDeploymentStore`. 2. **A2A Communication**: The A2A protocol is implemented via server-side components in `a2aServer.ts`, which handle task creation, state updates, and artifact management. The client-side interactions are managed through functions in `a2aClient.ts`. 3. **Revenue Management**: The `agentRevenueService.ts` manages the revenue lifecycle, from processing agent receipts to distributing revenue through airdrops. It uses an in-memory `AgentRevenuePool` to track accumulated revenues. 4. **Runtime and Deployment Interfaces**: The `IRuntimeAdapter` and `IDeployer` interfaces abstract the specifics of runtime environments and deployment targets, allowing for flexible integration with various platforms. ## Data Flow 1. **Deployment Flow**: - `agent/agentDeploymentService.ts` → `deployAgent(input: DeployAgentInput)` → `getDeploymentStore()` → `IDeployer.deploy()` - The deployment process begins with validating the agent descriptor, creating a passport, selecting a runtime adapter, and generating code. The deployment record is created in a 'pending' state, transitioning to 'deploying' upon calling the deployer. 2. **A2A Task Management**: - `agent/a2a/a2aServer.ts` → `createA2ATask(message: A2AMessage)` → `storeTask(task: A2ATask)` → `getSharedTaskStore()` - Tasks are created from incoming messages, stored in a shared task store, and can be updated or queried for status. 3. **Revenue Processing**: - `agent/agentRevenueService.ts` → `processAgentRevenue(receipt)` → `revenuePools.set()` → `triggerAgentAirdrop()` - Revenue from agent operations is processed, split according to predefined configurations, and accumulated in revenue pools. Airdrops are triggered when thresholds are met. ## Key Interfaces | Interface | File | Role | |-----------|------|------| | `A2AClientOptions` | `agent/a2a/a2aClient.ts` | — | | `A2AMessage` | `agent/a2a/a2aServer.ts` | — | | `A2APart` | `agent/a2a/a2aServer.ts` | — | | `A2ATask` | `agent/a2a/a2aServer.ts` | — | | `A2ATaskStore` | `agent/a2a/a2aServer.ts` | — | | `AgentCard` | `agent/a2a/agentCard.ts` | A2A Agent Card Generator | | `AgentCardSkill` | `agent/a2a/agentCard.ts` | — | | `AgentConfig` | `agent/agentDescriptor.ts` | — | | `AgentDescriptor` | `agent/agentDescriptor.ts` | — | | `AgentRevenuePool` | `agent/agentRevenueService.ts` | — | | `ChannelConfig` | `agent/agentDescriptor.ts` | — | | `DeployAgentInput` | `agent/agentDeploymentService.ts` | — | | `DeployAgentResult` | `agent/agentDeploymentService.ts` | — | | `DeploymentConfig` | `deploy/IDeployer.ts` | Configuration for a deployment | | `DeploymentResult` | `deploy/IDeployer.ts` | Result of a deploy operation | | `DeploymentStatus` | `deploy/IDeployer.ts` | Current status of a deployment | | `Guardrail` | `agent/agentDescriptor.ts` | — | | `HandoffRule` | `agent/agentDescriptor.ts` | — | | `IDeployer` | `deploy/IDeployer.ts` | Deployer interface — all deployment providers implement this. | | `IRuntimeAdapter` | `runtime/IRuntimeAdapter.ts` | Runtime Adapter Interface | | `LogOptions` | `deploy/IDeployer.ts` | Options for fetching deployment logs | | `MonetizationConfig` | `agent/agentDescriptor.ts` | — | | `RuntimeArtifact` | `deploy/IDeployer.ts` | Agent runtime artifact — the output of code generation, input to deployment | | `SpendingLimits` | `agent/agentDescriptor.ts` | — | | `StopCondition` | `agent/agentDescriptor.ts` | — | | `WalletConfig` | `agent/agentDescriptor.ts` | — | ### Key Types | Type | File | Kind | Description | |------|------|------|-------------| | `A2ATaskState` | `agent/a2a/a2aServer.ts` | alias | A2A Protocol Server | | `DeploymentStatusType` | `deploy/IDeployer.ts` | alias | Deployment lifecycle status | ## Cross-Domain Dependencies | Direction | Domain | Symbols | Purpose | |-----------|--------|---------|---------| | imports | deployment | `ActualState`, `Deployment`, `IDeploymentStore`, `getDeploymentStore` | — | | imports | identity | `CreatePassportInput`, `getAgentWalletProvider`, `getPassportManager` | — | | imports | payment | `SplitConfig` | — | | imports | shared | `logger`, `validateWithSchema` | — | | imports | utils | `RetryOptions`, `withRetryAndTimeout` | — | | exports to | deployment | `getDeployer` | — | ## Patterns & Gotchas - **Idempotency in Deployment**: The `deployAgent` function checks for existing deployments using an idempotency key to prevent duplicate deployments. Ensure this key is unique for each deployment attempt. - **Shared Task Store**: The `getSharedTaskStore()` function provides a singleton task store, which persists tasks across requests. Be cautious of state persistence issues in concurrent environments. - **Lazy Imports**: Functions like `processAgentRevenue` use lazy imports to avoid circular dependencies. This pattern can obscure dependencies and should be documented clearly. - **Revenue Split Validation**: The revenue split configuration in the agent descriptor must not exceed 100%. This cross-field validation is crucial to prevent configuration errors. - **Non-blocking Operations**: Several operations, such as wallet creation and airdrop execution, are designed to be non-blocking. Errors in these operations are logged but do not halt the deployment process, which can lead to silent failures if not monitored. - **Deployment State Transitions**: The deployment service uses explicit state transitions and event emissions to track deployment progress. Ensure that state transitions are correctly handled to maintain consistency in the deployment lifecycle. - [EpochRegistry — EVM Contract](/reference/lucid-l2/modules/contracts/epochregistry): > Source: C:Lucid-L2contractssrcEpochRegistry.sol # EpochRegistry — EVM Contract # EpochRegistry — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\EpochRegistry.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `setSubmitter` | external | address submitter, bool authorized | | `commitEpoch` | external | bytes32 agentId, bytes32 mmrRoot, uint64 epochId, uint64 leafCount, uint64 mmrSize | | `commitEpochBatch` | external | bytes32[] calldata agentIds, bytes32[] calldata mmrRoots, uint64[] calldata epochIds, uint64[] calldata leafCounts, uint64[] calldata mmrSizes | | `_commitEpoch` | internal | bytes32 agentId, bytes32 mmrRoot, uint64 epochId, uint64 leafCount, uint64 mmrSize | | `getEpoch` | external | bytes32 agentId, uint64 epochId | | `getLatestEpoch` | external | bytes32 agentId | | `getEpochCount` | external | bytes32 agentId | | `verifyEpochInclusion` | external | bytes32 agentId, uint64 epochId, bytes32 mmrRoot | | `getEpochRange` | external | bytes32 agentId, uint256 offset, uint256 limit | ## Events | Event | Parameters | |-------|------------| | `EpochCommitted` | bytes32 indexed agentId, uint64 indexed epochId, bytes32 mmrRoot, uint64 leafCount, uint64 mmrSize, uint256 timestamp | | `SubmitterAuthorized` | address indexed submitter, bool authorized | - [Lucid — EVM Contract](/reference/lucid-l2/modules/contracts/lucid): > Source: C:Lucid-L2contractssrcLucid.sol # Lucid — EVM Contract # Lucid — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\Lucid.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `decimals` | public | — | | `mint` | external | address to, uint256 amount | - [LucidArbitration — EVM Contract](/reference/lucid-l2/modules/contracts/lucidarbitration): > Source: C:Lucid-L2contractssrcLucidArbitration.sol # LucidArbitration — EVM Contract # LucidArbitration — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\LucidArbitration.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `openDispute` | external | bytes32 escrowId, string calldata reason | | `submitEvidence` | external | bytes32 disputeId, bytes32 receiptHash, bytes32 mmrRoot, bytes calldata mmrProof, string calldata description | | `resolveDispute` | external | bytes32 disputeId | | `appealDecision` | external | bytes32 disputeId | | `getDispute` | external | bytes32 disputeId | | `getEvidenceCount` | external | bytes32 disputeId | | `getEvidence` | external | bytes32 disputeId, uint256 index | ## Events | Event | Parameters | |-------|------------| | `DisputeOpened` | bytes32 indexed disputeId, bytes32 indexed escrowId, address indexed initiator, string reason, uint256 evidenceDeadline | | `EvidenceSubmitted` | bytes32 indexed disputeId, address indexed submitter, bytes32 receiptHash, bytes32 mmrRoot | | `DisputeResolved` | bytes32 indexed disputeId, address indexed resolvedInFavorOf, bool hasValidReceipt | | `DisputeAppealed` | bytes32 indexed disputeId, address indexed appealedBy, uint256 newDeadline | - [LucidEscrow — EVM Contract](/reference/lucid-l2/modules/contracts/lucidescrow): > Source: C:Lucid-L2contractssrcLucidEscrow.sol # LucidEscrow — EVM Contract # LucidEscrow — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\LucidEscrow.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `createEscrow` | external | address beneficiary, address token, uint256 amount, uint256 duration, bytes32 expectedReceiptHash | | `releaseEscrow` | external | bytes32 escrowId, bytes32 receiptHash, bytes calldata receiptSignature, bytes32 signerPubkey | | `claimTimeout` | external | bytes32 escrowId | | `disputeEscrow` | external | bytes32 escrowId, string calldata reason | | `resolveDispute` | external | bytes32 escrowId, address winner | | `setArbitrationContract` | external | address _arbitrationContract | | `getEscrow` | external | bytes32 escrowId | ## Events | Event | Parameters | |-------|------------| | `EscrowCreated` | bytes32 indexed escrowId, address indexed depositor, address indexed beneficiary, address token, uint256 amount, uint256 expiresAt, bytes32 expectedReceiptHash | | `EscrowReleased` | bytes32 indexed escrowId, address indexed beneficiary, uint256 amount, bytes32 receiptHash | | `EscrowRefunded` | bytes32 indexed escrowId, address indexed depositor, uint256 amount | | `EscrowDisputed` | bytes32 indexed escrowId, address indexed disputedBy, string reason | - [LucidPassportRegistry — EVM Contract](/reference/lucid-l2/modules/contracts/lucidpassportregistry): > Source: C:Lucid-L2contractssrcLucidPassportRegistry.sol # LucidPassportRegistry — EVM Contract # LucidPassportRegistry — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\LucidPassportRegistry.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `setSyncer` | external | address syncer, bool authorized | | `anchorPassport` | external | bytes32 passportId, bytes32 contentHash, address passportOwner | | `updateStatus` | external | bytes32 passportId, uint8 newStatus | | `verifyAnchor` | external | bytes32 passportId, bytes32 contentHash | | `setGate` | external | bytes32 passportId, uint256 priceNative, uint256 priceLucid | | `payForAccess` | external | bytes32 passportId, uint64 duration | | `payForAccessLucid` | external | bytes32 passportId, uint64 duration | | `checkAccess` | external | bytes32 passportId, address user | | `withdrawRevenue` | external | bytes32 passportId | | `revokeAccess` | external | bytes32 passportId, address user | ## Events | Event | Parameters | |-------|------------| | `PassportAnchored` | bytes32 indexed passportId, bytes32 contentHash, address indexed owner | | `PassportStatusUpdated` | bytes32 indexed passportId, uint8 oldStatus, uint8 newStatus | | `SyncerUpdated` | address indexed syncer, bool authorized | | `GateSet` | bytes32 indexed passportId, uint256 priceNative, uint256 priceLucid | | `AccessPurchased` | bytes32 indexed passportId, address indexed payer, uint64 expiresAt, uint256 paid | | `RevenueWithdrawn` | bytes32 indexed passportId, address indexed to, uint256 amountNative, uint256 amountLucid | | `AccessRevoked` | bytes32 indexed passportId, address indexed user | - [LucidPaymaster — EVM Contract](/reference/lucid-l2/modules/contracts/lucidpaymaster): > Source: C:Lucid-L2contractssrcLucidPaymaster.sol # LucidPaymaster — EVM Contract # LucidPaymaster — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\LucidPaymaster.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `depositTo` | external | address account | | `withdrawTo` | external | address payable withdrawAddress, uint256 withdrawAmount | | `balanceOf` | external | address account | | `validatePaymasterUserOp` | external | PackedUserOperation calldata userOp, bytes32 , uint256 maxCost | | `postOp` | external | uint8 mode, bytes calldata context, uint256 actualGasCost, uint256 | | `setExchangeRate` | external | uint256 newRate | | `setMaxCost` | external | uint256 newMax | | `deposit` | external | — | | `withdrawLucid` | external | uint256 amount | | `withdrawEth` | external | uint256 amount | | `getDeposit` | external | — | | `estimateLucidCost` | external | uint256 ethCost | ## Events | Event | Parameters | |-------|------------| | `ExchangeRateUpdated` | uint256 oldRate, uint256 newRate | | `MaxCostUpdated` | uint256 oldMax, uint256 newMax | | `GasSponsored` | address indexed sender, uint256 lucidCharged, uint256 ethCost | | `Deposited` | address indexed from, uint256 amount | | `LucidWithdrawn` | address indexed to, uint256 amount | | `EthWithdrawn` | address indexed to, uint256 amount | - [LucidSessionManager — EVM Contract](/reference/lucid-l2/modules/contracts/lucidsessionmanager): > Source: C:Lucid-L2contractssrcLucidSessionManager.sol # LucidSessionManager — EVM Contract # LucidSessionManager — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\LucidSessionManager.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `createSession` | external | address delegate, uint256 permissions, uint256 expiresAt, uint256 maxAmount | | `revokeSession` | external | address delegate | | `useSession` | external | address wallet, uint256 amount | | `isSessionValid` | external | address wallet, address delegate | | `getSession` | external | address wallet, address delegate | ## Events | Event | Parameters | |-------|------------| | `SessionCreated` | address indexed wallet, address indexed delegate, uint256 permissions, uint256 expiresAt, uint256 maxAmount | | `SessionRevoked` | address indexed wallet, address indexed delegate | | `SessionUsed` | address indexed wallet, address indexed delegate, uint256 amount, uint256 totalUsed | - [LucidTBA — EVM Contract](/reference/lucid-l2/modules/contracts/lucidtba): > Source: C:Lucid-L2contractssrcLucidTBA.sol # LucidTBA — EVM Contract # LucidTBA — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\LucidTBA.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `token` | public | — | | `isValidSigner` | external | address signer, bytes calldata | | `state` | external | — | | `execute` | external | address to, uint256 value, bytes calldata data, uint8 operation | | `transferERC20` | external | address token_, address to, uint256 amount | | `owner` | public | — | | `_isOwner` | internal | address caller | - [LucidValidator — EVM Contract](/reference/lucid-l2/modules/contracts/lucidvalidator): > Source: C:Lucid-L2contractssrcLucidValidator.sol # LucidValidator — EVM Contract # LucidValidator — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\LucidValidator.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `verifyReceiptHash` | external | bytes32 receiptHash, bytes calldata preimage | | `validateReceipt` | external | bytes32 receiptHash, bytes calldata signature, bytes32 signerPubkey | | `verifyMMRProof` | external | bytes32 leafHash, bytes32[] calldata siblings, bytes32[] calldata peaks, uint64 leafIndex, bytes32 expectedRoot | | `submitValidation` | external | address validationRegistry, uint256 agentTokenId, bytes32 receiptHash, bool valid | | `verifyZkMLProof` | external | address zkmlVerifier, bytes32 modelHash, uint256[2] calldata a, uint256[2][2] calldata b, uint256[2] calldata c, uint256[] calldata publicInputs | | `_bagPeaks` | internal | bytes32[] calldata peaks | ## Events | Event | Parameters | |-------|------------| | `ValidationSubmitted` | address indexed validationRegistry, uint256 indexed agentTokenId, bytes32 receiptHash, bool valid | - [ZkMLVerifier — EVM Contract](/reference/lucid-l2/modules/contracts/zkmlverifier): > Source: C:Lucid-L2contractssrcZkMLVerifier.sol # ZkMLVerifier — EVM Contract # ZkMLVerifier — EVM Contract > **Source:** `C:\Lucid-L2\contracts\src\ZkMLVerifier.sol` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Functions | Function | Visibility | Parameters | |----------|------------|------------| | `registerModel` | external | bytes32 modelHash, G1Point calldata alpha, G2Point calldata beta, G2Point calldata gamma, G2Point calldata delta, G1Point[] calldata ic | | `verifyProof` | external | bytes32 modelHash, G1Point calldata a, G2Point calldata b, G1Point calldata c, uint256[] calldata publicInputs | | `verifyBatch` | external | bytes32[] calldata modelHashes, Proof[] calldata proofs, uint256[][] calldata inputs | | `isModelRegistered` | external | bytes32 modelHash | | `getModelCount` | external | — | | `getRegisteredModel` | external | uint256 index | | `_negate` | internal | G1Point memory p | | `_add` | internal | G1Point memory p1, G1Point memory p2 | | `_scalarMul` | internal | G1Point memory p, uint256 s | | `_pairing` | internal | G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2, G1Point memory d1, G2Point memory d2 | | `_isModelInList` | internal | bytes32 modelHash | ## Events | Event | Parameters | |-------|------------| | `ModelRegistered` | bytes32 indexed modelHash | | `ProofVerified` | bytes32 indexed modelHash, bytes32 indexed receiptHash, bool valid | - [Identity](/reference/lucid-l2/modules/identity): The identity module in the Lucid L2 platform is designed to manage digital identities through the use of passports, NFTs, and wallets. It provides a comprehensive system for creati # Identity # Identity ## Purpose The identity module in the Lucid L2 platform is designed to manage digital identities through the use of passports, NFTs, and wallets. It provides a comprehensive system for creating, updating, and managing these identities across different blockchain networks, primarily Solana and EVM. This module addresses the need for a unified identity management system that can handle multi-chain operations, ensuring that digital assets and identities are securely managed and synchronized on-chain. ## Architecture The identity module is structured around several key components: - **Passport Management**: The `passportManager.ts` file provides the core logic for managing passports, including creation, updating, and deletion. It integrates schema validation and on-chain synchronization through the `OnChainSyncHandler` interface. - **Wallet Management**: The `IAgentWalletProvider.ts` interface defines methods for wallet operations such as creating wallets, executing transactions, and setting spending limits. The `getAgentWalletProvider` function in `wallet/index.ts` provides access to the wallet provider. - **NFT Management**: The `INFTProvider.ts` interface supports chain-agnostic NFT operations like minting and burning. The `getNFTProvider` and `getAllNFTProviders` functions in `nft/index.ts` facilitate access to NFT providers. - **Token Launching**: The `ITokenLauncher.ts` interface allows for token launching operations, supporting both SPL mint and Genesis TGE. - **CAIP-10 Utilities**: The `caip10.ts` file provides utilities for parsing and validating CAIP-10 account IDs, which are crucial for cross-chain identity management. - **Identity Projection**: The `projections/` module handles async projection of Lucid passport identity to external Solana agent registries (Metaplex `mpl-agent-registry`, QuantuLabs `8004-solana`). Lucid passports are canonical; external registries are derived projections for discoverability. Uses `ISolanaIdentityRegistry` interface with a capability model, centralized ERC-8004 doc builder, and parallel projection with exponential backoff. Key design choices include the use of interfaces to abstract blockchain-specific operations, allowing the module to be easily extended to support additional chains or identity types. ## Data Flow Data flow within the identity module follows these paths: 1. **Passport Creation**: - `passport/passportManager.ts` → `createPassport` function → `stores/passportStore.ts` → `create` method. - This flow validates input, creates a passport, and stores it in the `PassportStore`. 2. **Wallet Operations**: - `wallet/index.ts` → `getAgentWalletProvider` function → `IAgentWalletProvider` interface methods. - Wallet operations such as `createWallet` and `executeTransaction` are executed through the wallet provider. 3. **NFT Minting**: - `nft/index.ts` → `getNFTProvider` function → `INFTProvider` interface methods. - The `mint` method is used to create NFTs, with metadata stored and managed through the NFT provider. 4. **On-Chain Sync**: - `passport/passportManager.ts` → `attemptOnChainSync` method → `OnChainSyncHandler` interface. - This flow handles the synchronization of passport data to the blockchain, ensuring consistency between off-chain and on-chain states. 5. **Identity Projection** (async, non-blocking): - `passport/passportManager.ts` → `triggerIdentityProjection()` → `projections/jobs/syncExternalIdentity.ts` - Persists `status: 'pending'` to `external_registrations` (durable intent), then dispatches via `setImmediate`. - `syncExternalIdentity()` fans out to all configured registries via `Promise.allSettled`. - Each registry: `buildRegistrationDocFromPassport()` → upload to DePIN → call registry SDK (e.g., `registerIdentityV1` for Metaplex). - Retry with exponential backoff + jitter (30s cap, configurable max retries). - Results persisted to `passport.external_registrations` via per-passport mutex (`updateExternalRegistration`). - Triggered on `createPassport` (register mode), `updatePassport` (sync mode), `updateEndpoints` (sync mode). ## Key Interfaces | Interface | File | Role | |-----------|------|------| | `AgentWallet` | `wallet/IAgentWalletProvider.ts` | Agent Wallet Provider Interface | | `CreatePassportInput` | `passport/passportManager.ts` | Input for creating a passport | | `ERC8004AgentMetadata` | `registries/types.ts` | ERC-8004 Registry Types | | `ERC8004RegistrationDoc` | `projections/registration-doc/types.ts` | Extended ERC-8004 doc with services, registrations, supportedTrust | | `ISolanaIdentityRegistry` | `projections/ISolanaIdentityRegistry.ts` | Capability-driven registry adapter interface | | `RegistryCapabilities` | `projections/ISolanaIdentityRegistry.ts` | Register/resolve/sync/deregister capability flags | | `IAgentWalletProvider` | `wallet/IAgentWalletProvider.ts` | — | | `INFTProvider` | `nft/INFTProvider.ts` | Chain-agnostic NFT provider. | | `ITokenLauncher` | `shares/ITokenLauncher.ts` | Token launcher interface — swappable between direct SPL mint and Genesis TGE. | | `MintResult` | `nft/INFTProvider.ts` | Result of an NFT mint operation | | `NFTMetadata` | `nft/INFTProvider.ts` | NFT metadata (follows Metaplex / OpenSea standard) | | `OnChainSyncHandler` | `passport/passportManager.ts` | On-chain sync handler interface | | `OperationResult` | `passport/passportManager.ts` | Result type for operations | | `ReputationRecord` | `registries/types.ts` | Reputation feedback record | | `ReputationSummary` | `registries/types.ts` | Average reputation score | | `SpendingLimits` | `wallet/IAgentWalletProvider.ts` | — | | `TokenInfo` | `shares/ITokenLauncher.ts` | — | | `TokenLaunchParams` | `shares/ITokenLauncher.ts` | — | | `TokenLaunchResult` | `shares/ITokenLauncher.ts` | — | | `TransactionRequest` | `wallet/IAgentWalletProvider.ts` | — | | `TransactionResult` | `wallet/IAgentWalletProvider.ts` | — | | `ValidationRecord` | `registries/types.ts` | Validation record returned from the Validation Registry | | `WalletBalance` | `wallet/IAgentWalletProvider.ts` | — | ### Key Types | Type | File | Kind | Description | |------|------|------|-------------| | `ComputeAvailabilityChecker` | `passport/passportManager.ts` | alias | Compute availability checker — injected by gateway-lite to avoid circular dependency. | | `ModelCatalogLookup` | `passport/passportManager.ts` | alias | Model catalog lookup — injected by gateway-lite to avoid circular dependency. | ## Cross-Domain Dependencies | Direction | Domain | Symbols | Purpose | |-----------|--------|---------|---------| | imports | chain | `CHAIN_CONFIGS`, `EVMAdapter`, `blockchainAdapterFactory`, `getSolanaKeypair`, `initSolana` | — | | imports | errors.ts | `ChainFeatureUnavailable` | — | | imports | shared | `AgentIdentity`, `LucidPassports`, `PATHS`, `PassportNFT`, `PassportNFTMetadata`, `ReputationData`, `SchemaId`, `getChainConfig`, `logger`, `validateWithSchema` | — | | exports to | compute | `CreatePassportInput`, `getAgentWalletProvider`, `getPassportManager` | — | | exports to | reputation | `ReputationRegistryClient`, `ValidationRegistryClient` | — | ## Patterns & Gotchas - **Schema Validation**: The `validateWithSchema` function is heavily used to ensure that metadata conforms to predefined schemas. This can be a source of errors if schemas are not correctly defined or updated. - **Chain Detection**: The system auto-detects the blockchain network (Solana or EVM) based on the format of the owner address. This can lead to issues if addresses are incorrectly formatted. - **NFT Minting**: The `attemptNFTMint` function is non-blocking and best-effort, meaning NFT minting failures do not halt passport creation. This can lead to inconsistencies if not properly monitored. - **On-Chain Sync**: The `syncToChain` function relies on an external sync handler. If this handler is not configured, on-chain synchronization will fail silently, which can be problematic for maintaining data integrity. - **Auto-Save Mechanism**: The `PassportStore` uses an auto-save mechanism to persist data. Developers must ensure that changes are marked as dirty to trigger persistence, or data may be lost. - **Identity Projection**: External registry projection is async and non-blocking — passport creation never depends on external registry health. Projections use `Promise.allSettled` (parallel), exponential backoff with jitter, and per-passport mutex for safe concurrent writes. `recoverPendingProjections()` should be called on server startup to retry stuck projections. - **Lucid Passports vs ERC-8004**: Lucid passports and Metaplex/QuantuLabs identity registrations serve different purposes. ERC-8004 is a narrow identity standard ("I exist, here's how to reach me"). Lucid passports are a rich asset record ("I exist, here's my proof, my license, my price, my audit trail, my version history"). Both records exist for the same agent — Metaplex gives discoverability in their ecosystem, Lucid gives everything else (x402 payment gates, attestations, versioning, licensing, content hashes, revenue splits, 5 asset types). - **Shared Umi**: `LazyUmi` in `shared/chains/solana/umi.ts` is used by both `MetaplexCoreProvider` (NFT minting) and `MetaplexConnection` (identity projection). Adding Umi plugins (e.g., `mplAgentIdentity`) is done via the `plugins` option, not by modifying the shared base. `LazyUmi` supports `rpcUrl` override for per-consumer network targeting. - **Multi-Network Metaplex**: `METAPLEX_RPC_URL` allows Metaplex identity registration on mainnet while Lucid (passports, epochs, anchoring) runs on devnet. If not set, falls back to `SOLANA_RPC_URL`. This enables production agent discoverability on Metaplex mainnet without requiring all Lucid programs to be deployed on mainnet. The signing wallet (`SOLANA_PRIVATE_KEY`) must have SOL on whichever network Metaplex targets. - **Metaplex Collection Required**: Agents must be minted as Core assets within a collection (`METAPLEX_COLLECTION_ADDRESS`) for `registerIdentityV1` to accept them. Standalone Core assets (no collection) are rejected by the Metaplex agent registry program. - **Idempotent Metaplex Operations**: `registerIdentityV1`, `registerExecutiveV1`, and `delegateExecutionV1` all throw "already registered/uninitialized" errors on retry. These are caught and treated as success — the projection system is fully idempotent. Understanding these patterns and potential pitfalls is crucial for effectively contributing to the identity module. - [Memory](/reference/lucid-l2/modules/memory): The memory module in the Lucid L2 platform is designed to manage and manipulate various types of memory entries, such as episodic, semantic, procedural, entity, trust-weighted, and # Memory # Memory ## Purpose The memory module in the Lucid L2 platform is designed to manage and manipulate various types of memory entries, such as episodic, semantic, procedural, entity, trust-weighted, and temporal memories. It provides a comprehensive framework for storing, retrieving, and processing memory data, enabling the platform to maintain a persistent and queryable memory store. This module addresses the need for a robust memory management system that supports complex operations like embedding, provenance tracking, and compaction, which are essential for building intelligent applications. ## Architecture The memory module is structured around several key interfaces and functions that define its capabilities. The `IMemoryStore` interface in `store/interface.ts` is central, providing methods for writing, reading, querying, and managing memory entries. The module supports different storage backends, including in-memory, SQLite, and Postgres, with the `PostgresMemoryStore` class in `store/postgres.ts` implementing the `IMemoryStore` interface for a persistent database. Design choices include: - **Type Safety**: The use of TypeScript interfaces and types ensures that memory entries are handled with strict type safety, reducing runtime errors. - **Modularity**: The module is divided into components like embedding, events, and projections, each with its own interfaces and implementations. - **Extensibility**: The architecture supports adding new memory types and storage backends with minimal changes to existing code. ## Data Flow Data flows through the memory module as follows: 1. **Write Operations**: Memory entries are written using `IMemoryStore.write` or `writeBatch` methods. For example, in `store/postgres.ts`, `writeWithClient` handles the insertion of entries into the Postgres database. 2. **Read Operations**: Entries are retrieved using `IMemoryStore.read` or `query`. The `rowToMemoryEntry` function in `store/postgres.ts` maps database rows to memory entry objects. 3. **Provenance Tracking**: Provenance records are managed using methods like `writeProvenance` and `getProvenanceChain` in `store/postgres.ts`, ensuring a traceable history of memory operations. 4. **Embedding**: The embedding process is managed by `IEmbeddingProvider` methods such as `embed` and `embedBatch`, with pending embeddings queried via `queryPendingEmbeddings`. 5. **Event Handling**: Memory events are emitted using `emitMemoryEvent` in `events/memoryEvents.ts`, allowing for asynchronous processing and integration with other system components. ## Key Interfaces | Interface | File | Role | |-----------|------|------| | `ChainVerifyResult` | `commitments.ts` | — | | `CompactionConfig` | `types.ts` | — | | `CompactionResult` | `types.ts` | — | | `EmbeddingResult` | `embedding/interface.ts` | — | | `EntityMemory` | `types.ts` | — | | `EntityRelation` | `types.ts` | — | | `EpisodicMemory` | `types.ts` | — | | `ExtractionOutputSchema` | `types.ts` | — | | `IEmbeddingProvider` | `embedding/interface.ts` | — | | `IMemoryStore` | `store/interface.ts` | — | | `IProjectionSink` | `projection/sinks/interface.ts` | — | | `LucidMemoryFile` | `types.ts` | — | | `MemoryCreatedEvent` | `events/memoryEvents.ts` | — | | `MemoryEntry` | `types.ts` | — | | `MemoryEvent` | `events/memoryEvents.ts` | — | | `MemoryQuery` | `store/interface.ts` | — | | `MemoryServiceConfig` | `types.ts` | — | | `MemorySession` | `types.ts` | — | | `MemorySnapshot` | `types.ts` | — | | `MemoryStats` | `store/interface.ts` | — | | `MemoryStoreCapabilities` | `types.ts` | — | | `MemoryStoreHealth` | `types.ts` | — | | `MemoryWriteResult` | `store/interface.ts` | — | | `OutboxEvent` | `types.ts` | — | | `ProceduralMemory` | `types.ts` | — | | `ProjectableEntry` | `projection/sinks/interface.ts` | — | | `ProjectionPolicy` | `projection/policies.ts` | — | | `ProvenanceRecord` | `types.ts` | — | | `RecallRequest` | `types.ts` | — | | `RecallResponse` | `types.ts` | — | | `RestoreRequest` | `types.ts` | — | | `RestoreResult` | `types.ts` | — | | `SemanticMemory` | `types.ts` | — | | `TemporalMemory` | `types.ts` | — | | `ToolCallRecord` | `types.ts` | — | | `TrustWeightedMemory` | `types.ts` | — | | `ValidatedExtractionResult` | `types.ts` | — | ## Cross-Domain Dependencies | Direction | Domain | Symbols | Purpose | |-----------|--------|---------|---------| | imports | shared | `MMR`, `canonicalSha256Hex`, `getClient`, `logger`, `pool`, `sha256Hex`, `signMessage`, `verifySignature` | — | ## Patterns & Gotchas - **Singleton Pattern**: The `getMemoryStore` function in `store/index.ts` uses a singleton pattern for the memory store, which can lead to unexpected behavior if not reset properly using `resetMemoryStore`. - **Serialization Failures**: The `PostgresMemoryStore` class employs a retry mechanism for serialization failures in transactions, which is crucial for maintaining hash chain integrity but can be a source of confusion if not understood. - **Type Guards**: Functions like `isEpisodicMemory` in `types.ts` are used to safely determine the type of a memory entry, which is essential for type-specific operations. - **Environment Configuration**: The module heavily relies on environment variables for configuration, such as `MEMORY_STORE` and `MEMORY_EMBEDDING_MODEL`. Incorrect configurations can lead to runtime errors or suboptimal performance. - **Cross-Agent Memory Injection**: The `restoreSnapshot` method in `archivePipeline.ts` includes checks to prevent unauthorized memory injection across agents, which is a critical security measure. - [Payment](/reference/lucid-l2/modules/payment): The payment module in the Lucid L2 platform is designed to handle complex financial transactions, including revenue distribution, payment facilitation, and escrow management. It ad # Payment # Payment ## Purpose The payment module in the Lucid L2 platform is designed to handle complex financial transactions, including revenue distribution, payment facilitation, and escrow management. It addresses the need for secure, efficient, and transparent financial operations across multiple blockchain networks. This module supports various payment scenarios, such as direct payouts, escrowed transactions, and revenue airdrops, ensuring that stakeholders receive their due compensation while maintaining the integrity and traceability of transactions. ## Architecture The module is structured into several key components, each responsible for a specific aspect of the payment process: - **Payout Services**: Located in `services/payoutService.ts`, this component handles the calculation and execution of revenue splits among stakeholders. It uses a default split configuration to distribute funds between compute providers, model providers, protocol treasury, and orchestrators. - **Facilitators**: Defined in `facilitators/`, these classes manage different payment facilitation methods, such as direct payments, Coinbase, and PayAI. They implement the `X402Facilitator` interface to provide a consistent API for payment verification and instruction generation. - **Escrow Services**: Found in `escrow/`, these services manage escrow contracts, allowing for secure fund holding and conditional release based on receipt verification. The `EscrowService` and `DisputeService` classes handle the lifecycle of escrow transactions and dispute resolution. - **Revenue and Pricing Services**: In `services/revenueService.ts` and `services/pricingService.ts`, these services manage the recording of revenue and setting of asset pricing, respectively. They ensure accurate financial tracking and flexible pricing configurations. - **Spent Proofs Store**: Implemented in `stores/spentProofsStore.ts`, this component provides replay protection for payment proofs using Redis or in-memory storage. ## Data Flow 1. **Payout Calculation**: - `services/payoutService.ts` → `calculatePayoutSplit` function calculates the payout distribution based on the provided configuration and total amount. - `storePayout` function stores the payout split in both an in-memory map and a database. 2. **Payment Execution**: - `executePayoutSplit` function retrieves the payout split using `getPayout`, then executes on-chain transfers using blockchain adapters. 3. **Revenue Recording**: - `services/revenueService.ts` → `recordRevenue` function logs revenue data into the database for later retrieval and analysis. 4. **Escrow Management**: - `escrow/escrowService.ts` → `createEscrow` function encodes and submits escrow creation transactions, storing escrow details in the database. 5. **Airdrop Execution**: - `airdrop/revenueAirdrop.ts` → `runRevenueAirdrop` function calculates and distributes revenue to token holders, logging transaction signatures for traceability. ## Key Interfaces | Interface | File | Role | |-----------|------|------| | `AirdropResult` | `airdrop/revenueAirdrop.ts` | — | | `AssetPricing` | `services/pricingService.ts` | — | | `ChainConfig` | `types/index.ts` | — | | `CoinbaseFacilitatorConfig` | `facilitators/coinbase.ts` | — | | `DirectFacilitatorConfig` | `facilitators/direct.ts` | — | | `DisputeInfo` | `escrow/disputeTypes.ts` | — | | `EscrowInfo` | `escrow/escrowTypes.ts` | — | | `EscrowParams` | `escrow/escrowTypes.ts` | — | | `EvidenceSubmission` | `escrow/disputeTypes.ts` | — | | `PayAIFacilitatorConfig` | `facilitators/payai.ts` | — | | `PaymentExpectation` | `types/index.ts` | — | | `PaymentGrant` | `settlement/paymentGrant.ts` | — | | `PaymentInstructions` | `types/index.ts` | — | | `PaymentParams` | `types/index.ts` | — | | `PaymentProof` | `types/index.ts` | — | | `RecordRevenueParams` | `services/revenueService.ts` | — | | `ResolveParams` | `services/splitResolver.ts` | — | | `RevenueInfo` | `services/revenueService.ts` | — | | `SetPricingParams` | `services/pricingService.ts` | — | | `SpentProofsStore` | `stores/spentProofsStore.ts` | — | | `SplitRecipient` | `types/index.ts` | — | | `SplitResolution` | `types/index.ts` | — | | `SplitResolverConfig` | `services/splitResolver.ts` | — | | `TokenConfig` | `types/index.ts` | — | | `VerificationResult` | `types/index.ts` | — | | `WithdrawResult` | `services/revenueService.ts` | — | | `X402Facilitator` | `facilitators/interface.ts` | — | | `X402ResponseV2` | `types/index.ts` | — | ### Key Types | Type | File | Kind | Description | |------|------|------|-------------| | `DisputeStatus` | `escrow/disputeTypes.ts` | enum | Dispute Types | | `EscrowStatus` | `escrow/escrowTypes.ts` | enum | Escrow Types | ## Cross-Domain Dependencies | Direction | Domain | Symbols | Purpose | |-----------|--------|---------|---------| | imports | chain | `getSolanaKeypair` | — | | imports | shared | `PATHS`, `canonicalJson`, `getChainConfig`, `getClient`, `logger`, `pool` | — | | exports to | compute | `SplitConfig` | — | ## Patterns & Gotchas - **In-Memory and DB Fallback**: Many services use an in-memory cache with a database fallback for performance optimization. Be aware of potential inconsistencies between these layers, especially during high-load scenarios or failures. - **Lazy Imports**: To avoid circular dependencies, some functions use lazy imports for blockchain adapters and configurations. This can obscure dependencies and should be documented clearly to avoid confusion. - **Basis Points Configuration**: The `SplitConfig` uses basis points for percentage calculations. Ensure that all configurations sum to 10000 basis points to avoid errors in payout calculations. - **Replay Protection**: The `SpentProofsStore` provides replay protection for payment proofs. Ensure that the correct implementation (Redis or in-memory) is used based on the environment to prevent double-spending. - **Escrow Expiry Management**: The `claimTimeout` function checks escrow expiry before allowing refunds. Ensure that the system clock is synchronized to avoid premature or delayed refunds. - **Error Handling**: Many functions log warnings instead of throwing errors for non-critical failures (e.g., database write failures). This can lead to silent failures if not monitored properly. - [gas_utils — Solana Program](/reference/lucid-l2/modules/programs/gas-utils): > Source: C:Lucid-L2programsgas-utilssrclib.rs # gas_utils — Solana Program # gas_utils — Solana Program > **Source:** `C:\Lucid-L2\programs\gas-utils\src\lib.rs` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Instructions | Instruction | Parameters | |-------------|------------| | `collect_and_split` | `m_gas_amount`, `i_gas_amount`, `recipients`, `burn_bps`, `) -> Result<(` | | `mint_and_distribute` | `_total_amount`, `_recipients`, `) -> Result<(` | ## Account Structs | Struct | Fields | |--------|--------| | `CollectAndSplit` | `user_ata`, `lucid_mint`, `user`, `token_program` | | `MintAndDistribute` | `lucid_mint`, `mint_authority`, `token_program` | - [lucid_agent_wallet — Solana Program](/reference/lucid-l2/modules/programs/lucid-agent-wallet): > Source: C:Lucid-L2programslucid-agent-walletsrclib.rs # lucid_agent_wallet — Solana Program # lucid_agent_wallet — Solana Program > **Source:** `C:\Lucid-L2\programs\lucid-agent-wallet\src\lib.rs` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Instructions | Instruction | Parameters | |-------------|------------| | `create_wallet` | `bump` | | `execute` | `ix_data`, `program_id`, `amount` | | `set_policy` | `max_per_tx`, `daily_limit`, `allowed_programs`, `time_window_start`, `time_window_end`, `) -> Result<(` | | `configure_split` | `recipients`, `basis_points`, `) -> Result<(` | | `distribute` | `amount`, `) -> Result<(` | | `create_session` | `permissions`, `expires_at`, `max_amount`, `) -> Result<(` | | `revoke_session` | — | | `create_escrow` | `amount`, `duration_seconds`, `expected_receipt_hash`, `) -> Result<(` | | `release_escrow` | `receipt_hash`, `_receipt_signature`, `) -> Result<(` | | `claim_timeout` | — | | `dispute_escrow` | `reason` | ## Account Structs | Struct | Fields | |--------|--------| | `CreateWallet` | `wallet`, `passport_mint`, `owner`, `system_program` | | `Execute` | `wallet`, `owner`, `policy` | | `SetPolicy` | `policy`, `wallet`, `owner`, `system_program` | | `ConfigureSplit` | `split`, `wallet`, `owner`, `system_program` | | `Distribute` | `wallet`, `owner`, `split`, `wallet_ata`, `token_program` | | `CreateSession` | `session`, `wallet`, `owner`, `delegate`, `system_program` | | `RevokeSession` | `session`, `wallet`, `owner` | | `CreateEscrow` | `escrow`, `wallet`, `owner`, `beneficiary`, `token_mint`, `depositor_ata`, `escrow_ata`, `token_program`, `system_program` | | `ReleaseEscrow` | `escrow`, `wallet`, `releaser`, `escrow_ata`, `beneficiary_ata`, `token_program` | | `ClaimTimeout` | `escrow`, `wallet`, `claimer`, `escrow_ata`, `depositor_ata`, `token_program` | | `DisputeEscrow` | `escrow`, `wallet`, `disputer` | - [lucid_passports — Solana Program](/reference/lucid-l2/modules/programs/lucid-passports): > Source: C:Lucid-L2programslucid-passportssrclib.rs # lucid_passports — Solana Program # lucid_passports — Solana Program > **Source:** `C:\Lucid-L2\programs\lucid-passports\src\lib.rs` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Instructions | Instruction | Parameters | |-------------|------------| | `register_passport` | `asset_type`, `slug`, `version`, `content_cid`, `content_hash`, `metadata_cid`, `license_code`, `policy_flags`, `) -> Result<(` | | `update_passport` | `metadata_cid`, `status`, `) -> Result<(` | | `link_version` | `previous_version`, `) -> Result<(` | | `add_attestation` | `attestation_type`, `_attestation_id`, `content_cid`, `description`, `) -> Result<(` | | `set_payment_gate` | `price_lamports`, `price_lucid`, `payment_token_mint`, `) -> Result<(` | | `pay_for_access` | `expires_at`, `) -> Result<(` | | `withdraw_revenue` | `amount`, `) -> Result<(` | | `revoke_access` | `) -> Result<(` | ## Account Structs | Struct | Fields | |--------|--------| | `RegisterPassport` | `passport`, `owner`, `system_program` | | `UpdatePassport` | `passport`, `owner` | | `LinkVersion` | `version_link`, `current_passport`, `previous_passport`, `owner`, `system_program` | | `AddAttestation` | `attestation`, `passport`, `attester`, `system_program` | | `SetPaymentGate` | `payment_gate`, `passport`, `vault`, `owner`, `system_program` | | `PayForAccess` | `access_receipt`, `payment_gate`, `passport`, `vault`, `payer`, `system_program` | | `WithdrawRevenue` | `payment_gate`, `passport`, `vault`, `owner`, `system_program` | | `RevokeAccess` | `payment_gate`, `passport`, `access_receipt`, `owner` | - [lucid_reputation — Solana Program](/reference/lucid-l2/modules/programs/lucid-reputation): > Source: C:Lucid-L2programslucid-reputationsrclib.rs # lucid_reputation — Solana Program # lucid_reputation — Solana Program > **Source:** `C:\Lucid-L2\programs\lucid-reputation\src\lib.rs` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Instructions | Instruction | Parameters | |-------------|------------| | `init_stats` | `passport_id` | | `submit_feedback` | `passport_id`, `score`, `category`, `receipt_hash`, `asset_type`, `metadata`, `) -> Result<(` | | `submit_validation` | `passport_id`, `receipt_hash`, `valid`, `asset_type`, `metadata`, `) -> Result<(` | | `revoke_feedback` | `_passport_id`, `_index`, `) -> Result<(` | ## Account Structs | Struct | Fields | |--------|--------| | `InitStats` | `stats`, `payer`, `system_program` | | `SubmitFeedback` | `feedback`, `stats`, `submitter`, `system_program` | | `SubmitValidation` | `validation`, `stats`, `validator`, `system_program` | | `RevokeFeedback` | `feedback`, `stats`, `submitter` | - [lucid_zkml_verifier — Solana Program](/reference/lucid-l2/modules/programs/lucid-zkml-verifier): > Source: C:Lucid-L2programslucid-zkml-verifiersrclib.rs # lucid_zkml_verifier — Solana Program # lucid_zkml_verifier — Solana Program > **Source:** `C:\Lucid-L2\programs\lucid-zkml-verifier\src\lib.rs` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Instructions | Instruction | Parameters | |-------------|------------| | `register_model` | `model_hash`, `vk_alpha_g1`, `vk_beta_g2`, `vk_gamma_g2`, `vk_delta_g2`, `vk_ic`, `nr_pubinputs`, `) -> Result<(` | | `verify_proof` | `proof_a`, `proof_b`, `proof_c`, `public_inputs`, `receipt_hash`, `) -> Result<(` | | `verify_batch` | `proofs`, `) -> Result<(` | | `check_proof` | `proof_hash`, `) -> Result<(` | | `init_bloom` | — | ## Account Structs | Struct | Fields | |--------|--------| | `RegisterModel` | `model`, `owner`, `system_program` | | `VerifyProof` | `model`, `bloom`, `verifier`, `proof_record` | | `VerifyBatch` | `bloom`, `verifier` | | `CheckProof` | `bloom` | | `InitBloom` | `bloom`, `authority`, `system_program` | - [thought_epoch — Solana Program](/reference/lucid-l2/modules/programs/thought-epoch): > Source: C:Lucid-L2programsthought-epochsrclib.rs # thought_epoch — Solana Program # thought_epoch — Solana Program > **Source:** `C:\Lucid-L2\programs\thought-epoch\src\lib.rs` ## Purpose > AI enrichment pending — run the pipeline with `DOCS_MODEL` set to populate this section. ## Architecture > AI enrichment pending. ## Patterns & Gotchas > AI enrichment pending. ## Instructions | Instruction | Parameters | |-------------|------------| | `init_epoch` | `root` | | `commit_epoch` | `root` | | `init_epochs` | `roots` | | `commit_epochs` | `roots` | | `init_epoch_v2` | `root`, `epoch_id`, `leaf_count`, `timestamp`, `mmr_size`, `) -> Result<(` | | `commit_epoch_v2` | `root`, `epoch_id`, `leaf_count`, `timestamp`, `mmr_size`, `) -> Result<(` | ## Account Structs | Struct | Fields | |--------|--------| | `InitEpoch` | `authority`, `epoch_record`, `system_program` | | `InitEpochs` | `authority`, `epoch_record_batch`, `system_program` | | `InitEpochV2` | `authority`, `epoch_record_v2`, `system_program` | | `UpdateEpoch` | `authority`, `epoch_record` | | `UpdateEpochs` | `authority`, `epoch_record_batch` | | `UpdateEpochV2` | `authority`, `epoch_record_v2` | - [Receipt](/reference/lucid-l2/modules/receipt): The receipt module in the Lucid L2 platform is designed to handle the creation, storage, and verification of various types of receipts related to computational tasks and data acces # Receipt # Receipt ## Purpose The `receipt` module in the Lucid L2 platform is designed to handle the creation, storage, and verification of various types of receipts related to computational tasks and data access events. It ensures that each receipt is cryptographically signed, hashed, and stored in a verifiable manner, providing a reliable audit trail for operations such as inference, compute tasks, tool invocations, agent executions, dataset accesses, and memory writes. This module addresses the need for secure, traceable, and verifiable records of computational activities, which are crucial for accountability, billing, and compliance in distributed systems. ## Architecture The module is structured around a set of interfaces and functions defined primarily in `receiptService.ts`. Key design choices include: - **Unified Receipt Model**: A type alias `Receipt` encompasses all receipt types, allowing for a unified handling approach. - **Receipt Creation Functions**: Functions like `createInferenceReceipt`, `createComputeReceipt`, and `createToolReceipt` are responsible for generating receipts, each tailored to specific receipt types with their own validation and signing processes. - **Merkle Mountain Range (MMR)**: Receipts are added to an MMR for inclusion proofs, enhancing the verifiability of the receipts. - **Hash and Signature Verification**: Functions such as `verifyReceipt` ensure the integrity and authenticity of receipts by checking hashes and signatures. - **In-Memory and Database Storage**: Receipts are initially stored in a bounded in-memory cache (`BoundedMap`) and are asynchronously persisted to a database for durability. ## Data Flow 1. **Receipt Creation**: When a receipt is created (e.g., `createInferenceReceipt` in `receiptService.ts`), the input data is validated, a hash is computed, and the receipt is signed. 2. **Storage**: The signed receipt is stored in an in-memory cache (`receiptStore` in `receiptService.ts`) and optionally associated with an idempotency key in `idempotencyStore`. 3. **Persistence**: The receipt is asynchronously persisted to the database via `persistReceiptToDb` in `receiptService.ts`. 4. **Verification**: Verification functions (e.g., `verifyInferenceReceipt`) recompute hashes and verify signatures using the stored receipt data. 5. **MMR Inclusion**: Receipts are added to the MMR using `getReceiptMMR` and can be verified for inclusion using `getReceiptProof`. ## Key Interfaces | Interface | File | Role | |-----------|------|------| | `AgentReceipt` | `receiptService.ts` | — | | `AgentReceiptBody` | `receiptService.ts` | Agent receipt body — the data that gets hashed. | | `AgentReceiptInput` | `receiptService.ts` | — | | `BatchedEpisodicReceiptBody` | `receiptService.ts` | — | | `ComputeReceipt` | `receiptService.ts` | Extended Signed Receipt for Fluid Compute v0. | | `ComputeReceiptBody` | `receiptService.ts` | Extended Receipt Body for Fluid Compute v0.2. | | `ComputeReceiptInput` | `../shared/types/fluidCompute.ts` | Input for creating a receipt with extended fields. | | `DatasetReceipt` | `receiptService.ts` | — | | `DatasetReceiptBody` | `receiptService.ts` | Dataset receipt body — the data that gets hashed. | | `DatasetReceiptInput` | `receiptService.ts` | — | | `InferenceReceipt` | `receiptService.ts` | — | | `InferenceReceiptBody` | `receiptService.ts` | Receipt body - the data that gets hashed for receipt_hash. | | `InferenceReceiptInput` | `receiptService.ts` | — | | `MemoryReceipt` | `receiptService.ts` | — | | `MemoryReceiptBody` | `receiptService.ts` | — | | `ReceiptCreateOptions` | `receiptService.ts` | Options for the unified createReceipt function | | `ReceiptVerifyResult` | `receiptService.ts` | — | | `SerializedMMRProof` | `../shared/crypto/receiptMMR.ts` | — | | `ToolReceipt` | `receiptService.ts` | — | | `ToolReceiptBody` | `receiptService.ts` | Tool receipt body — the data that gets hashed. | | `ToolReceiptInput` | `receiptService.ts` | — | ### Key Types | Type | File | Kind | Description | |------|------|------|-------------| | `Receipt` | `receiptService.ts` | alias | Discriminated union of all receipt types | | `ReceiptType` | `receiptService.ts` | alias | All supported receipt types in the Lucid execution layer | ## Cross-Domain Dependencies | Direction | Domain | Symbols | Purpose | |-----------|--------|---------|---------| | imports | shared | `ComputeReceiptInput`, `ExecutionMode`, `JobRequest`, `OfferQuote`, `ReceiptBilling`, `ReceiptMMR`, `ReceiptMetrics`, `SerializedMMRProof`, `SignerType`, `canonicalSha256Hex`, `getOrchestratorPublicKey`, `getReceiptMMR`, `logger`, `pool`, `signMessage`, `validateWithSchema`, `verifySignature` | — | | exports to | epoch | `InferenceReceipt`, `getInferenceReceipt`, `getMmrLeafCount`, `getMmrRoot`, `listInferenceReceipts` | — | ## Patterns & Gotchas - **Idempotency Handling**: The use of `idempotencyStore` ensures that duplicate receipt creation requests with the same idempotency key return the same receipt, preventing unnecessary duplications. - **Canonical JSON Serialization**: The module uses JSON Canonicalization Scheme (JCS) for deterministic hashing, which is crucial for ensuring consistent hash values across different environments. - **Non-blocking Persistence**: Database persistence is non-blocking, meaning that failures in persisting receipts do not affect the immediate availability of receipts in memory, but care must be taken to handle potential inconsistencies. - **MMR Initialization**: The MMR must be initialized at startup using `initReceiptMMR` to ensure that inclusion proofs can be generated and verified. - **Optional Fields**: Many receipt fields are optional and only included in hashes if present, which can lead to subtle bugs if not handled consistently across different parts of the codebase. - [Reputation](/reference/lucid-l2/modules/reputation): The reputation module in the Lucid L2 platform is designed to manage and synchronize reputation data across different systems. It serves as a bridge between on-chain and off-chain # Reputation # Reputation ## Purpose The `reputation` module in the Lucid L2 platform is designed to manage and synchronize reputation data across different systems. It serves as a bridge between on-chain and off-chain reputation data, allowing for the submission, retrieval, and synchronization of feedback and validation information. This module addresses the need for a unified interface to handle reputation data from various sources, ensuring consistency and reliability in reputation management. ### Architecture The architecture of the `reputation` module is centered around two main interfaces: `IReputationProvider` and `IReputationSyncer`. The `IReputationProvider` interface defines methods for interacting with the primary reputation data store, which can be either a database or an on-chain provider. The `IReputationSyncer` interface is implemented by various syncers that handle the synchronization of reputation data with external systems. - **Singleton Pattern**: The module uses a singleton pattern for managing instances of reputation providers and syncers. This ensures that only one instance of each is used throughout the application, which is crucial for maintaining state consistency. - **Environment Configuration**: The selection of the reputation provider and syncers is driven by environment variables (`REPUTATION_PROVIDER` and `REPUTATION_SYNCERS`), allowing for flexible configuration without code changes. ### Data Flow 1. **Provider Initialization**: - `index.ts` → `getReputationProvider()` initializes the reputation provider based on the `REPUTATION_PROVIDER` environment variable. If set to 'db', it defaults to using `LucidDBProvider` from `providers/LucidDBProvider.ts`. 2. **Feedback Submission**: - `providers/LucidDBProvider.ts` → `submitFeedback()` inserts feedback data into the `reputation_feedback` table using a database connection from `shared/db/pool`. 3. **Feedback Retrieval**: - `providers/LucidDBProvider.ts` → `readFeedback()` queries the `reputation_feedback` table to retrieve feedback data based on the provided `passportId` and optional `ReadOptions`. 4. **Syncer Initialization**: - `index.ts` → `getReputationSyncers()` initializes syncers based on the `REPUTATION_SYNCERS` environment variable, dynamically requiring and instantiating syncer classes like `EVM8004Syncer` from `syncers/EVM8004Syncer.ts`. 5. **External Feedback Synchronization**: - `syncers/EVM8004Syncer.ts` → `pullFeedback()` retrieves feedback from an external EVM-based reputation registry using the `ReputationRegistryClient`. ### Patterns & Gotchas - **Explicit Provider Initialization**: The on-chain provider requires explicit initialization via `setReputationProvider()`. This is a critical step that must not be overlooked, as failing to do so will result in an error when attempting to use the on-chain provider. - **Dynamic Syncer Loading**: Syncers are loaded dynamically based on the environment configuration. If a required SDK is unavailable, the syncer will be skipped, and a warning will be logged. This can lead to unexpected behavior if not properly configured. - **Data Consistency**: The module relies on consistent state management through singletons. Developers must ensure that `resetReputationFactory()` is called in test environments to avoid state leakage between tests. - **Error Handling**: The module employs extensive error logging, especially in syncer operations, to aid in diagnosing issues with external systems. Developers should monitor logs for warnings and errors to troubleshoot synchronization problems effectively. ## Architecture The architecture of the `reputation` module is centered around two main interfaces: `IReputationProvider` and `IReputationSyncer`. The `IReputationProvider` interface defines methods for interacting with the primary reputation data store, which can be either a database or an on-chain provider. The `IReputationSyncer` interface is implemented by various syncers that handle the synchronization of reputation data with external systems. - **Singleton Pattern**: The module uses a singleton pattern for managing instances of reputation providers and syncers. This ensures that only one instance of each is used throughout the application, which is crucial for maintaining state consistency. - **Environment Configuration**: The selection of the reputation provider and syncers is driven by environment variables (`REPUTATION_PROVIDER` and `REPUTATION_SYNCERS`), allowing for flexible configuration without code changes. ### Data Flow 1. **Provider Initialization**: - `index.ts` → `getReputationProvider()` initializes the reputation provider based on the `REPUTATION_PROVIDER` environment variable. If set to 'db', it defaults to using `LucidDBProvider` from `providers/LucidDBProvider.ts`. 2. **Feedback Submission**: - `providers/LucidDBProvider.ts` → `submitFeedback()` inserts feedback data into the `reputation_feedback` table using a database connection from `shared/db/pool`. 3. **Feedback Retrieval**: - `providers/LucidDBProvider.ts` → `readFeedback()` queries the `reputation_feedback` table to retrieve feedback data based on the provided `passportId` and optional `ReadOptions`. 4. **Syncer Initialization**: - `index.ts` → `getReputationSyncers()` initializes syncers based on the `REPUTATION_SYNCERS` environment variable, dynamically requiring and instantiating syncer classes like `EVM8004Syncer` from `syncers/EVM8004Syncer.ts`. 5. **External Feedback Synchronization**: - `syncers/EVM8004Syncer.ts` → `pullFeedback()` retrieves feedback from an external EVM-based reputation registry using the `ReputationRegistryClient`. ### Patterns & Gotchas - **Explicit Provider Initialization**: The on-chain provider requires explicit initialization via `setReputationProvider()`. This is a critical step that must not be overlooked, as failing to do so will result in an error when attempting to use the on-chain provider. - **Dynamic Syncer Loading**: Syncers are loaded dynamically based on the environment configuration. If a required SDK is unavailable, the syncer will be skipped, and a warning will be logged. This can lead to unexpected behavior if not properly configured. - **Data Consistency**: The module relies on consistent state management through singletons. Developers must ensure that `resetReputationFactory()` is called in test environments to avoid state leakage between tests. - **Error Handling**: The module employs extensive error logging, especially in syncer operations, to aid in diagnosing issues with external systems. Developers should monitor logs for warnings and errors to troubleshoot synchronization problems effectively. ## Data Flow 1. **Provider Initialization**: - `index.ts` → `getReputationProvider()` initializes the reputation provider based on the `REPUTATION_PROVIDER` environment variable. If set to 'db', it defaults to using `LucidDBProvider` from `providers/LucidDBProvider.ts`. 2. **Feedback Submission**: - `providers/LucidDBProvider.ts` → `submitFeedback()` inserts feedback data into the `reputation_feedback` table using a database connection from `shared/db/pool`. 3. **Feedback Retrieval**: - `providers/LucidDBProvider.ts` → `readFeedback()` queries the `reputation_feedback` table to retrieve feedback data based on the provided `passportId` and optional `ReadOptions`. 4. **Syncer Initialization**: - `index.ts` → `getReputationSyncers()` initializes syncers based on the `REPUTATION_SYNCERS` environment variable, dynamically requiring and instantiating syncer classes like `EVM8004Syncer` from `syncers/EVM8004Syncer.ts`. 5. **External Feedback Synchronization**: - `syncers/EVM8004Syncer.ts` → `pullFeedback()` retrieves feedback from an external EVM-based reputation registry using the `ReputationRegistryClient`. ### Patterns & Gotchas - **Explicit Provider Initialization**: The on-chain provider requires explicit initialization via `setReputationProvider()`. This is a critical step that must not be overlooked, as failing to do so will result in an error when attempting to use the on-chain provider. - **Dynamic Syncer Loading**: Syncers are loaded dynamically based on the environment configuration. If a required SDK is unavailable, the syncer will be skipped, and a warning will be logged. This can lead to unexpected behavior if not properly configured. - **Data Consistency**: The module relies on consistent state management through singletons. Developers must ensure that `resetReputationFactory()` is called in test environments to avoid state leakage between tests. - **Error Handling**: The module employs extensive error logging, especially in syncer operations, to aid in diagnosing issues with external systems. Developers should monitor logs for warnings and errors to troubleshoot synchronization problems effectively. ## Key Interfaces | Interface | File | Role | |-----------|------|------| | `ExternalFeedback` | `IReputationSyncer.ts` | — | | `ExternalSummary` | `IReputationSyncer.ts` | — | | `FeedbackParams` | `types.ts` | — | | `IReputationProvider` | `IReputationProvider.ts` | — | | `IReputationSyncer` | `IReputationSyncer.ts` | — | | `ReadOptions` | `types.ts` | — | | `ReputationData` | `types.ts` | — | | `ReputationSummary` | `types.ts` | — | | `TxReceipt` | `types.ts` | — | | `ValidationParams` | `types.ts` | — | | `ValidationResult` | `types.ts` | — | ## Cross-Domain Dependencies | Direction | Domain | Symbols | Purpose | |-----------|--------|---------|---------| | imports | identity | `ReputationRegistryClient`, `ValidationRegistryClient` | — | | imports | shared | `logger`, `pool` | — | ## Patterns & Gotchas - **Explicit Provider Initialization**: The on-chain provider requires explicit initialization via `setReputationProvider()`. This is a critical step that must not be overlooked, as failing to do so will result in an error when attempting to use the on-chain provider. - **Dynamic Syncer Loading**: Syncers are loaded dynamically based on the environment configuration. If a required SDK is unavailable, the syncer will be skipped, and a warning will be logged. This can lead to unexpected behavior if not properly configured. - **Data Consistency**: The module relies on consistent state management through singletons. Developers must ensure that `resetReputationFactory()` is called in test environments to avoid state leakage between tests. - **Error Handling**: The module employs extensive error logging, especially in syncer operations, to aid in diagnosing issues with external systems. Developers should monitor logs for warnings and errors to troubleshoot synchronization problems effectively. - [anchoring — Interface Reference](/reference/lucid-l2/reference/anchoring): Returns: AnchorDispatcher # anchoring — Interface Reference # anchoring — Interface Reference ## Interfaces ### AnchorRecord > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `anchor_id` | `string` | no | | | `artifact_id` | `string` | no | | | `artifact_type` | `"epoch_bundle" | "epoch_proof" | "memory_snapshot" | "deploy_artifact" | "passport_metadata" | "nft_metadata" | "mmr_checkpoint"` | no | | | `chain_tx` | `Record` | no | | | `cid` | `string` | no | | | `content_hash` | `string` | no | | | `created_at` | `number` | no | | | `metadata` | `Record` | no | | | `parent_anchor_id` | `string` | no | | | `producer` | `string` | no | | | `provider` | `string` | no | | | `size_bytes` | `number` | no | | | `status` | `"uploaded" | "verified" | "unreachable"` | no | | | `storage_tier` | `StorageTier` | no | | | `url` | `string` | no | | | `verified_at` | `number` | no | | **Extends:** — ### AnchorRequest > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | yes | | | `artifact_id` | `string` | no | | | `artifact_type` | `"epoch_bundle" | "epoch_proof" | "memory_snapshot" | "deploy_artifact" | "passport_metadata" | "nft_metadata" | "mmr_checkpoint"` | no | | | `chain_tx` | `Record` | yes | | | `content_hash` | `string` | yes | | | `metadata` | `Record` | yes | | | `parent_anchor_id` | `string` | yes | | | `payload` | `object | Buffer` | no | | | `producer` | `string` | no | | | `storage_tier` | `StorageTier` | no | | | `tags` | `Record` | yes | | **Extends:** — ### AnchorResult > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `anchor_id` | `string` | no | | | `cid` | `string` | no | | | `provider` | `string` | no | | | `size_bytes` | `number` | no | | | `url` | `string` | no | | **Extends:** — ### IAnchorRegistry > `registry.ts` **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `count` | `filters`?: `{ artifact_type?: ArtifactType; agent_passport_id?: string; status?: string; }` | `Promise` | | | `create` | `record`: `CreateInput` | `Promise` | | | `getByAgent` | `agent_passport_id`: `string`, `options`?: `{ artifact_type?: ArtifactType; limit?: number; }` | `Promise` | | | `getByArtifact` | `artifact_type`: `"epoch_bundle" | "epoch_proof" | "memory_snapshot" | "deploy_artifact" | "passport_metadata" | "nft_metadata" | "mmr_checkpoint"`, `artifact_id`: `string` | `Promise` | | | `getByCID` | `cid`: `string` | `Promise` | | | `getById` | `anchor_id`: `string` | `Promise` | | | `getLatestByArtifact` | `artifact_type`: `"epoch_bundle" | "epoch_proof" | "memory_snapshot" | "deploy_artifact" | "passport_metadata" | "nft_metadata" | "mmr_checkpoint"`, `artifact_id`: `string` | `Promise` | | | `getLineage` | `anchor_id`: `string` | `Promise` | | | `updateStatus` | `anchor_id`: `string`, `status`: `"verified" | "unreachable"` | `Promise` | | **Extends:** — ## Functions ### getAnchorDispatcher > `index.ts` **Returns:** `AnchorDispatcher` **Async:** no ### getAnchorRegistry > `index.ts` **Returns:** `IAnchorRegistry` **Async:** no ### getAnchorVerifier > `index.ts` **Returns:** `AnchorVerifier` **Async:** no ### resetAnchoring > `index.ts` **Returns:** `void` **Async:** no ## Types ### ArtifactType > `types.ts` ```ts type ArtifactType = "epoch_bundle" | "epoch_proof" | "memory_snapshot" | "deploy_artifact" | "passport_metadata" | "nft_metadata" | "mmr_checkpoint" ``` ### StorageTier > `types.ts` ```ts type StorageTier = "permanent" | "evolving" ``` - [compute — Interface Reference](/reference/lucid-l2/reference/compute): > control-plane/agent/a2a/a2aClient.ts # compute — Interface Reference # compute — Interface Reference ## Interfaces ### A2AClientOptions > `control-plane/agent/a2a/a2aClient.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `auth_token` | `string` | yes | | | `timeout_ms` | `number` | yes | | **Extends:** — ### A2AMessage > `control-plane/agent/a2a/a2aServer.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `parts` | `A2APart[]` | no | | | `role` | `"user" | "agent"` | no | | **Extends:** — ### A2APart > `control-plane/agent/a2a/a2aServer.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `data` | `Record` | yes | | | `file` | `{ name: string; mimeType: string; bytes?: string; uri?: string; }` | yes | | | `text` | `string` | yes | | | `type` | `"text" | "file" | "data"` | no | | **Extends:** — ### A2ATask > `control-plane/agent/a2a/a2aServer.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `artifacts` | `{ name?: string; parts: A2APart[]; }[]` | yes | | | `id` | `string` | no | | | `messages` | `A2AMessage[]` | no | | | `metadata` | `Record` | yes | | | `status` | `{ state: A2ATaskState; message?: string; timestamp: string; }` | no | | **Extends:** — ### A2ATaskStore > `control-plane/agent/a2a/a2aServer.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `tasks` | `Map` | no | | **Extends:** — ### AgentCard > `control-plane/agent/a2a/agentCard.ts` A2A Agent Card Generator **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `authentication` | `{ type: "bearer" | "oauth2" | "none"; config?: Record; }` | no | | | `capabilities` | `string[]` | no | | | `defaultInputModes` | `string[]` | no | | | `defaultOutputModes` | `string[]` | no | | | `description` | `string` | no | | | `name` | `string` | no | | | `provider` | `{ organization: string; url?: string; }` | yes | | | `skills` | `AgentCardSkill[]` | no | | | `url` | `string` | no | | | `version` | `string` | no | | **Extends:** — ### AgentCardSkill > `control-plane/agent/a2a/agentCard.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `description` | `string` | no | | | `inputSchema` | `Record` | yes | | | `name` | `string` | no | | | `outputSchema` | `Record` | yes | | **Extends:** — ### AgentConfig > `control-plane/agent/agentDescriptor.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `a2a_capabilities` | `string[]` | yes | | | `a2a_enabled` | `boolean` | no | | | `autonomy_level` | `AutonomyLevel` | no | | | `channels` | `ChannelConfig[]` | no | | | `fallback_model_ids` | `string[]` | yes | | | `guardrails` | `Guardrail[]` | no | | | `handoff_rules` | `HandoffRule[]` | yes | | | `max_tokens` | `number` | yes | | | `mcp_servers` | `string[]` | no | | | `memory_enabled` | `boolean` | no | | | `memory_provider` | `MemoryProvider` | no | | | `memory_window_size` | `number` | no | | | `model_passport_id` | `string` | no | | | `skill_slugs` | `string[]` | no | | | `stop_conditions` | `StopCondition[]` | no | | | `sub_agents` | `string[]` | yes | | | `system_prompt` | `string` | no | | | `temperature` | `number` | yes | | | `tool_passport_ids` | `string[]` | no | | | `workflow_type` | `WorkflowType` | no | | **Extends:** — ### AgentDescriptor > `control-plane/agent/agentDescriptor.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_config` | `AgentConfig` | no | | | `compliance` | `ComplianceConfig` | yes | | | `deployment_config` | `DeploymentConfig` | no | | | `launch_ownership` | `{ owner_mode: "user_wallet" | "workspace_custody" | "platform_default"; claim_status: "claimed" | "claimable"; }` | yes | | | `monetization` | `MonetizationConfig` | yes | | | `wallet_config` | `WalletConfig` | yes | | **Extends:** — ### AgentRevenuePool > `control-plane/agent/agentRevenueService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `accumulated_lamports` | `bigint` | no | | | `agent_passport_id` | `string` | no | | | `last_airdrop_at` | `number` | no | | | `total_distributed_lamports` | `bigint` | no | | **Extends:** — ### ChannelConfig > `control-plane/agent/agentDescriptor.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `config` | `Record` | no | | | `type` | `ChannelType` | no | | **Extends:** — ### DeployAgentInput > `control-plane/agent/agentDeploymentService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `description` | `string` | yes | Description | | `descriptor` | `AgentDescriptor` | no | The Universal Agent Descriptor | | `idempotency_key` | `string` | yes | Idempotency key to prevent duplicate deploys | | `list_on_marketplace` | `boolean` | yes | Create marketplace listing | | `name` | `string` | no | Agent name | | `owner` | `string` | no | Owner address (Solana base58 or EVM 0x) | | `preferred_adapter` | `string` | yes | Preferred runtime adapter (auto-select if omitted) | | `tags` | `string[]` | yes | Tags for discovery | **Extends:** — ### DeployAgentResult > `control-plane/agent/agentDeploymentService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `a2a_endpoint` | `string` | yes | | | `adapter_used` | `string` | yes | | | `deployment_id` | `string` | yes | | | `deployment_url` | `string` | yes | | | `error` | `string` | yes | | | `files` | `Record` | yes | | | `nft_mint` | `string` | yes | | | `passport_id` | `string` | yes | | | `success` | `boolean` | no | | | `target_used` | `string` | yes | | | `wallet_address` | `string` | yes | | **Extends:** — ### DeploymentConfig > `providers/IDeployer.ts` Configuration for a deployment **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `auto_scale` | `boolean` | yes | Enable auto-scaling (if supported by target) | | `env_vars` | `Record` | yes | Additional environment variables (merged with artifact env_vars) | | `health_check_interval_ms` | `number` | yes | Health check interval in milliseconds | | `replicas` | `number` | yes | Number of replicas (default: 1) | | `restart_policy` | `"always" | "on_failure" | "never"` | yes | Container restart policy | | `secrets` | `string[]` | yes | Secret names to inject (platform-specific resolution) | | `target` | `{ [key: string]: unknown; type: string; }` | no | Target platform config — type field identifies the deployer | **Extends:** — ### DeploymentMetrics > `providers/capability-types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `collectedAt` | `number` | no | | | `cpu` | `MetricSeries` | yes | | | `disk` | `MetricSeries` | yes | | | `memory` | `MetricSeries` | yes | | | `network` | `{ rxBytes?: MetricSeries; txBytes?: MetricSeries; }` | yes | | **Extends:** — ### DeploymentResult > `providers/IDeployer.ts` Result of a deploy operation **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `deployment_id` | `string` | no | Unique deployment identifier | | `error` | `string` | yes | Error message (if failed) | | `metadata` | `Record` | yes | Platform-specific metadata | | `success` | `boolean` | no | Whether deployment succeeded | | `target` | `string` | no | Target platform name | | `url` | `string` | yes | Public URL of the deployed agent (if available) | **Extends:** — ### DeploymentStatus > `providers/IDeployer.ts` Current status of a deployment **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `deployment_id` | `string` | no | Unique deployment identifier | | `error` | `string` | yes | Error message (if failed) | | `health` | `"unknown" | "healthy" | "degraded" | "unhealthy"` | yes | Health state of the running deployment | | `last_check` | `number` | yes | Timestamp of last health check | | `status` | `DeploymentStatusType` | no | Current lifecycle status | | `uptime_ms` | `number` | yes | Uptime in milliseconds since deployment start | | `url` | `string` | yes | Public URL (if available) | **Extends:** — ### DomainInfo > `providers/capability-types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `domain` | `string` | no | | | `isDefault` | `boolean` | no | | | `ssl` | `boolean` | no | | **Extends:** — ### DomainResult > `providers/capability-types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `domain` | `string` | no | | | `status` | `"failed" | "active" | "pending"` | no | | **Extends:** — ### Guardrail > `control-plane/agent/agentDescriptor.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `config` | `Record` | no | | | `type` | `GuardrailType` | no | | **Extends:** — ### HandoffRule > `control-plane/agent/agentDescriptor.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `condition` | `string` | no | | | `from_agent` | `string` | no | | | `to_agent` | `string` | no | | **Extends:** — ### HealthcheckConfig > `providers/capability-types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `intervalSeconds` | `number` | no | | | `path` | `string` | no | | | `timeoutSeconds` | `number` | no | | **Extends:** — ### IDeployer > `providers/IDeployer.ts` Deployer interface — all deployment providers implement this. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `description` | `string` | no | Human-readable description | | `target` | `string` | no | Target platform name (e.g., 'docker', 'railway', 'akash') | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `addDomain` | `deploymentId`: `string`, `domain`: `string` | `Promise` | Tier 3: Add a custom domain | | `addVolume` | `deploymentId`: `string`, `config`: `VolumeConfig` | `Promise` | Tier 4: Add a volume (deferred) | | `deploy` | `input`: `RuntimeArtifact | ImageDeployInput`, `config`: `DeploymentConfig`, `passportId`: `string` | `Promise` | Deploy an agent artifact or pre-built image to this target | | `isHealthy` | | `Promise` | Health check for the deployer itself | | `listDomains` | `deploymentId`: `string` | `Promise` | Tier 3: List domains | | `listRegions` | | `Promise` | Tier 4: List available regions (deferred) | | `listVolumes` | `deploymentId`: `string` | `Promise` | Tier 4: List volumes (deferred) | | `logs` | `deploymentId`: `string`, `options`?: `LogOptions` | `Promise` | Get deployment logs | | `metrics` | `deploymentId`: `string`, `options`?: `MetricsOptions` | `Promise wallet/IAgentWalletProvider.ts # identity — Interface Reference # identity — Interface Reference ## Interfaces ### AgentWallet > `wallet/IAgentWalletProvider.ts` Agent Wallet Provider Interface **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `address` | `string` | no | Wallet address (Solana base58 or EVM 0x) | | `agent_passport_id` | `string` | no | Associated agent passport ID | | `chain` | `string` | no | Which blockchain | | `created_at` | `number` | no | Creation timestamp | | `provider` | `string` | no | Which provider created it | **Extends:** — ### CreatePassportInput > `passport/passportManager.ts` Input for creating a passport **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chain` | `"solana" | "evm"` | yes | Target chain. Auto-detected from owner address format if omitted. Defaults to 'solana'. | | `description` | `string` | yes | | | `metadata` | `any` | no | | | `mintNFT` | `boolean` | yes | Mint an NFT for this passport. Defaults to env NFT_MINT_ON_CREATE (true). | | `name` | `string` | yes | | | `owner` | `string` | no | | | `tags` | `string[]` | yes | | | `type` | `PassportType` | no | | | `version` | `string` | yes | | **Extends:** — ### ERC8004AgentMetadata > `registries/types.ts` ERC-8004 Registry Types **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `capabilities` | `string[]` | yes | | | `description` | `string` | no | | | `endpoints` | `string[]` | yes | | | `image` | `string` | yes | | | `name` | `string` | no | | | `trust_models` | `string[]` | yes | | | `wallets` | `Record` | yes | | **Extends:** — ### ERC8004RegistrationDoc > `projections/registration-doc/types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `active` | `boolean` | yes | | | `registrations` | `{ agentId: string; agentRegistry: string; }[]` | yes | | | `services` | `{ name: string; endpoint: string; version?: string; skills?: string[]; domains?: string[]; }[]` | yes | | | `supportedTrust` | `string[]` | yes | | | `type` | `string` | no | | **Extends:** `ERC8004AgentMetadata` ### ExternalIdentity > `projections/ISolanaIdentityRegistry.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `externalId` | `string` | no | | | `metadata` | `ERC8004RegistrationDoc` | no | | | `owner` | `string` | no | | | `registrationDocUri` | `string` | yes | | | `registryName` | `string` | no | | **Extends:** — ### IAgentWalletProvider > `wallet/IAgentWalletProvider.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chain` | `string` | no | Target chain | | `providerName` | `string` | no | Provider name | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `createWallet` | `agentPassportId`: `string`, `chain`?: `string` | `Promise` | Create a new wallet for an agent | | `executeTransaction` | `walletAddress`: `string`, `tx`: `TransactionRequest` | `Promise` | Execute a transaction from the agent wallet | | `getBalance` | `walletAddress`: `string` | `Promise` | Get wallet balance | | `getWallet` | `agentPassportId`: `string` | `Promise` | Get existing wallet for an agent | | `isHealthy` | | `Promise` | Health check | | `setSpendingLimits` | `walletAddress`: `string`, `limits`: `SpendingLimits` | `Promise` | Set spending limits | **Extends:** — ### INFTProvider > `nft/INFTProvider.ts` Chain-agnostic NFT provider. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chain` | `string` | no | Which chain this provider targets | | `providerName` | `string` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `burn` | `mint`: `string` | `Promise` | Burn an NFT (for passport revocation) | | `getAsset` | `mint`: `string` | `Promise` | Get on-chain asset data for an NFT | | `isHealthy` | | `Promise` | Health check | | `mint` | `owner`: `string`, `metadata`: `NFTMetadata` | `Promise` | Mint a new NFT for a passport | | `updateMetadata` | `mint`: `string`, `newMetadata`: `Partial` | `Promise` | Update NFT metadata URI | **Extends:** — ### ISolanaIdentityRegistry > `projections/ISolanaIdentityRegistry.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `capabilities` | `RegistryCapabilities` | no | | | `registryName` | `string` | no | | | `supportedAssetTypes` | `AssetType[]` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `deregister` | `agentId`: `string` | `Promise` | | | `isAvailable` | | `Promise` | | | `register` | `passport`: `Passport`, `options`?: `RegistrationOptions` | `Promise` | | | `resolve` | `agentId`: `string` | `Promise` | | | `sync` | `passport`: `Passport` | `Promise` | | **Extends:** — ### ITokenLauncher > `shares/ITokenLauncher.ts` Token launcher interface — swappable between direct SPL mint and Genesis TGE. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `providerName` | `string` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `getTokenInfo` | `passportId`: `string` | `Promise` | Get token info for a passport | | `isHealthy` | | `Promise` | Health check | | `launchToken` | `params`: `TokenLaunchParams` | `Promise` | Create + launch a share token for a passport | **Extends:** — ### MintResult > `nft/INFTProvider.ts` Result of an NFT mint operation **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chain` | `string` | no | Chain where the NFT was minted | | `mint` | `string` | no | Mint address (Solana base58 or EVM 0x...) | | `provider` | `string` | no | Provider used | | `tbaAddress` | `string` | yes | ERC-6551 TBA address (EVM only, if auto-created) | | `tokenAccount` | `string` | yes | Token account holding the NFT (ATA on Solana, owner on EVM) | | `txSignature` | `string` | no | Transaction signature / hash | **Extends:** — ### NFTMetadata > `nft/INFTProvider.ts` NFT metadata (follows Metaplex / OpenSea standard) **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `attributes` | `{ trait_type: string; value: string | number; }[]` | yes | | | `description` | `string` | yes | | | `image` | `string` | yes | | | `name` | `string` | no | | | `passportId` | `string` | no | Passport this NFT represents | | `passportType` | `string` | no | Passport type (model, compute, tool, agent, dataset) | | `symbol` | `string` | no | | | `uri` | `string` | no | DePIN-stored JSON URI (from Phase 1) | **Extends:** — ### OnChainSyncHandler > `passport/passportManager.ts` On-chain sync handler interface **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `syncToChain` | `passport`: `Passport`, `options`?: `{ forceReupload?: boolean; }` | `Promise<{ pda: string; tx: string; }>` | | **Extends:** — ### OperationResult > `passport/passportManager.ts` Result type for operations **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `data` | `T` | yes | | | `details` | `any` | yes | | | `error` | `string` | yes | | | `ok` | `boolean` | no | | **Extends:** — ### RegistrationResult > `projections/ISolanaIdentityRegistry.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `externalId` | `string` | no | | | `registrationDocUri` | `string` | yes | | | `registryName` | `string` | no | | | `txSignature` | `string` | no | | **Extends:** — ### RegistryCapabilities > `projections/ISolanaIdentityRegistry.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `deregister` | `boolean` | no | | | `register` | `boolean` | no | | | `resolve` | `boolean` | no | | | `sync` | `boolean` | no | | **Extends:** — ### ReputationRecord > `registries/types.ts` Reputation feedback record **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agentTokenId` | `bigint` | no | | | `category` | `string` | no | | | `feedbackId` | `bigint` | no | | | `from` | `string` | no | | | `score` | `number` | no | | | `timestamp` | `bigint` | no | | **Extends:** — ### ReputationSummary > `registries/types.ts` Average reputation score **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agentTokenId` | `string` | no | | | `averageScore` | `number` | no | | | `chainId` | `string` | no | | | `totalFeedback` | `number` | no | | **Extends:** — ### SpendingLimits > `wallet/IAgentWalletProvider.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `daily_usd` | `number` | no | | | `per_tx_usd` | `number` | no | | **Extends:** — ### TokenInfo > `shares/ITokenLauncher.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `decimals` | `number` | no | | | `holders` | `number` | yes | | | `mint` | `string` | no | | | `name` | `string` | no | | | `passportId` | `string` | no | | | `symbol` | `string` | no | | | `totalSupply` | `number` | no | | **Extends:** — ### TokenLaunchParams > `shares/ITokenLauncher.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `decimals` | `number` | yes | Token decimals (default: 6) | | `name` | `string` | no | | | `owner` | `string` | no | Owner address — receives total supply | | `passportId` | `string` | no | | | `symbol` | `string` | no | | | `totalSupply` | `number` | no | | | `uri` | `string` | no | Arweave metadata URI | **Extends:** — ### TokenLaunchResult > `shares/ITokenLauncher.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `mint` | `string` | no | SPL token mint address | | `provider` | `string` | no | Provider used | | `totalSupply` | `number` | no | Total supply minted | | `txSignature` | `string` | no | Transaction signature | **Extends:** — ### TransactionRequest > `wallet/IAgentWalletProvider.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `amount` | `string` | yes | | | `data` | `string` | yes | | | `to` | `string` | no | | | `token_mint` | `string` | yes | | | `value` | `string` | yes | | **Extends:** — ### TransactionResult > `wallet/IAgentWalletProvider.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chain` | `string` | no | | | `error` | `string` | yes | | | `success` | `boolean` | no | | | `tx_signature` | `string` | no | | **Extends:** — ### ValidationRecord > `registries/types.ts` Validation record returned from the Validation Registry **Properties** | Property | Type | Optional | Description | |-------- - [memory — Interface Reference](/reference/lucid-l2/reference/memory): > embedding/interface.ts # memory — Interface Reference # memory — Interface Reference ## Interfaces ### ChainVerifyResult > `commitments.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chain_length` | `number` | no | | | `errors` | `string[]` | no | | | `valid` | `boolean` | no | | **Extends:** — ### CompactionConfig > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `cold_requires_snapshot` | `boolean` | no | | | `cold_retention_ms` | `number` | no | | | `compact_on_session_close` | `boolean` | no | | | `hot_window_ms` | `number` | no | | | `hot_window_turns` | `number` | no | | | `lane_overrides` | `Partial>` | yes | | **Extends:** — ### CompactionResult > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `cold_pruned` | `number` | no | | | `episodic_archived` | `number` | no | | | `extraction_triggered` | `boolean` | no | | | `sessions_compacted` | `number` | no | | | `snapshot_cid` | `string` | no | | **Extends:** — ### EmbeddingResult > `embedding/interface.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `embedding` | `number[]` | no | | | `model` | `string` | no | | | `tokens_used` | `number` | no | | **Extends:** — ### EntityMemory > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `attributes` | `Record` | no | | | `entity_id` | `string` | yes | | | `entity_name` | `string` | no | | | `entity_type` | `string` | no | | | `relationships` | `EntityRelation[]` | no | | | `source_memory_ids` | `string[]` | yes | | **Extends:** `MemoryEntry<'entity'>` ### EntityRelation > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `confidence` | `number` | no | | | `relation_type` | `string` | no | | | `target_entity_id` | `string` | no | | **Extends:** — ### EpisodicMemory > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `role` | `"user" | "assistant" | "system" | "tool"` | no | | | `session_id` | `string` | no | | | `tokens` | `number` | no | | | `tool_calls` | `ToolCallRecord[]` | yes | | | `turn_index` | `number` | no | | **Extends:** `MemoryEntry<'episodic'>` ### ExtractionOutputSchema > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `facts` | `{ fact: string; confidence: number; }[]` | no | | | `rules` | `{ rule: string; trigger: string; priority: number; }[]` | no | | | `schema_version` | `"1.0"` | no | | **Extends:** — ### IEmbeddingProvider > `embedding/interface.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `dimensions` | `number` | no | | | `modelName` | `string` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `embed` | `text`: `string` | `Promise` | | | `embedBatch` | `texts`: `string[]` | `Promise` | | **Extends:** — ### IMemoryStore > `store/interface.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `capabilities` | `MemoryStoreCapabilities` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `archive` | `memory_id`: `string` | `Promise` | | | `archiveBatch` | `memory_ids`: `string[]` | `Promise` | | | `closeSession` | `session_id`: `string`, `summary`?: `string` | `Promise` | | | `count` | `q`: `Omit` | `Promise` | | | `createSession` | `session`: `Omit` | `Promise` | | | `deleteBatch` | `memory_ids`: `string[]` | `Promise` | | | `getEntriesSince` | `agent_passport_id`: `string`, `since`: `number` | `Promise[]>` | | | `getHealth` | | `Promise` | | | `getLatestHash` | `agent_passport_id`: `string`, `namespace`: `string` | `Promise` | | | `getLatestSnapshot` | `agent_passport_id`: `string` | `Promise` | | | `getProvenanceChain` | `agent_passport_id`: `string`, `namespace`: `string`, `limit`?: `number` | `Promise` | | | `getProvenanceForMemory` | `memory_id`: `string` | `Promise` | | | `getSession` | `session_id`: `string` | `Promise` | | | `getStats` | `agent_passport_id`: `string` | `Promise` | | | `listSessions` | `agent_passport_id`: `string`, `status`?: `("active" | "archived" | "closed")[]` | `Promise` | | | `listSnapshots` | `agent_passport_id`: `string` | `Promise` | | | `markOutboxError` | `event_id`: `string`, `error`: `string` | `Promise` | | | `markOutboxProcessed` | `event_id`: `string` | `Promise` | | | `nearestByEmbedding` | `embedding`: `number[]`, `agent_passport_id`: `string`, `namespace`?: `string`, `types`?: `("episodic" | "semantic" | "procedural" | "entity" | "trust_weighted" | "temporal")[]`, `limit`?: `number`, `similarity_threshold`?: `number`, `lanes`?: `("self" | "user" | "shared" | "market")[]` | `Promise<(MemoryEntry<"episodic" | "semantic" | "procedural" | "entity" | "trust_weighted" | "temporal"> & { similarity: number; })[]>` | | | `query` | `q`: `MemoryQuery` | `Promise[]>` | | | `queryOutboxPending` | `limit`: `number` | `Promise` | | | `queryPendingEmbeddings` | `limit`: `number` | `Promise[]>` | | | `read` | `memory_id`: `string` | `Promise>` | | | `recordEmbeddingFailure` | `memory_id`: `string`, `error`: `string` | `Promise` | | | `saveSnapshot` | `snapshot`: `Omit` | `Promise` | | | `softDelete` | `memory_id`: `string` | `Promise` | | | `supersede` | `memory_id`: `string`, `superseded_by`: `string` | `Promise` | | | `updateCompactionWatermark` | `session_id`: `string`, `turn_index`: `number` | `Promise` | | | `updateEmbedding` | `memory_id`: `string`, `embedding`: `number[]`, `model`: `string` | `Promise` | | | `updateSessionStats` | `session_id`: `string`, `turn_delta`: `number`, `token_delta`: `number` | `Promise` | | | `write` | `entry`: `WritableMemoryEntry & { content_hash: string; prev_hash: string | null; }` | `Promise` | | | `writeBatch` | `entries`: `(WritableMemoryEntry & { content_hash: string; prev_hash: string | null; })[]` | `Promise` | | | `writeOutboxEvent` | `event`: `Omit` | `Promise` | | | `writeProvenance` | `record`: `Omit` | `Promise` | | **Extends:** — ### IProjectionSink > `projection/sinks/interface.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `name` | `string` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `healthCheck` | | `Promise` | | | `project` | `entry`: `ProjectableEntry` | `Promise` | | | `projectBatch` | `entries`: `ProjectableEntry[]` | `Promise` | | | `remove` | `memory_ids`: `string[]` | `Promise` | | **Extends:** — ### LucidMemoryFile > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `anchor` | `{ chain: string; epoch_id: string; tx_hash: string; mmr_root: string; }` | yes | | | `archived_cids` | `string[]` | yes | | | `chain_head_hash` | `string` | no | | | `content_mmr_root` | `string` | no | | | `created_at` | `number` | no | | | `entries` | `MemoryEntry<"episodic" | "semantic" | "procedural" | "entity" | "trust_weighted" | "temporal">[]` | no | | | `entry_count` | `number` | no | | | `provenance` | `ProvenanceRecord[]` | no | | | `sessions` | `MemorySession[]` | no | | | `signature` | `string` | no | | | `signer_pubkey` | `string` | no | | | `version` | `"1.0"` | no | | **Extends:** — ### MemoryCreatedEvent > `events/memoryEvents.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `entry` | `MemoryEntry<"episodic" | "semantic" | "procedural" | "entity" | "trust_weighted" | "temporal">` | no | | | `type` | `"memory.created"` | no | | **Extends:** `MemoryEvent` ### MemoryEntry > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `content` | `string` | no | | | `content_hash` | `string` | no | | | `created_at` | `number` | no | | | `embedding` | `number[]` | yes | | | `embedding_attempts` | `number` | no | | | `embedding_last_error` | `string` | yes | | | `embedding_model` | `string` | yes | | | `embedding_requested_at` | `number` | yes | | | `embedding_status` | `"pending" | "ready" | "failed" | "skipped"` | no | | | `embedding_updated_at` | `number` | yes | | | `memory_id` | `string` | no | | | `memory_lane` | `"self" | "user" | "shared" | "market"` | no | | | `metadata` | `Record` | no | | | `namespace` | `string` | no | | | `prev_hash` | `string` | no | | | `receipt_hash` | `string` | yes | | | `receipt_run_id` | `string` | yes | | | `status` | `"active" | "superseded" | "archived" | "expired"` | no | | | `structured_content` | `Record` | yes | | | `type` | `T` | no | | | `updated_at` | `number` | no | | **Extends:** — ### MemoryEvent > `events/memoryEvents.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `namespace` | `string` | no | | | `timestamp` | `number` | no | | | `type` | `MemoryEventType` | no | | **Extends:** — ### MemoryQuery > `store/interface.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `before` | `number` | yes | | | `content_hash` | `string` | yes | | | `embedding_status` | `("pending" | "ready" | "failed" | "skipped")[]` | yes | | | `limit` | `number` | yes | | | `memory_lane` | `("self" | "user" | "shared" | "market")[]` | yes | | | `namespace` | `string` | yes | | | `offset` | `number` | yes | | | `order_by` | `"created_at" | "updated_at" | "turn_index"` | yes | | | `order_dir` | `"asc" | "desc"` | yes | | | `session_id` | `string` | yes | | | `since` | `number` | yes | | | `status` | `("active" | "superseded" | "archived" | "expired")[]` | yes | | | `types` | `("episodic" | "semantic" | "procedural" | "entity" | "trust_weighte - [payment — Interface Reference](/reference/lucid-l2/reference/payment): > airdrop/revenueAirdrop.ts # payment — Interface Reference # payment — Interface Reference ## Interfaces ### AirdropResult > `airdrop/revenueAirdrop.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `distributions` | `{ holder: string; balance: number; share: number; amountLamports: number; }[]` | no | | | `holders` | `number` | no | | | `passportId` | `string` | no | | | `tokenMint` | `string` | no | | | `totalDistributed` | `number` | no | | | `txSignatures` | `string[]` | no | | **Extends:** — ### AssetPricing > `services/pricingService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `accepted_chains` | `string[]` | no | | | `accepted_tokens` | `string[]` | no | | | `custom_split_bps` | `Record` | no | | | `passport_id` | `string` | no | | | `payout_address` | `string` | no | | | `price_per_call` | `bigint` | no | | | `price_per_token` | `bigint` | no | | | `price_subscription_hour` | `bigint` | no | | | `updated_at` | `Date` | yes | | **Extends:** — ### ChainConfig > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chainId` | `number` | yes | | | `name` | `string` | no | | | `rpcUrl` | `string` | no | | **Extends:** — ### CoinbaseFacilitatorConfig > `facilitators/coinbase.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `apiKey` | `string` | yes | | | `apiUrl` | `string` | no | | **Extends:** — ### DirectFacilitatorConfig > `facilitators/direct.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chains` | `ChainConfig[]` | no | | | `maxProofAge` | `number` | yes | Max age in seconds for a payment proof to be accepted (default: 300) | | `tokens` | `TokenConfig[]` | no | | **Extends:** — ### DisputeInfo > `escrow/disputeTypes.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `appealDeadline` | `number` | no | | | `appealed` | `boolean` | no | | | `appealedBy` | `string` | no | | | `createdAt` | `number` | no | | | `disputeId` | `string` | no | | | `escrowId` | `string` | no | | | `evidenceDeadline` | `number` | no | | | `initiator` | `string` | no | | | `reason` | `string` | no | | | `resolvedInFavorOf` | `string` | no | | | `status` | `DisputeStatus` | no | | **Extends:** — ### EscrowInfo > `escrow/escrowTypes.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `amount` | `string` | no | | | `beneficiary` | `string` | no | | | `createdAt` | `number` | no | | | `depositor` | `string` | no | | | `escrowId` | `string` | no | | | `expectedReceiptHash` | `string` | no | | | `expiresAt` | `number` | no | | | `status` | `EscrowStatus` | no | | | `token` | `string` | no | | **Extends:** — ### EscrowParams > `escrow/escrowTypes.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `amount` | `string` | no | | | `beneficiary` | `string` | no | | | `duration` | `number` | no | | | `expectedReceiptHash` | `string` | yes | | | `token` | `string` | no | | **Extends:** — ### EvidenceSubmission > `escrow/disputeTypes.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `description` | `string` | no | | | `mmrProof` | `string` | no | | | `mmrRoot` | `string` | no | | | `receiptHash` | `string` | no | | **Extends:** — ### PayAIFacilitatorConfig > `facilitators/payai.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `apiKey` | `string` | yes | | | `apiUrl` | `string` | no | | **Extends:** — ### PaymentExpectation > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `amount` | `bigint` | no | | | `recipient` | `string` | no | | | `token` | `TokenConfig` | no | | **Extends:** — ### PaymentGrant > `settlement/paymentGrant.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `attestation` | `PaymentGrantAttestation` | no | | | `grant_id` | `string` | no | | | `limits` | `PaymentGrantLimits` | no | | | `run_id` | `string` | no | | | `scope` | `PaymentGrantScope` | no | | | `signature` | `string` | no | | | `signer_pubkey` | `string` | no | | | `tenant_id` | `string` | no | | **Extends:** — ### PaymentInstructions > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `amount` | `string` | no | | | `chain` | `string` | no | | | `facilitator` | `string` | no | | | `facilitatorUrl` | `string` | yes | | | `recipient` | `string` | no | | | `scheme` | `string` | yes | | | `token` | `string` | no | | | `tokenAddress` | `string` | no | | **Extends:** — ### PaymentParams > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `amount` | `bigint` | no | | | `chain` | `string` | no | | | `recipient` | `string` | no | | | `token` | `TokenConfig` | no | | **Extends:** — ### PaymentProof > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `authorization` | `string` | yes | | | `chain` | `string` | no | | | `facilitatorData` | `Record` | yes | | | `txHash` | `string` | yes | | **Extends:** — ### RecordRevenueParams > `services/revenueService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `amount` | `bigint` | no | | | `chain` | `string` | no | | | `passport_id` | `string` | no | | | `role` | `"compute" | "model" | "protocol" | "orchestrator"` | no | | | `run_id` | `string` | no | | | `token` | `string` | no | | | `tx_hash` | `string` | yes | | **Extends:** — ### ResolveParams > `services/splitResolver.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `computePassportId` | `string` | yes | | | `modelPassportId` | `string` | yes | | | `orchestratorPassportId` | `string` | yes | | **Extends:** — ### RevenueInfo > `services/revenueService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `pending` | `bigint` | no | | | `token` | `string` | no | | | `total` | `bigint` | no | | | `withdrawn` | `bigint` | no | | **Extends:** — ### SetPricingParams > `services/pricingService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `accepted_chains` | `string[]` | yes | | | `accepted_tokens` | `string[]` | yes | | | `custom_split_bps` | `Record` | yes | | | `passport_id` | `string` | no | | | `payout_address` | `string` | no | | | `price_per_call` | `bigint` | yes | | | `price_per_token` | `bigint` | yes | | | `price_subscription_hour` | `bigint` | yes | | **Extends:** — ### SpentProofsStore > `stores/spentProofsStore.ts` **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `close` | | `Promise` | Graceful shutdown (Redis disconnect, etc.). | | `count` | | `Promise` | Return the number of tracked spent proofs. | | `isSpent` | `txHash`: `string` | `Promise` | Returns true if the tx hash has already been spent. | | `markSpent` | `txHash`: `string`, `ttlSeconds`?: `number` | `Promise` | Mark a tx hash as spent, with an optional TTL in seconds. | **Extends:** — ### SplitRecipient > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `bps` | `number` | no | | | `passportId` | `string` | yes | | | `role` | `"compute" | "model" | "protocol" | "orchestrator"` | no | | | `walletAddress` | `string` | no | | **Extends:** — ### SplitResolution > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `chain` | `string` | no | | | `recipients` | `SplitRecipient[]` | no | | | `splitterAddress` | `string` | yes | | | `token` | `TokenConfig` | no | | | `totalAmount` | `bigint` | no | | | `useSplitter` | `boolean` | no | | **Extends:** — ### SplitResolverConfig > `services/splitResolver.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `defaultChain` | `string` | yes | | | `defaultSplitterAddress` | `string` | no | | | `defaultToken` | `TokenConfig` | yes | | | `protocolTreasuryAddress` | `string` | no | | **Extends:** — ### TokenConfig > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `address` | `string` | no | | | `chain` | `string` | no | | | `decimals` | `number` | no | | | `symbol` | `string` | no | | **Extends:** — ### VerificationResult > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `metadata` | `Record` | yes | | | `reason` | `string` | yes | | | `settledAmount` | `bigint` | yes | | | `txHash` | `string` | yes | | | `valid` | `boolean` | no | | **Extends:** — ### WithdrawResult > `services/revenueService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `amount` | `bigint` | no | | | `status` | `"pending_payout" | "no_funds"` | no | Status of the withdrawal — 'pending_payout' means DB records are marked, | | `token` | `string` | no | | **Extends:** — ### X402Facilitator > `facilitators/interface.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `name` | `string` | no | | | `supportedChains` | `ChainConfig[]` | no | | | `supportedTokens` | `TokenConfig[]` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `instructions` | `params`: `PaymentParams` | `PaymentInstructions` | | | `verify` | `proof`: `PaymentProof`, `expected`: `PaymentExpectation` | `Promise` | | **Extends:** — ### X402ResponseV2 > `types/index.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `alternatives` | `PaymentInstructions[]` | yes | | | `description` | `string` | no | | | `expires` | `number` | yes | | | `facilitator` | `string` | no | | | `payment` | `PaymentInstructions` | no | | | `splits` | `{ role: string; passport?: string; bps: number; }[]` | yes | | | `version` | `"2"` | no | | **Extends:** — ## Functions ### calculatePayoutSplit > `services/payoutService.ts` Calculate payout split for a run | Param | Type | Optional | Default | |-------|------|----------|---------| | `params` | `{ run_id: string; total_amount_lamports: bigint; compute_wallet: string; model_wallet?: string; orchestrator_wallet?: string; config?: SplitConfig; }` | no | — | **Returns:** `PayoutSplit` **Async:** no ### createPaymentGrant > `settlement/paymentGrant.ts` Create a signed PaymentGrant. | Param | Type | Optional | Default | |-------|------|----------|---------| | `input` | `PaymentGrantInput` | no | — | | `secretKey` | `Uint8Arra - [receipt — Interface Reference](/reference/lucid-l2/reference/receipt): Extends: AgentReceiptBody # receipt — Interface Reference # receipt — Interface Reference ## Interfaces ### AgentReceipt > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `_mmr_leaf_index` | `number` | yes | | | `anchor` | `{ chain?: string; tx?: string; root?: string; epoch_id?: string; }` | yes | | | `receipt_hash` | `string` | no | | | `receipt_signature` | `string` | no | | | `receipt_type` | `"agent"` | no | | | `signer_pubkey` | `string` | no | | | `signer_type` | `SignerType` | no | | **Extends:** `AgentReceiptBody` ### AgentReceiptBody > `receiptService.ts` Agent receipt body — the data that gets hashed. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `duration_ms` | `number` | no | | | `error_code` | `string` | yes | | | `error_message` | `string` | yes | | | `run_id` | `string` | no | | | `schema_version` | `"1.0"` | no | | | `steps_count` | `number` | no | | | `sub_receipt_ids` | `string[]` | no | | | `success` | `boolean` | no | | | `task_hash` | `string` | no | | | `timestamp` | `number` | no | | | `total_cost_usd` | `number` | yes | | | `total_tokens` | `number` | no | | | `trace_id` | `string` | yes | | **Extends:** — ### AgentReceiptInput > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `duration_ms` | `number` | no | | | `error_code` | `string` | yes | | | `error_message` | `string` | yes | | | `run_id` | `string` | yes | | | `steps_count` | `number` | no | | | `sub_receipt_ids` | `string[]` | no | | | `success` | `boolean` | no | | | `task_hash` | `string` | no | | | `total_cost_usd` | `number` | yes | | | `total_tokens` | `number` | no | | | `trace_id` | `string` | yes | | **Extends:** — ### BatchedEpisodicReceiptBody > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `entry_count` | `number` | no | | | `entry_hashes` | `string[]` | no | | | `namespace` | `string` | no | | | `run_id` | `string` | no | | | `schema_version` | `"1.0"` | no | | | `session_id` | `string` | no | | | `timestamp` | `number` | no | | **Extends:** — ### ComputeReceipt > `receiptService.ts` Extended Signed Receipt for Fluid Compute v0. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `_mmr_leaf_index` | `number` | yes | | | `anchor` | `{ chain?: "solana"; tx?: string; root?: string; epoch_id?: string; }` | yes | | | `receipt_hash` | `string` | no | | | `receipt_signature` | `string` | no | | | `receipt_type` | `"compute"` | no | | | `signer_pubkey` | `string` | no | | | `signer_type` | `SignerType` | no | | **Extends:** `ComputeReceiptBody` ### ComputeReceiptBody > `receiptService.ts` Extended Receipt Body for Fluid Compute v0.2. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `attestation` | `object` | yes | | | `billing` | `ReceiptBilling` | yes | Billing details for cost transparency | | `capacity_bucket` | `string` | yes | Capacity bucket name (runpod_serverless mode) | | `compute_passport_id` | `string` | no | | | `end_ts` | `number` | yes | | | `endpoint_id` | `string` | yes | RunPod endpoint ID (runpod_serverless mode) | | `error_code` | `string` | yes | | | `error_message` | `string` | yes | | | `execution_mode` | `ExecutionMode` | yes | | | `gpu_fingerprint` | `string` | yes | | | `image_hash` | `string` | yes | | | `input_ref` | `string` | yes | | | `job_hash` | `string` | yes | | | `metrics` | `ReceiptMetrics` | no | | | `model_hash` | `string` | yes | | | `model_passport_id` | `string` | no | | | `model_revision` | `string` | yes | Model revision (commit SHA or tag) for auditability | | `node_id` | `string` | yes | | | `output_ref` | `string` | yes | | | `outputs_hash` | `string` | yes | | | `policy_hash` | `string` | no | | | `quote_hash` | `string` | yes | | | `run_id` | `string` | no | | | `runtime` | `string` | no | | | `runtime_hash` | `string` | yes | | | `schema_version` | `"1.0"` | no | | | `start_ts` | `number` | yes | | | `timestamp` | `number` | no | | | `trace_id` | `string` | yes | | **Extends:** — ### ComputeReceiptInput > `../shared/types/fluidCompute.ts` Input for creating a receipt with extended fields. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `attestation` | `Record` | yes | | | `billing` | `ReceiptBilling` | yes | Billing details | | `cache_hit` | `boolean` | yes | | | `capacity_bucket` | `string` | yes | Capacity bucket name | | `cold_start_ms` | `number` | yes | Cold start time (runpod_serverless) | | `compute_offer_passport_id` | `string` | yes | On-chain ComputeOfferPassport ID (Solana PDA) - optional, links to specific offer | | `compute_passport_id` | `string` | no | | | `end_ts` | `number` | yes | | | `endpoint_id` | `string` | yes | RunPod endpoint ID | | `error_code` | `string` | yes | | | `error_message` | `string` | yes | | | `execution_mode` | `ExecutionMode` | yes | | | `gpu_fingerprint` | `string` | yes | | | `image_hash` | `string` | yes | | | `input_ref` | `string` | yes | | | `job_hash` | `string` | yes | | | `model_hash` | `string` | yes | | | `model_load_ms` | `number` | yes | | | `model_passport_id` | `string` | no | | | `model_revision` | `string` | yes | Model revision (commit SHA or tag) for auditability | | `node_id` | `string` | yes | | | `output_ref` | `string` | yes | | | `outputs_hash` | `string` | yes | | | `p95_ms` | `number` | yes | | | `policy_hash` | `string` | no | | | `queue_time_ms` | `number` | yes | Time spent in queue (runpod_serverless) | | `queue_wait_ms` | `number` | yes | | | `quote_hash` | `string` | yes | | | `run_id` | `string` | yes | | | `runtime` | `string` | no | | | `runtime_hash` | `string` | yes | | | `start_ts` | `number` | yes | | | `tokens_in` | `number` | no | | | `tokens_out` | `number` | no | | | `total_latency_ms` | `number` | yes | | | `trace_id` | `string` | yes | | | `ttft_ms` | `number` | no | | **Extends:** — ### DatasetReceipt > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `_mmr_leaf_index` | `number` | yes | | | `anchor` | `{ chain?: string; tx?: string; root?: string; epoch_id?: string; }` | yes | | | `receipt_hash` | `string` | no | | | `receipt_signature` | `string` | no | | | `receipt_type` | `"dataset"` | no | | | `signer_pubkey` | `string` | no | | | `signer_type` | `SignerType` | no | | **Extends:** `DatasetReceiptBody` ### DatasetReceiptBody > `receiptService.ts` Dataset receipt body — the data that gets hashed. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `access_type` | `"download" | "query" | "stream"` | no | | | `bytes_transferred` | `number` | no | | | `consumer_passport_id` | `string` | yes | | | `data_hash` | `string` | no | | | `dataset_passport_id` | `string` | no | | | `query_hash` | `string` | yes | | | `rows_returned` | `number` | yes | | | `run_id` | `string` | no | | | `schema_version` | `"1.0"` | no | | | `timestamp` | `number` | no | | | `trace_id` | `string` | yes | | **Extends:** — ### DatasetReceiptInput > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `access_type` | `"download" | "query" | "stream"` | no | | | `bytes_transferred` | `number` | no | | | `consumer_passport_id` | `string` | yes | | | `data_hash` | `string` | no | | | `dataset_passport_id` | `string` | no | | | `query_hash` | `string` | yes | | | `rows_returned` | `number` | yes | | | `run_id` | `string` | yes | | | `trace_id` | `string` | yes | | **Extends:** — ### InferenceReceipt > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `_mmr_leaf_index` | `number` | yes | | | `anchor` | `{ chain?: "solana"; tx?: string; root?: string; epoch_id?: string; }` | yes | | | `attestation` | `object` | yes | | | `compute_passport_id` | `string` | no | | | `image_hash` | `string` | yes | | | `metrics` | `{ ttft_ms: number; p95_ms?: number; tokens_in: number; tokens_out: number; }` | no | | | `model_hash` | `string` | yes | | | `model_passport_id` | `string` | no | | | `policy_hash` | `string` | no | | | `receipt_hash` | `string` | no | | | `receipt_signature` | `string` | no | | | `receipt_type` | `"inference"` | no | | | `run_id` | `string` | no | | | `runtime` | `string` | no | | | `schema_version` | `"1.0"` | no | | | `signer_pubkey` | `string` | no | | | `signer_type` | `"orchestrator" | "compute"` | no | | | `timestamp` | `number` | no | | | `trace_id` | `string` | yes | | | `zkml_proof` | `{ proof: string; public_inputs: string[]; model_circuit_hash: string; verified_onchain?: boolean; verification_tx?: string; }` | yes | | **Extends:** — ### InferenceReceiptBody > `receiptService.ts` Receipt body - the data that gets hashed for receipt_hash. **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `attestation` | `object` | yes | | | `compute_passport_id` | `string` | no | | | `image_hash` | `string` | yes | | | `metrics` | `{ ttft_ms: number; p95_ms?: number; tokens_in: number; tokens_out: number; }` | no | | | `model_hash` | `string` | yes | | | `model_passport_id` | `string` | no | | | `policy_hash` | `string` | no | | | `run_id` | `string` | no | | | `runtime` | `string` | no | | | `schema_version` | `"1.0"` | no | | | `timestamp` | `number` | no | | | `trace_id` | `string` | yes | | **Extends:** — ### InferenceReceiptInput > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `attestation` | `object` | yes | | | `compute_passport_id` | `string` | no | | | `image_hash` | `string` | yes | | | `model_hash` | `string` | yes | | | `model_passport_id` | `string` | no | | | `p95_ms` | `number` | yes | | | `policy_hash` | `string` | no | | | `run_id` | `string` | yes | | | `runtime` | `string` | no | | | `tokens_in` | `number` | no | | | `tokens_out` | `number` | no | | | `trace_id` | `string` | yes | | | `ttft_ms` | `number` | no | | **Extends:** — ### MemoryReceipt > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `_mmr_leaf_index` | `number` | yes | | | `body` | `MemoryReceiptBody | BatchedEpisodicReceiptBody` | no | | | `receipt_hash` | `string` | no | | | `receipt_signature` | `string` | no | | | `receipt_type` | `"memory"` | no | | | `run_id` | `string` | no | | | `signer_pubkey` | `string` | no | | | `signer_type` | `SignerType` | no | | **Extends:** — ### MemoryReceiptBody > `receiptService.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `agent_passport_id` | `string` | no | | | `content_hash` | `string` | no | | | `memory_id` | `string` | no | | | `memory_type` | `string` | no | | | `namespace` | `string` | no | | | `prev_hash` | `string` | no | | | `run_id` | `string` | no | | | `schema_version` | `"1.0"` | no | | | `timestamp` | `number` | no | | **Extends:** — ### ReceiptC - [reputation — Interface Reference](/reference/lucid-l2/reference/reputation): > IReputationSyncer.ts # reputation — Interface Reference # reputation — Interface Reference ## Interfaces ### ExternalFeedback > `IReputationSyncer.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `category` | `string` | yes | | | `externalId` | `string` | no | | | `metadata` | `Record` | yes | | | `score` | `number` | no | | | `source` | `string` | no | | | `timestamp` | `number` | no | | **Extends:** — ### ExternalSummary > `IReputationSyncer.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `avgScore` | `number` | no | | | `externalId` | `string` | no | | | `feedbackCount` | `number` | no | | | `lastUpdated` | `number` | no | | | `source` | `string` | no | | **Extends:** — ### FeedbackParams > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `assetType` | `AssetType` | no | | | `category` | `string` | no | | | `metadata` | `string` | yes | | | `passportId` | `string` | no | | | `receiptHash` | `string` | no | | | `score` | `number` | no | | **Extends:** — ### IReputationProvider > `IReputationProvider.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `providerName` | `string` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `getSummary` | `passportId`: `string` | `Promise` | | | `getValidation` | `passportId`: `string`, `receiptHash`: `string` | `Promise` | | | `isHealthy` | | `Promise` | | | `readFeedback` | `passportId`: `string`, `options`?: `ReadOptions` | `Promise` | | | `submitFeedback` | `params`: `FeedbackParams` | `Promise` | | | `submitValidation` | `params`: `ValidationParams` | `Promise` | | **Extends:** — ### IReputationSyncer > `IReputationSyncer.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `supportedAssetTypes` | `AssetType[]` | no | | | `syncerName` | `string` | no | | **Methods** | Method | Params | Return Type | Description | |--------|--------|-------------|-------------| | `isAvailable` | | `Promise` | | | `pullFeedback` | `passportId`: `string` | `Promise` | | | `pullSummary` | `passportId`: `string` | `Promise` | | | `pushFeedback` | `params`: `FeedbackParams` | `Promise` | | | `resolveExternalId` | `passportId`: `string` | `Promise` | | **Extends:** — ### ReadOptions > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `assetType` | `AssetType` | yes | | | `category` | `string` | yes | | | `limit` | `number` | yes | | | `offset` | `number` | yes | | **Extends:** — ### ReputationData > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `assetType` | `AssetType` | no | | | `category` | `string` | no | | | `from` | `string` | no | | | `index` | `number` | no | | | `passportId` | `string` | no | | | `receiptHash` | `string` | no | | | `revoked` | `boolean` | no | | | `score` | `number` | no | | | `timestamp` | `number` | no | | **Extends:** — ### ReputationSummary > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `avgScore` | `number` | no | | | `feedbackCount` | `number` | no | | | `lastUpdated` | `number` | no | | | `passportId` | `string` | no | | | `totalScore` | `number` | no | | | `validationCount` | `number` | no | | **Extends:** — ### TxReceipt > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `id` | `string` | yes | | | `success` | `boolean` | no | | | `txHash` | `string` | yes | | **Extends:** — ### ValidationParams > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `assetType` | `AssetType` | no | | | `metadata` | `string` | yes | | | `passportId` | `string` | no | | | `receiptHash` | `string` | no | | | `valid` | `boolean` | no | | **Extends:** — ### ValidationResult > `types.ts` **Properties** | Property | Type | Optional | Description | |----------|------|----------|-------------| | `assetType` | `AssetType` | no | | | `passportId` | `string` | no | | | `receiptHash` | `string` | no | | | `timestamp` | `number` | no | | | `valid` | `boolean` | no | | | `validator` | `string` | no | | **Extends:** — ## Functions ### getReputationProvider > `index.ts` Get the primary reputation provider. **Returns:** `IReputationProvider` **Async:** no ### getReputationSyncers > `index.ts` Get all configured reputation syncers. **Returns:** `IReputationSyncer[]` **Async:** no ### resetReputationFactory > `index.ts` Reset singletons (for tests) **Returns:** `void` **Async:** no ### setReputationProvider > `index.ts` Explicitly set the reputation provider (required for on-chain provider | Param | Type | Optional | Default | |-------|------|----------|---------| | `provider` | `IReputationProvider` | no | — | **Returns:** `void` **Async:** no ## Types ### AssetType > `types.ts` ```ts type AssetType = "model" | "compute" | "tool" | "agent" | "dataset" ``` ## lucid-wiki - [Glossary](/knowledge/glossary): >- # Glossary #### A * **Agent (Lucid Agent)** — An AI persona with identity, memory, and skills that can run across channels (Discord, X, Telegram, UE5, web). Can be off-chain or anchored on-chain. \ Agents can be created via **Synapse (no-code)** or via SDKs/AR (code-first). * **Agent PDA** — The on-chain account (Program Derived Address) that represents an agent’s identity, keys, and pointers (optional). * **AgentMeta** — The schema that describes an agent (personality, skills, model policy, channels). #### B * **BYOK (Bring Your Own Keys)** — Use your own API keys for model providers (e.g., OpenAI/Anthropic). You pay that vendor; Lucid charges only platform fees. #### C * Plug-and-play bridges that turn any API, blockchain, or tool into a reusable skill inside Synapse or AR.\ All follow the open **ToolSpec** schema.\ They can be community-published (Lucid Hub), private (Enterprise/VPC), or monetized via Proof-of-Contribution.\ Examples: Discord, Shopify, Slack, Solana, io.net, Unreal Engine, Telegram. * **CID (Content Identifier)** — Hash that points to a piece of content stored off-chain (e.g., IPFS/Arweave). Used for proofs and recall. * **Classes S/M/L (Models)** — Model complexity tiers used for pricing/capabilities: **S** (small SLM 2–8B), **M** (balanced chat/RAG), **L** (rich LLM/VLM). * **Cold Lane** — Durable, cheaper storage for archives & proofs (IPFS/Arweave/Filecoin); referenced by on-chain hashes. * **Cognition Router** — The (optional) on-chain policy that selects the best model for a task based on cost/latency/quality and user or app policy. #### D * **DID (Decentralized Identifier)** — A portable identifier for agents/users/models. Stored in PDAs when on-chain is enabled. * **Dual-Gas** — Lucid’s split metering: **mGas** for memory/routing/proofs; **iGas** for AI compute (inference). * **DePIN (Decentralized Physical Infrastructure Network)** — Community-operated compute or storage networks used by Lucid for inference (Fluid Compute) or data backup (Cold Lane).\ TrustGate orchestrates these nodes with performance guarantees. #### E * **Epoch (Thought Epoch)** — A batched, auditable “moment” of AI activity (answer tokens, messages, data references). Commits a small root on-chain; full data stays off-chain. #### F * **Fine-Tuning (LoRA/QLoRA)** — Training adapters on your data to lock tone/behavior without retraining the whole model. * **Fluid Nodes** — Decentralized GPU operators that run model inference. Paid in **iGas**; prove work via PoI. * **Frame Hash** — SHA-256 hash per rendered avatar frame for provenance; media stays off-chain. #### G * **Gasless Relay** — Lucid fronts on-chain fees; you settle in fiat/USDC monthly. No wallet ops in the UX. * **Guardrails** — Policies and schema-based tool calls that keep agents on-lore, safe, and deterministic. #### H * **Hot Lane** — Fast vector/metadata store for sub-100 ms recall during RAG/inference. * **Headless Runner** — Open CLI/daemon to run agents without the Synapse UI; suitable for CI/self-hosting. #### I * **iGas (Inference Gas)** — Meter for compute work (tokens, flops). Rewards Fluid Nodes after valid PoI. * **Interaction Unit (IU)** — Usage metric bucket: tokens (LLM), minutes (speech), frames (vision). #### L * **Lucid Chain**— The underlying hybrid L2 that anchors proofs, receipts, payouts, and portable memory for interoperable AI. On-chain for trust; off-chain for speed. Powering the Internet of AI. * **LEI SDK (Lucid In-Engine Inference SDK)** — Unified API for running models on-device or cloud (CUDA/DirectML/Vulkan/CPU) with failover. * **Lucid Cloud** — Managed hosting for open models + platform orchestration; bundled per-token pricing (no double-charge). * **LucidScan** — Explorer & API to inspect routing decisions, proofs, payouts, and Memory Map stats. * **Synapse** — The visual operating system for AI.\ A drag-and-drop, AI-assisted workspace to compose agents, apps, and automations using nodes like Models, Memory, Connectors, and Skills.\ Synapse uses **AR** under the hood and connects to the **Lucid Chain** for identity, proofs, and payouts.\ Think _Canva for AI creation_, running on the Internet of AI. #### M * **Memory Map** — The decentralized knowledge graph: agents, users, and models publish/recall approved data with provenance. On-chain stores only tiny pointers/hashes.\ The Memory Map also powers **Connectors and Agents** in Synapse by giving them shared, encrypted recall across flows and channels. * **Memory Wallet** — PDA snapshot for a user/agent/model (latest roots, counters, links to cold storage). * **ModelMeta** — Schema describing a model/version (capabilities, price/latency profile, endpoints). * **mGas (Memory Gas)** — Meter for memory/routing/proofs (PDA writes, PoM checks, router logs). #### N * **Namespaces** — Labeled partitions of data (e.g., `@game_lore`, `@support_kb`) with ACLs; used by RAG and recall policies. * **Neurons/Synapses/Recall (Epoch Fields)** * **Neurons**: the model’s output tokens. * **Synapses**: messages exchanged between agents/tools during the step. * **Recall Set**: list of CIDs/IDs the step **read or wrote** (grounding, citations, new memories). #### O * **On-Chain (Opt-In)** — When enabled, **Lucid Chain** writes small proofs (epochs, receipts, payouts) to Solana or Ethereum L2. Everything stays asynchronous—no latency added to inference. * **Open Core** — Lucid keeps SDKs/schemas/protocol open (Apache-2.0) while Studio/Cloud are commercial (source-available). #### P * **PDAs (Program Derived Addresses)** — Lightweight on-chain accounts used for identity, policy, and pointers. Typical size \~89 B. * **PoC (Proof-of-Contribution)** — Automatic royalties when your data/model is reused. * **PoI (Proof-of-Inference)** — Cryptographic receipt that inference actually ran (current: witness/verify; roadmap: zk-PoI). * **PoM (Proof-of-Memory)** — Availability/integrity checks for staked data; supports slashing if missing. * **Policy (Router θ-weights)** — The vector used by the Cognition Router to score/select models deterministically. #### R * **RAG (Retrieval-Augmented Generation)** — Ground model answers on your sources (namespaces, files) for factuality. Ultra-fast recall via Hot Lane. * **Recall CID** — The CID(s) an agent referenced/produced during an epoch; used for provenance/audits. * **Router (Cognition Router)** — See _Cognition Router_ (above). #### S * **Shadow Mode** — Use Lucid entirely off-chain for development or private deployments; flip on-chain later. * **Skills / Tool Calls** — Safe, typed functions agents can invoke (inventory lookups, quest triggers, DB queries, on-chain tx). * **Solana (primary)** — Main chain for fast, low-cost proofs and payouts (optional). #### T * **Thought Epoch** — See _Epoch_. * **Tokens (LLM)** — Sum of input + output tokens; used for pricing/quotas. * **TrustGate** — Lucid’s managed inference gateway that orchestrates decentralized compute (DePIN) and cloud workloads with attestation, SLOs, insurance, and audit receipts.\ OpenAI-compatible endpoint—just swap your base URL.\ Ensures every run is verifiable, compliant, and automatically credited when SLOs are met. #### U * **UE5 Plug-in** — Blueprint/C++ components for ASR/TTS, visemes, gestures, tool calls, and memory in Unreal Engine 5. * **Usage Credits** — Monthly included IUs in Studio plans; overages billed at posted rates. #### V * **Vector** — Numeric embedding used for similarity search during RAG and memory recall. * **Virtual Humans** — Visual/voice “faces” for agents (WebGPU Lite, Cloud Pro, or offline Cinematic), with optional per-frame hashing for provenance. * **VPC Deploy** — Private, enterprise deployment of Studio/Cloud components with SSO/SOC2 and data residency. #### W * **WebGPU/WebGL Runtime** — In-browser rendering/animation for avatars; fallback to cloud render when needed. * **Wallet (Agent/User)** — On-chain account for payouts/fees when on-chain features are enabled; can be abstracted by gasless relays. #### Z * **ZK (Zero-Knowledge) Proofs** — Privacy tech to prove facts about data/compute without revealing raw content. Planned upgrades for PoI and redaction flows. *** #### Quick Legends * **Open (Apache-2.0):** SDKs, schemas, protocol, headless runner. * **Commercial (Source-Available):** Studio, Model Lab Pro, Virtual Humans Pro, Lucid Cloud. * **Lucid Chain (Hybrid L2):** Anchors proofs, receipts, and payouts for interoperable AI — optional, privacy-preserving, and asynchronous. * **Synapse (OS):** No-code environment to compose, connect, and deploy AI agents and apps with Connectors and SDKs. If a term here is unclear, ping us—if you’re thinking it, others are too. - [Architecture — What is Lucid AI](/knowledge/lucid-ai/architecture-what-is-lucid-ai): Build & Operate on the Internet of AI. Enterprise-grade. # Architecture — What is Lucid AI
**A single prompt becomes a living AI system.** Lucid AI turns your words into fully deployable agents — connected to data, compute, tools, and the blockchain.\ In seconds, you can go from _idea → AI product_ — with identity, memory, proofs, and payouts built in. You can build anything — from a trading AI reading on-chain liquidity, to a storytelling NPC pulling live lore, to a customer assistant that remembers and rewards users across apps.\ All without writing a line of backend or smart-contract code. **Under the hood with Lucid Chain:** * **Computation orchestration** — route inference across cloud, DePIN, and edge nodes via **TrustGate** (with receipts & SLOs). * **Model integration** — connect GPT, Claude, or open LLMs; mix and route automatically. * **Data connectivity** — ground agents in private or decentralized data through **Memory Map**. * **Automatic Payouts** — earn and pay contributors automatically whenever agents, models, or datasets are reused. * **Tool composability** — plug in APIs, SDKs, and smart contracts as skills. * **On-chain actions** — interact directly with **Solana** and **Ethereum** via Lucid Wallets — gas abstracted, permissionless. *** ## What’s in the box #### **A simple AI to chat and generate On-Chain AI Agents & Apps** #### **Synapse** — _Visual Builder_
The creative console where Lucid AI comes to life.\ From text to full-stack intelligence, Synapse lets you **spawn, link, and deploy** agents that combine **models, data, compute, tools, and on-chain logic** in one drag-and-drop canvas. Compose visually, connect 500+ integrations, and go live instantly across Web3 and Web2 (**Solana, Hyperliquid, Discord, Web, Unreal Engine, Telegram,** and more.) #### **Integrations (500+)** — Web2 & Web3 apps, models, data stores, and compute (cloud + DePIN). *** ## How it works * **Prompt in Lucid AI** or design in **Synapse** (prompt + flow). * **Declare** tools, policies, memory namespaces, and region/budget constraints. * **Run** via Smart Routing across GPT, Claude, or open models — or through **TrustGate** for attested compute. * **Keep UX fast** — sub-100 ms responses, async proofs. * **Prove & Pay** — Lucid emits **Thought Epochs** (policy hash, attestation, latency, cost).\ Roots are anchored to **Lucid Chain**; iGas splits payouts automatically. * **Monitor in LucidScan** — receipts, usage, spend, and royalties — all transparent. ### Typical workflows * **“Ship a bot now”** → Prompt in Studio → Quick-Run with Proof → deploy to Discord/Web → view receipts in LucidScan. * **“Enterprise endpoint”** → Swap to TrustGate (OpenAI-compatible) → set policy (EU-only, CC-On, p95 target) → get SLOs + insurance. * **“Game/UE5 agent”** → Use DevKit in-engine → route to best model/compute → share portable memory safely across sessions. * **“Data product”** → Attach licenses & revenue splits → publish as an Agent/API → payouts flow automatically on usage. * **“Cross-app memory”** → Opt-in **Portable Memory** so users/agents remember across channels with consent & scope. *** ## Why teams adopt Lucid AI * **One workspace, two pillars:** agents (UX & behavior) **and** models (intelligence & latency/cost control). * **No-code creation:** anyone can launch an on-chain-ready AI; no smart-contract skills needed. * **Infinite reach:** Design once, deploy everywhere — keeps a memory that follows it across Discord, X, Telegram, Unreal Engine, web widgets. * **Composable by design:** Every agent, model, dataset, and integration can connect and evolve together. * **On-Chain Option:** Lucid give a passport (on-chain id) and a bank account (wallet) to each agent. * **No vendor lock-in:** Bring your own models, data, compute — switch anytime. * **Proof-first foundation:** every run can be verified; contributors get rewarded. * **Web2 speed + Web3 truth:** sub-100 ms hot path; proofs & payouts settle asynchronously. *** ## FAQ (short) **Do I need to switch models?**\ No. Mesh works under GPT/Claude/open models; mix or swap any time. **Is everything on-chain?**\ No. The hot path is off-chain for speed; **Proofs & payouts** land on-chain asynchronously. **Do I need crypto to pay?**\ No. **Fiat is supported.** Tokens meter internals; the AI handles it. **What about my vendor discounts?**\ Use BYOK or route through **TrustGate** when you need attestation/SLOs/insurance. **How do memory & passports work?**\ Opt-in. **Passports** give assets an ID; **Portable Memory** carries scoped, encrypted context across apps with consent. **How many integrations are available?**\ **500+ Web2/Web3** apps, models, data stores, and compute—if it has an API or wallet, it plugs in. *** **Next:** dive into **Lucid Studio** to design your first agent, or read [**Lucid TrustGate**](/knowledge/lucid-ai/trustgate-managed-inference-and-depins-orchestration) to harden inference with SLOs and receipts. ## **Disclaimer** Lucid Synapse Studio evolves rapidly. Features and performance targets are subject to change.\ On-chain functions are optional and log only metadata, never raw content.\ Nothing here constitutes financial or investment advice. _Prototype tonight, go live tomorrow—**Lucid AI — the designer tool for interoperable AI.**_ - [Agent Lab](/knowledge/lucid-ai/architecture-what-is-lucid-ai/agent-lab): >- # Agent Lab A no-code workspace to define an agent’s **personality**, **skills**, and **deployment**.\ You control its tone, rules, and reach. It’s your AI — portable, programmable, and provable. **You Configure** * **Personality & Goals:**\ Define system prompt, tone, and goals. Add sliders for humor, empathy, formality. * **Skills (Tools):**\ Drag-and-drop from a verified library (e.g. Notion, Slack, Trading etc.). Add your own via schema. * **Memory:**\ Connect to portable namespaces on Lucid Chain. Memory follows your agent everywhere. * **Identity (Optional):**\ Give it a **Passport** — an on-chain ID and wallet for ownership, payouts, and audit. * **Channels:**\ Connect instantly to Discord, X, Telegram, Unreal Engine, or the web — tone and media adapt per channel. * **Safety:**\ Structured output filters, PII scrubs, profanity guardrails, and content moderation. **Deploy once, live everywhere.**\ Your agent’s memory, policy, and proofs follow it seamlessly across apps. *** ## What You Can Do * **Design agents visually** — define their personality, goals, and tone in seconds. * **Add skills** — connect tools, APIs, and on-chain actions as modular blocks. * **Attach memory** — give agents recall and persistence through **Memory Map**. * **Deploy anywhere** — Discord, X, Telegram, Unreal Engine, Web, or API — one identity, many surfaces. * **Stay compliant & auditable** — optional on-chain passports, receipts, and payouts. > _From personal assistants to game NPCs, agents you build in Synapse can live everywhere — with one mind, one memory._ *** ## How It Works in **Synapse** 1. **Start from a prompt**\ Type what you want to build:\ “Create a financial advisor bot for my community.”\ “Build a sarcastic NPC bartender for Unreal.”\ Synapse scaffolds the first version automatically — persona, skills, tone, and memory links. 2. **Open the Agent Lab block**\ Side panel opens with tabs: * **Persona** → identity, tone sliders (formality, humor, empathy). * **Skills** → connect tool nodes (APIs, databases, Web3 actions). * **Memory** → attach namespaces from Memory Map. * **Channels** → choose where this agent lives: Discord, Telegram, Web, Unreal, etc. * **Safety & policy** → configure content filters, regions, and output guards. 3. **Compose visually**\ On the **Synapse canvas**, your agent appears as a node: * Inputs: context, memory, policy, user prompts * Outputs: actions, messages, receipts\ Connect it to: * **Model Node** (intelligence) * **Tool Nodes** (actions) * **Memory Nodes** (context recall) * **Channel Nodes** (where it speaks) 4. **Preview instantly**\ Talk to your agent directly on the canvas or in the test chat.\ Watch memory updates and skill calls in real time. 5. **Deploy in one click**\ When ready, hit **Deploy** → your agent goes live across all connected channels.\ [**Engine** ](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine)handles routing and compute; [**Data** ](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data)stores memory and receipts. ### The Agent **Node** Each agent on the canvas is a **Lucid Node** — the center of its own mini-network. **Inputs:** * User messages * Context from memory * Outputs from tools or flows **Outputs:** * Actions * Replies * Receipts (Thought Epochs) Each Agent Node links directly to its **Passport** (identity & wallet) and **Memory Map** (context vault). ### When to Use What | Goal | Use These Blocks | | -------------------------------------- | ------------------------------------------ | | Create a smart chatbot or assistant | Model Node + Agent Node + Channel Node | | Add world-aware behavior to a game NPC | Memory Node + Model Node + Agent Node | | Build workflow bots or automation | Agent Node + Tool Nodes + Webhook Node | | Deploy multi-channel support agent | Agent Node + Channel Nodes (Discord/Web/X) | ### Set Up in 3 Steps (≈5 Minutes) 1. **Define your persona**\ Give your agent a name, tone, and goals (e.g., “Be a witty shopkeeper who loves gold coins”). 2. **Add intelligence**\ Attach a **Model Node** from Model Lab or use **Auto Router** for optimal performance. 3. **Add memory & channels**\ Choose what the agent remembers and where it lives. Click **Save → Test → Deploy**.\ Your autonomous AI is live — same personality everywhere, verifiable on the Lucid Layer. *** ## FAQ **Can one agent exist across multiple channels?**\ Yes. One agent ID (DID) = one personality across Discord, X, Web, and Unreal. **Can I run agents off-chain?**\ Absolutely. Use off-chain “Shadow Mode” for testing; enable proofs and payouts later. **How do I give agents tools?**\ Add any **Tool Node** to its flow — from APIs to Web3 contracts — and define allowed calls. **What if I already have an API or bot?**\ Wrap it as a Tool or Channel node and plug it into your agent. **Does it use crypto?**\ Not required. Fiat supported; tokens meter internals. - [App Lab](/knowledge/lucid-ai/architecture-what-is-lucid-ai/app-lab): >- # App Lab **App Lab** is where you turn connected agents, models, and tools into full applications — complete, composable experiences ready to deploy across Web2 and Web3.\ Inside **Synapse**, you drag, drop, and link your logic visually — no code, no configuration files, just flows that feel alive. *** ## What You Can Do * **Compose complete apps visually** — drag agents, models, tools, and UI blocks onto a single canvas. * **Automate complex flows** — chain multiple agents, memory scopes, and APIs into self-running systems. * **Integrate everything** — 500+ connectors from Web2 and Web3 (Discord, Notion, Telegram, DePIN, wallets, on-chain data). * **Deploy anywhere** — publish your app instantly to Web, mobile, Discord, Unreal Engine, or your own frontend. * **Stay verifiable** — every action logs a receipt on the Lucid Chain (optional but built in). > _In App Lab, every arrow is a flow of intelligence — each connection a new emergent behavior._ *** ## How It Works in **Synapse** 1. **Start from a prompt**\ Type: “Build a Discord onboarding flow with a personality quiz AI and wallet rewards.”\ Synapse auto-generates the flow: input (user), model (personality), tool (wallet), output (Discord bot). 2. **Open the App Lab canvas**\ You’ll see a real flowchart (powered by n8n under the hood): * **Nodes:** Agents, Models, Tools, Data, Memory, Channels. * **Edges:** logic lines — data, control, or event triggers. * **Blocks:** drag-and-drop components for chat, forms, triggers, webhooks, or blockchain actions. 3. **Connect & configure visually** * Connect an Agent to a Channel (e.g., Discord). * Link a Tool Node (e.g., OpenSea API, Stripe, Smart Contract). * Add logic gates (if/else, loops, triggers). * Drop UI components for user interactions. 4. **Preview instantly**\ Run the app right inside Synapse. Watch logs, memory recalls, and model selections in real time.\ Adjust flow connections on the fly — changes apply instantly. 5. **Deploy in one click**\ Choose where to publish: * Web widget * Discord / X / Telegram bot * Unreal or Unity runtime (for games) * API endpoint or webhook\ The app compiles into a containerized flow that runs on [**Engine** ](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine)(Router + Compute) and stores receipts via [**Data** ](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data)(Passports + Memory Map). *** ### The App **Node** Every app is a **Lucid Node** — a composition of nodes representing its internal logic. * **Inputs:** user actions, triggers, events. * **Outputs:** messages, transactions, notifications. * **Execution:** powered by Engine, with every flow wrapped in a verifiable **Thought Epoch**. *** ### Typical Use Cases | Goal | What You Build | | -------------------------- | ------------------------------------------------------------------------------- | | **Discord Community Bot** | Connect Agent Node + Model Node + Discord Channel Node + Wallet Reward Node. | | **Trading Bot** | Combine Data Node + Model Node (analytics) + DEX Node. | | **Interactive NPC System** | Model Node + Memory Node + Unreal Channel Node + Tool Node (inventory). | | **AI Automation** | Agent Node + Tool Node (API) + Policy Node (conditions) + Channel Node (email). | *** ### Set Up in 4 Steps (≈5 Minutes) 1. **Choose a template**\ Pick from dozens of pre-made blueprints (bots, dashboards, assistants, NPCs). 2. **Connect your logic**\ Drag and connect nodes — agents, data, memory, tools, and channels. 3. **Test your flow**\ Run a live simulation. Adjust triggers, limits, or UI elements visually. 4. **Deploy instantly**\ Publish to your chosen platform or export to run locally. > Every App you design in Synapse is a self-contained, interoperable system: fast, provable, and deployable anywhere. *** ## FAQ **Is App Lab just for developers?**\ No. Anyone can use it — from no-code creators to AI engineers. **Can I use my own APIs or models?**\ Yes. Bring your endpoints, credentials, or even custom nodes. **Does it support on-chain triggers?**\ Yes. You can connect wallets, contracts, and on-chain events as flow triggers. **What if I want enterprise-grade reliability?**\ Run your flows via **Lucid TrustGate** for SLOs, receipts, and insurance. **Can apps earn revenue automatically?**\ Yes. When users or other agents reuse your components, **Lucid’s dual-gas system** handles automatic splits and payouts. - [Build with Synapse (Visual Builder)](/knowledge/lucid-ai/architecture-what-is-lucid-ai/build-with-synapse-visual-builder): Visual logic for the Internet of AI. Build, connect, and prove — with Synapse. # Build with Synapse (Visual Builder)
## **What It Is** **From a single prompt to full orchestration.**\ Synapse lets you compose intelligent, interoperable AI Agents and Apps that **think, remember, and act across Web2 and Web3** — powered by the **Lucid Chain**.\ It’s where builders move from “Prompt to Agent” to **“Networked Intelligence.”** A drag-and-drop canvas to design complex, composable AI systems — with complete control over models, memory, compute, data, and on-chain actions. From a simple idea or prompt, you can connect 500 + integrations, tools, and chains, building end-to-end logic that runs at **Web2 speed** while remaining **verifiable on-chain.** > _Think of it as Zapier for AI — but decentralized, intelligent, and verifiable._ *** ## **Why It Matters** * **Full Control** — Ideal for teams, studios, and enterprises orchestrating complex logic. * **Composability** — Mix open & custom models, APIs, smart contracts, and DePIN compute. * **Context-Aware** — Each flow can read and write from **Memory Map** for portable recall. * **Audit-Ready** — Every run can emit an **Epoch Proof** (cost, policy, latency, contributors). * **Ownership** — Bring your own models, data, or compute; Synapse only coordinates * **Enterprise Scale** — < 100 ms hot-path latency; asynchronous proofs and payouts. *** ## **How It Works** **1. Start from a Prompt or Template** Example: > “When someone joins our Discord, create a personalized AI welcome message and store the memory.”\ > Synapse instantly builds a starter flow — with triggers, agents, and memory already connected. **2. Compose Visually** On the canvas, drag-and-drop pre-built **nodes**: * **Trigger Nodes** — start the flow (e.g., “New message in Discord”). * **Logic Nodes** — conditionals, splits, waits, loops. * **Action Nodes** — model calls, API requests, blockchain transactions. * **Data Nodes** — access to Memory Map, vector DBs, APIs, or IPFS. * **Output Nodes** — responses, notifications, or memory updates. Every connection is live — drag lines, rearrange logic, and see it run in real time. **3. Add Memory & Policy Nodes** * Define where knowledge lives via **Portable Memory namespaces**. * Apply **region, license, or privacy rules** for compliance. **4. Run & Observe** * Watch live token streaming (< 100 ms). * View **proofs** of cost, latency, and contributors. * Debug or tune logic instantly. **5. Deploy Anywhere** * **As an Agent** → API endpoint with memory & proofs. * **As an App** → chat, web, Unreal NPC, or kiosk. * Run continuously (daemon mode) or trigger by webhook/channel. *** #### **Example Use Cases** | Category | Flow Example | Description | | -------------- | ----------------------------- | ------------------------------------------------------ | | **AI + Web2** | CRM → GPT → Slack | Automate customer replies & generate receipts. | | **AI + Web3** | Wallet → Router → Telegram | On-chain trading assistant with verifiable actions. | | **AI + DePIN** | Sensor → LLM → Dashboard | Edge intelligence with latency <100 ms. | | **Gaming** | Quest DB → Model → Unreal | Narrative NPCs with shared memory & emotional states. | | **Enterprise** | API → Audit Proof → LucidScan | Regulator-ready reports with cost and policy receipts. | *** #### **Nodes You Can Use** * **Models:** GPT-class, Claude, open-source, or your own endpoint. * **Tools:** Any REST, SDK, or smart contract call. * **Data:** APIs, databases, S3/IPFS, vector stores, or on-chain data. * **Compute:** Cloud, on-prem, or DePIN nodes. * **Memory:** Scoped namespaces with read/write permissions. * **Policies:** Enforce region, license, privacy, or cost. * **Actions:** Outputs to Discord, Telegram, Slack, Web, or Unreal Engine. *** #### **Under the Hood** Flows run on **Lucid Runtime**, optimized for parallelism and proof generation.\ Each execution can: * Record **Proofs** of origin, model choice, and compute region. * Trigger **iGas payouts** to contributors (models, data, compute). * Anchor receipts to **Lucid Layer** asynchronously for transparency. All this without latency tax—your flow runs **sub-100 ms** on hot path. *** ## **Who It’s For** * **Developers** who need custom control and routing. * **Product teams** building multi-agent, multi-model applications. * **Enterprises** needing visibility, audit, and SLAs. * **DePIN providers** integrating compute nodes or sensors into AI apps. * **Studios & creators** automating complex behavior or storytelling pipelines. *** ## **FAQ** **Q: Can I mix APIs, models, and smart contracts in one flow?**\ Yes — flows are designed for total interoperability across Web2 & Web3. **Q: Is code required?**\ No, but you can extend with JS/Python nodes or SDKs for custom logic. **Q: Does every node have to produce proofs?**\ No — you can enable or disable proofs per node or flow. **Q: Can I share flows?**\ Yes — publish to the Marketplace or export JSON blueprints. **Q: Can I use my own cloud or compute?**\ Yes — point to your own endpoint or DePIN node; proofs still work. *** **Lucid Synapse** is the visual brain of the Lucid AI ecosystem.\ From a single prompt or a canvas, you can orchestrate models, tools, compute, and data into verifiable intelligence — fast, modular, and open. - [Case Studies & Showcase](/knowledge/lucid-ai/architecture-what-is-lucid-ai/case-studies-and-showcase): >- # Case Studies & Showcase Synapse lets anyone — from studios to enterprises to traders — build believable, compliant, and monetizable AI agents and apps with 500 + Web2/Web3 integrations. Below are real-world examples showing Lucid’s flexibility across industries. ### Crypto / Trading — On-Chain Market Copilot **Problem**\ Manual trading bots lack reasoning, compliance, and context. **Lucid Solution** * **Agent:** “DeFi Scout” (Discord + Web Dashboard) * **Model:** DeepSeek + on-chain data via Lucid Scan + RAG over token research notes * **On-chain (activated):** reads DEX prices/liquidity, crafts swaps under policy caps, posts trades with receipts *** ### Gaming — MOBA “Lane Coach” (UE5) **Problem**\ Players struggle to learn mid-match; static tips aren’t situational. **Lucid Solution** * **Agent:** “Coach Aria” (UE5 plugin, in-engine lip-sync/visemes) * **Model:** Cloud LLM (pinned) + **RAG** over hero stats, patch notes, team comps * **Memory:** Off-chain in beta; **on-chain** at launch for esports **provenance** * **Channels:** In-game VO + Discord scrim room **Result (pilot)** * +18–24% win-rate for coached squads (scrim dataset) * −32% rage-quit in first 10 minutes * <140 ms perceived latency (local ASR/TTS; cloud LLM) **Architecture snapshot**\ UE5 plugin → LEI SDK → RAG index (private) → Cloud LLM → (optional) Thought Epochs ### Enterprise — Support Concierge (Web + Slack) **Problem**\ Tier-1 tickets overwhelm the team; answers must be **auditable**. **Lucid Solution** * **Agent:** “Docs Genie” web widget + Slack bot * **Model:** BYOK enterprise LLM; **RAG** over KB/Confluence * **On-chain (opt-in):** Log **proofs/citations** for regulated answers * **Controls:** Answer-only-if-grounded; JSON tool calls to ticketing **Result (prod)** * 35–50% Tier-1 deflection * Mean time to answer: 6.4 s → 1.3 s * Audit pass: citations per reply ≥ 2.0 **Architecture snapshot**\ Widget/Slack → LEI SDK → RAG index → BYOK LLM → (optional) Thought Epochs + LucidScan *** ### Creator Economy — Streaming Sidekick (OBS/Discord) **Problem**\ Streamers need a real-time co-host that reacts to chat & game events. **Lucid Solution** * **Agent:** “Co-Host Nova” (Discord + OBS browser source) * **Virtual Human:** stylized avatar with cloned voice * **Model:** Router “Auto” (small local SLM for intent + cloud LLM for long form) * **Safety:** Brand tone fine-tune + profanity filter tools **Result (pilot)** * +17% average watch time * +23% chat participation * Sponsorable segments with scripted ad-reads **Architecture snapshot**\ Discord/OBS → LEI SDK → Local SLM (intent) → Cloud LLM (long) → VH render *** ### Retail / Kiosk — Multilingual Concierge (Edge PC) **Problem**\ Foot-traffic asks repetitive questions in many languages; privacy is critical. **Lucid Solution** * **Agent:** “Store Guide” on touch kiosk + mic * **Model:** On-device SLM (intent) + on-device TTS/ASR; cloud fallback at peak * **RAG:** Product DB + inventory, daily promos * **On-chain (opt-in):** **Provenance** for regulated answers/returns **Result (pilot)** * 62% self-serve FAQ resolution * <120 ms local response; cloud fallback <250 ms * Zero PII leaves store (Shadow mode) **Architecture snapshot**\ Kiosk → LEI SDK → Local RAG + SLM → (fallback) Cloud LLM → (optional) Thought Epochs *** ### Education — Personal Tutor (Web + Mobile) **Problem**\ Tutors don’t scale; parents/schools need **transparent** hints & grading. **Lucid Solution** * **Agent:** “Study Buddy” with curriculum-aligned RAG * **Model:** BYOK LLM; deterministic rubric scoring * **Controls:** No direct answers; Socratic hints with citation count **Result (semester)** * +11–19% quiz scores (math ELA mix) * Teacher dashboard: per-concept mastery, red-flag topics * Optional on-chain for exam **provenance** **Architecture snapshot**\ Web app → LEI SDK → Private RAG → BYOK LLM → (optional) Thought Epochs + LucidScan *** ### Indie Game — Living Townsfolk (PC) **Problem**\ Indies want believable NPCs without vendor lock-in or big infra. **Lucid Solution** * **Agent:** 24 town NPCs with routines & memories * **Model:** Open Llama-class via **Lucid Cloud** (bundled rates) * **Memory:** Off-chain during dev; on-chain for UGC quests at launch * **Workflow:** Canary model swaps per patch; rollback in 1 click **Result (early access)** * +26% daily playtime * 40% fewer content updates (NPCs improvise within guardrails) **Architecture snapshot**\ UE5 → LEI SDK → Lucid Cloud LLM → Local RAG → (optional) Thought Epochs *** ### Public Sector — City Kiosk Assistant **Problem**\ Civic services need multilingual, **auditable** answers with strict privacy. **Lucid Solution** * **Agent:** “Civica” at city hall kiosks + WhatsApp * **Model:** On-prem LLM (air-gapped); RAG over ordinances/forms * **On-chain:** Log proofs for public record; no raw data on chain **Result (pilot)** * 58% fewer in-person queue minutes * Public transparency: LucidScan shows answer provenance without PII **Architecture snapshot**\ Kiosk/WhatsApp → LEI SDK → On-prem LLM + RAG → Thought Epochs + LucidScan *** ### Pattern Library (Steal These) * **Hybrid intent split:** small **on-device SLM** for fast intent/tooling + **cloud LLM** for rich generation. * **Answer-only-if-grounded:** prevents hallucinations; show citations. * **Shadow → On-chain switch:** build private; enable proofs/royalties at launch. * **Canary & rollback:** ship updates without breaking agent identity/channels. * **Vendor-neutral:** BYOK now; migrate to Lucid Cloud later (or vice-versa). *** ### Want Your Use Case Here? * **Co-build pilots** (fixed-price, 6–8 weeks) * **Grants/credits** for indies and open tooling * **Enterprise**: VPC, on-prem, compliance reviews > Want your use case here? → Co-build pilots (6-8 weeks, fixed price) or apply for indie grants. Send us your platform, privacy requirements, and a one-line ‘agent job description’ — we’ll return an architecture & budget within 48 hours. - [Channels & Integrations](/knowledge/lucid-ai/architecture-what-is-lucid-ai/channels-and-integrations): >- # Channels & Integrations **What It Covers (at a Glance)** * **Social & Chat:** Discord, X (Twitter), Telegram, Slack * **Game Engines:** Unreal Engine 5 (Blueprints + C++) * **Web & Mobile:** Web widget (React/Vanilla), iOS/Android SDK (alpha) * **Streams & Creators:** OBS browser source, Twitch Chat (alpha) * **Voice & Kiosks:** WebRTC voice, mic/speaker endpoints, kiosk mode * **APIs:** REST + Webhooks for Bring-Your-Own-Channel (custom launchers, proprietary clients) Your agent keeps the same **DID (identity)** and **memory** across all channels.\ On-chain proofs and portable memory are **optional** with the Lucid Chain. *** ## Why It Matters * **Frictionless reach:** Meet users where they already are — guilds, timelines, game lobbies, or in-app. * **Consistent persona:** One prompt, one memory, one voice — everywhere. * **Operational control:** Throttle, canary, or roll back per channel without breaking continuity. * **Compliance on demand:** Turn on on-chain provenance only where required. > _One agent, infinite surfaces — all connected through the Lucid Chain._ *** ## How It Works (High-Level) 1. **Create or Select Agent** in Synapse → assigns Agent DID and memory namespace. 2. **Attach a Model** → pick GPT/Claude/Llama or go “Auto” via Router. 3. **Choose Channels** → Synapse provisions the connector(s) using your credentials. 4. **Deploy** → your agent appears natively (Discord bot, UE5 NPC, Web widget, etc.). 5. _(Optional)_ **On-Chain** → Thought Epoch roots & payout splits are logged asynchronously. All orchestration, logging, rate limits, and (if enabled) gas funding are handled automatically. ### Supported Channels — What You Can Do #### Discord * Slash commands, replies, threads, reactions * Voice rooms (ASR/TTS streaming), stage events * Role-aware guardrails (e.g., mod-only or quest mode)\ **Use cases:** community helpers, RPG NPCs, support bots #### X (Twitter) * Mentions, DMs, scheduled posts, media replies\ **Use cases:** brand sidekicks, creator assistants #### Telegram / Slack * Inline buttons, file uploads, multi-chat memory scopes\ **Use cases:** ops copilots, ticket triage, field teams #### Unreal Engine 5 * `LucidCharacter` component for ASR/TTS, gestures, tool-calling * Local/cloud inference; optional **Virtual Humans** avatar\ **Use cases:** NPCs, coaches, shopkeepers, interactive quests #### Web & Mobile * Drop-in widget (React/Vanilla), iOS/Android SDK (beta) * WebRTC voice, custom themes, persistent memory\ **Use cases:** web concierges, education tutors, app copilots #### OBS / Streams / Twitch (beta) * Avatar overlay, chat awareness, sponsor or co-host segments\ **Use cases:** creator sidekicks, real-time commentary #### Bring-Your-Own-Channel (BYOC) * REST + Webhooks to connect any custom client\ **Use cases:** VR/AR, in-store kiosks, proprietary platforms ### Identity, Memory & Chain (Your Call) * **One identity everywhere** — Agent DID stored in AgentMeta; channels reference the same key. * **Memory scopes:** per-channel, per-guild, or global; stored locally or on-chain. * **On-chain optional:** enable per region or title; proofs & payouts settle asynchronously (no UX delay). ### Quick Compatibility Matrix | Channel | Native | Voice | Memory Sync | On-Chain Ready | | ------------- | ------ | ----- | ----------- | -------------- | | Discord | ✅ | ✅ | ✅ | ✅ | | X (Twitter) | ✅ | ▢ | ✅ | ✅ | | Telegram | ✅ | ▢ | ✅ | ✅ | | Unreal Engine | ✅ | ✅ | ✅ | ✅ | | Web / Mobile | ✅ | ✅ | ✅ | ✅ | | OBS / Twitch | ✅ | ▢ | ✅ | ✅ | | BYOC | ✅ | ▢ | ✅ | ✅ | ▢ = via overlay or custom integration ### Build Your Own Connector Use the open SDKs (`TS/JS`, `Python`, `C/C++`) to: * Handle auth and webhooks * Map channel events → `Agent.ask()` / `Agent.act()` * Stream partials (text, voice, video) and return results * _(Optional)_ Register your connector in Studio for one-click installs Starter templates are in `/examples`.\ Community connectors can be submitted via **Lucid Improvement Proposals (LIPs)**. ### Example Rollouts | Scenario | Setup | | -------------------- | ---------------------------------------------------------------------------------------- | | **Game + Community** | Same NPC in-game (UE5) and on Discord; on-chain proofs enabled only for esports matches. | | **Brand + Support** | Web concierge + Telegram field bot; proofs on for regulated use, off for casual chat. | | **Indie Pilot** | Launch on Discord & Web in Shadow Mode; enable UE5 & on-chain later. | *** ## FAQ (Short) **Do I need a separate agent per channel?**\ No. One agent = many channels. Identity and memory are shared. **Will on-chain slow responses?**\ No. Commits are async — live latency stays under 100 ms. **Can I restrict memory per channel?**\ Yes. Use namespaces and ACLs to isolate data or opt-out of sharing. **Can I self-host connectors?**\ Yes. Self-host or let Studio manage them — your keys remain scoped. - [Deploy & Publish (Go Live with Proofs)](/knowledge/lucid-ai/architecture-what-is-lucid-ai/deploy-and-publish-go-live-with-proofs): Publish trustable AI. Every run. Every proof. Every payout. # Deploy & Publish (Go Live with Proofs) ## **What It Is** Deployment in **Synapse** isn’t just shipping code — it’s **publishing trustable, interoperable AI.**\ Every Agent or App you build can go live anywhere — **with receipts, rewards, and verifiable proofs baked in through the Lucid Chain.** From your dashboard → **One click:**\ → Push live to **Discord, X, Telegram, Web, or Unreal Engine**\ → View **Epoch Proofs** for every run\ → Enable **automatic iGas payouts** for contributors **Launch at Web2 speed. Settle with Web3 integrity.** *** ## **Why It Matters** * **Instant deployment** — no DevOps, no lag. * **Provable trust** — each run verifiable on Lucid Chain. * **Automatic revenue** — every contributor rewarded fairly. * **Enterprise-ready** — SLAs, audit exports, compliance controls. * **Scalable & portable** — deploy across Web2, Web3, or DePIN nodes. *** ## **How It Works** 1. **Select environment** * Dev → Staging → Production * Shadow mode (off-chain) or on-chain mode for verified runs. 2. **Run the audit preview** * Synapse simulates the first run and generates a **Proof preview**:\ model, region, latency, cost, policy, contributors. * You can export it or share a **LucidScan link**. 3. **Publish** * Your Agent/App gets a **Passport ID** (identity) * Its memory becomes portable across channels * Contributors (model/data/compute) get auto-registered for **payouts** 4. **Track live activity** * Each interaction produces a **verifiable receipt**. * Proofs and payouts sync asynchronously on **Lucid Chain** (no lag). * Stats visible in **LucidScan**: latency, win-rate, usage, and earnings. *** #### **Where You Can Deploy** | Surface | Description | | -------------------------- | -------------------------------------------- | | **Web Widget** | Embed in your site or dashboard. | | **Discord / X / Telegram** | Multi-channel agents with memory continuity. | | **Unreal** | NPCs and Virtual Humans with emotion models. | | **API Endpoint** | Deploy as a programmable AI backend. | | **DePIN / Compute Node** | Stream reasoning directly to edge hardware. | *** #### **Proofs & Payouts** Every run can mint an **Epoch Proof**, containing: * Execution metadata (hash, policy, latency, cost) * Attestation & region * Contributors (models, data, compute, tools) * Optional audit/export for enterprise clients Then, **Lucid Chain** distributes **iGas payouts** automatically to contributors—so every useful resource (model, dataset, tool, or node) gets paid fairly. **Proofs** are visible on **LucidScan**, ensuring transparency for both builders and enterprises. *** #### **Example Workflows** **→ From Studio (Prompt-created)** * “Health Coach” agent created with prompt * Deploy to Discord & Web in one click * Live chat in <100 ms; Proofs visible in LucidScan * iGas payouts split across: model + compute + creator **→ From Flow (Advanced)** * Flow linking GPT + Slack + CRM * Publish to API endpoint for B2B clients * Configure region (EU-only) and policies * Clients get signed receipts per run **→ From Game (UE5 Integration)** * NPC agents with memory & emotional state * Runs locally on engine; syncs Proofs later * Optional DePIN compute for realism rendering *** #### **Observability** * **LucidScan Dashboard:**\ Live metrics: win-rate, latency, RAG accuracy, cost, citations, Proof history. * **Notifications:**\ Alerts for SLO breaches or payout confirmations. * **Revenue Split View:**\ Track iGas distributions by asset type (model/data/compute/agent) *** ## **FAQ** **Q: How fast is deployment?**\ < 60 seconds from publish to live — Web2-speed hot path, async Proof sync. **Q: Can I control where my agent runs?**\ Yes. You can pin regions (EU, US, Asia) or choose DePIN compute nodes. **Q: Are Proofs mandatory?**\ No. You can deploy off-chain (Shadow mode) and enable Proofs later. **Q: Who receives payouts?**\ Anyone whose assets were used — models, data, compute, or skills — automatically via iGas. **Q: Can I integrate LucidScan into my own dashboard?**\ Yes — through the open **LucidScan API**. - [Enterprise & Public Sector](/knowledge/lucid-ai/architecture-what-is-lucid-ai/enterprise-and-public-sector): >- # Enterprise & Public Sector ### What It Is A no-code/low-code way for enterprises and public agencies to design, govern, and deploy AI agents (text/voice/face) across channels. Studio ties your existing knowledge bases and tools to best-fit models, and—when enabled—anchors identity, memory, and audit proofs on-chain. *** ### Why It Matters * **Lower cost to serve:** Deflect routine tickets and shorten handle time with grounded, tool-using agents. * **Trust & audit:** Optional on-chain Thought Epochs create a tamper-evident trail of “what was said, which data was used, which model ran.” * **Vendor-neutral stack:** Bring your own models (closed or open), swap by config, or let the router optimize. * **Privacy by design:** Raw content stays off-chain; only small hashes/proofs are written when you opt in. *** ### Core Capabilities * **Omnichannel delivery:** Web widget, mobile SDKs, Slack, WhatsApp/Telegram/Discord, IVR/telephony (SIP/WebRTC), smart kiosks/edge. * **Model freedom:** Pin GPT/Claude/open Llama or deploy your fine-tuned/RAG models; hot-swap per queue or tenant. * **Knowledge grounding (RAG):** Connect Confluence/Notion/SharePoint/Docs, product catalogs, SOPs, logs; govern namespaces and freshness SLAs. * **Task execution:** Safe function calls for CRM/ERP actions (create case, check order, reset MFA, schedule visit). * **Virtual humans (optional):** Face + voice for concierge, teller, tutor, or kiosk use; web-rendered or game-engine driven. * **Compliance tooling:** Redaction filters, PII/PHI detection, consent flows, retention windows, export on request. * **Observable by default:** LucidScan dashboards for provenance (when on-chain), routing decisions, and reward splits. *** ### Deployment Modes (you choose) 1. **Off-chain (default):** Fastest path; all storage in your VPC. 2. **Hybrid:** Inference off-chain, **select** events (e.g., escalations, approvals) committed on-chain for audit. 3. **On-chain selective:** Identity + memory anchored on-chain; Thought Epochs batched asynchronously. Replies never block on commits. *** ### Typical Workflows * **Customer Service Concierge** * Grounding: KB + order DB → **answer-only-if-grounded**. * Tools: Create/close ticket, authenticate, refund within policy. * On-chain (optional): Log policy-gated actions for audit. * **Retail Associate / Banking Teller (kiosk or branch)** * Face + voice; multilingual dubbing. * Tools: Inventory/eligibility checks, appointment booking. * Optional: On-chain proofs for regulated decisions. * **Training & L\&D Coach (public sector/enterprise)** * Scenario role-play; scores mapped to rubric; exports to LMS. * Keeps per-learner memory locally; can publish anonymized metrics on-chain for transparency. * **Field Ops Assistant** * Works offline; syncs when connected. * Photo/video understanding for checklists; RAG over SOPs. *** ### Security & Compliance (highlights) * **Data residency:** Regional deployments; private VPC or on-prem connectors. * **Access control:** SSO/SAML/OIDC, RBAC, per-namespace ACLs. * **Redaction & guardrails:** PII/PHI scrubbing, policy prompts, tool schemas (no arbitrary code paths). * **Right-to-forget:** Remove pointers and hot data; on-chain keeps only non-identifying hashes when enabled. * **Provenance (optional):** Thought Epoch roots + Recall CIDs provide verifiable trails without exposing raw content. *** ### Integration Map * **CRMs/Helpdesks:** Salesforce, Zendesk, ServiceNow (create/update/read via scoped keys). * **Knowledge sources:** Confluence, Notion, Google Drive, SharePoint, S3/Blob, REST. * **Data/actions:** Webhooks, GraphQL, queue adapters (Kafka/PubSub), scheduler. * **Telephony:** SIP trunk, WebRTC, STT/TTS adapters. *** ### FAQ **Do we have to use on-chain?** No. It’s opt-in per agent/event.\ **Can we keep weights private?** Yes. Host your own endpoints or Fluid Nodes; register only metadata if you want routing.\ **Will on-chain slow responses?** No. Thought Epochs are batched asynchronously; replies target <100 ms.\ **What about PII/PHI?** Redaction + policy prompts + retention windows; raw content stays off-chain.\ **Data residency?** Deployed per region; connectors respect your storage policies. *** _Outcome: lower support costs, higher trust, clear audits—without locking your stack to a single vendor._ - [Gaming](/knowledge/lucid-ai/architecture-what-is-lucid-ai/gaming): Ship believable characters that speak, emote, remember, and act—without locking your game into a single vendor. Lucid delivers a modular stack and in-engine SDKs so you can run low # Gaming **Ship believable characters** that speak, emote, remember, and act—without locking your game into a single vendor. Lucid delivers a modular stack and in-engine SDKs so you can run **low-latency AI** on PC/console (where permitted) or the cloud, with optional on-chain memory and provenance. ### What You Get * **In-Engine Plugins**\ Unreal Engine 5 plugin (Blueprints + C++) — drop-in components for **ASR/TTS, lip-sync/visemes, gaze & gesture**, tool/function calling, and memory. * **Lucid In-Engine Inference SDK (LEI SDK)**\ A unified API that runs models **on-device or cloud**, orchestrates failover, and supports multiple backends (CUDA/DirectML/Vulkan/CPU) under one call. * **Persistent Memory (Optional)**\ Turn on Lucid Chain to give NPCs **session-to-session memory**, shared knowledge (per your rules), and audit/rewards via **Thought Epochs** and **LucidScan**. * **Vendor-Neutral Intelligence**\ Route to your preferred LLMs (small on-device, large in the cloud). Use Lucid’s router or pin a model explicitly for deterministic builds. *** ### Key Benefits * **Fine-Tuned for Roleplay**\ Instruction-tuned, function-calling flows; fast RAG over your game data; guardrails for lore and brand tone. _Cheat-sheet:_ **RAG for facts**, **fine-tune for style/behavior**, **both** for flagship NPCs. * **Real-Time Performance**\ Sub-100 ms target for local/hybrid setups with streaming ASR/TTS and in-engine lip-sync. * **Simple & Flexible Deployment**\ Run **on PC/console** (where platform policy allows), **on your cloud**, or **on Lucid Cloud**. Switch per region, queue, or title phase. * **Own Your Pipeline**\ Keep weights private, swap providers by config, and choose when to log provenance on-chain. *** ### New Experiences You Can Ship Now * **Autonomous Agents**\ Squad mates that plan/act/reflect; townsfolk with routines and evolving relationships. * **Companions & Party Members**\ Natural-language tactics, inventory management, quest notes, and player coaching. * **Learning Enemies**\ Bosses that adapt to player strategies over time (opt-in memory). * **Open-Ended Interrogation & Dialogue**\ Free-form questioning with tool calls into your gameplay systems. * **Creator & Streamer Assistants**\ In-game producers, commentators, and quest designers that react in real time. *** ### Lucid Game Stack (Composable) **Animation: Audio-to-Face Runtime** for UE5 - Use AI to convert streaming audio to facial blendshapes for real-time lip-syncing and facial animations. **Intelligence** * **On-Device SLMs (2–8B)** for low-latency intent, roleplay, and tool calls. * **Cloud LLMs** (GPT-class, Claude-class, open models) for rich generation. * **Game RAG**: query your lore, quest DB, nav graphs, telemetry. * **Fine-Tuning**: LoRA/QLoRA adapters to lock tone/behavior; package as **ModelMeta** and pin per NPC/class. * **Guardrails**: policy prompts & safe function schemas. **Speech** * **ASR/TTS** with viseme timing, voice cloning presets, multilingual dubbing. * Streamed partials for immediate mouth movement. **Memory (Optional)** * **Local or On-Chain**. With Lucid Chain enabled, NPC memories and major events get **batched as Thought Epochs**, visible in **LucidScan**; without it, keep everything local. *** ### Deployment modes * **Local / On-device** (PC; console where platform policy allows): minimal latency, offline-friendly. * **Cloud** (your CSP, on-prem, or Lucid Cloud): scale to spikes; bigger models. > You choose per project/region. On-chain features are **optional** and can be enabled per title, shard, or NPC class. ### When to turn **on-chain** on Use Lucid Chain when you need: * **Provenance** (esports, real-money tournaments, UGC moderation, e-discovery). * **Cross-title/cross-studio continuity** (franchise companions, shared NPCs). * **Automatic royalties** (data/model reuse payouts, transparent splits). Keep **off-chain** for purely local or closed experiences. Same SDKs, same characters. ### Data, safety, and control * **Strict schemas** for tool calls; no arbitrary code paths. * **Lore guardrails** (RAG filters + policy prompts). * **Privacy-first**: raw media/embeddings stay off-chain; on-chain stores hashes/proofs only. * Opt-in data staking and royalties via **Proof-of-Contribution** (if enabled). *** ### Getting Started #### Unreal Engine 5 1. Install **Lucid UE5 Plugin** → drop **LucidCharacter** into the level. 2. Bind **GameFunctions** (blueprint or C++) for safe tool calls. 3. Choose **Local / Cloud / Hybrid**. 4. (Optional) Toggle **On-Chain Mode** for provenance/memory. #### Custom Engines Use the **SDK** (C/C++) to register models, speech, and memory providers. One API handles **routing, batching, and device/cloud selection**. ### FAQ **Do I have to use Lucid’s router?**\ No. You can **pin a model** (deterministic) or use the router for cost/latency/quality trade-offs. **Does this lock me to a single provider?**\ No. The LEI SDK is **provider-agnostic** (local runtimes, your cloud, or Lucid Cloud). **What about consoles?**\ Follow each platform’s policy for local inference/networking. **Will on-chain slow my game?**\ No. **Thought Epochs** are **asynchronous**; gameplay never blocks on commits. *** _Build living worlds—keep control. Lucid makes it practical._\ **Talk to Us** for a fixed-price pilot or bespoke integration - [Getting Started (5 Minutes)](/knowledge/lucid-ai/architecture-what-is-lucid-ai/getting-started-5-minutes): >- # Getting Started (5 Minutes) ### What You’ll Do * Create a **multichannel agent** (Discord/X/Telegram/Web/UE5). * Pick a **model** (use your own keys or Lucid Cloud) — no fine-tune required. * (Optional) **Ground** the agent with RAG over your docs/lore. * (Optional) **Enable on-chain** identity & memory. * Go live and watch **transparent usage & payouts** in the activity trace. *** ### 1) Five-Minute First Agent **1. Create** → _New Agent_ → choose a template\ Examples: “Goblin Merchant,” “Support Concierge,” “Lore Guide.” **2. Personality** → adjust sliders (tone, formality, sarcasm) & system prompt. **3. Model** * **Pick one** from catalog (GPT-class, Claude-class, Open Llama, your endpoint) * or **Auto (Router)** to optimize cost/latency. > You **don’t** need to create a model to ship an agent. Swap anytime. **4. Grounding (optional)** → attach **RAG** * Select a **Memory Map namespace** (shared) or upload a **private index** (docs, lore, FAQs). **5. Channels** → connect Discord / X / Telegram / Web widget / UE5 * Use one-click OAuth for social channels; drag-drop actor for UE5. **6. Simulate** → “/try” → ask a question * Watch live trace: tokens, RAG hits, (optional) on-chain proofs. **7. Deploy** * **Shadow (off-chain)** for stealth/dev **or** * **On-chain** to anchor DID + wallet + optional memory. * Billing: pay in **fiat or crypto**; BYOK or **Lucid Cloud**. No double charge. **Outcome:** Your agent is live across selected channels with <100 ms perceived response (streaming), optional persistent memory, and clear usage receipts. *** ### 2) Five-Minute First Model (Optional) **1. Open Model Lab** → “RPG Lore RAG” (or start blank) **2. Connect Sources** * Drop PDFs/Markdown/CSV or select Memory Map namespaces. * Tag versions (e.g., `@season_1`, `@spoilers_off`). **3. Index** * Choose **hybrid** (vector + keyword) with sensible chunking presets. * Enable **“answer-only-if-grounded”** and citations. **4. (Optional) Fine-Tune** * Upload \~200 style examples; run **LoRA/QLoRA**; quick eval vs baseline (latency, win-rate, citation rate). **5. Package & Deploy** * Publish **Model Card** + **ModelMeta vX.Y**. * Pin to your agent or roll out via **canary %**. * Target **BYO infra**, **Lucid Cloud**, or a **Fluid Node** you control. **Outcome:** A grounded or tuned model with versioning, evals, and clean rollback—swappable per agent without changing the agent’s identity or channels. *** ### On-Chain: When (and Why) to Flip It On * **Provenance & trust:** esports, UGC moderation, audits → verifiable Thought Epochs. * **Shared intelligence & rewards:** opt-in data reuse, automatic splits (PoC). * **Continuity:** cross-title agents with portable memory/identity. > On-chain is **optional** and never blocks UX; commits are asynchronous. *** ### BYOK vs. Lucid Cloud (1-liner) * **BYOK:** you keep your vendor keys (OpenAI/Anthropic/etc.); pay them for tokens and pay Lucid’s **platform fee** only. * **Lucid Cloud:** **bundles** model + platform—one predictable rate; no double-charging. *** ### What “Good” Looks Like (Quick Checklist) * ✅ Agent replies stream quickly; lip-sync/visemes match (if using UE5). * ✅ RAG shows citations; “answer-only-if-grounded” prevents hallucinations. * ✅ Usage trace shows tokens, audio minutes, and (if enabled) on-chain proofs. * ✅ Rollback works: switch model version or disable RAG with one click. * ✅ Channels stay in sync—same agent DID across Discord/X/UE5. *** ### Common Setups (Copy-able) * **Indie game prototype:** Shadow mode, Open Llama-7B on Lucid Cloud, RAG over `lore/` folder; Discord + UE5. * **Enterprise concierge:** BYOK to vendor LLM, private RAG index, on-chain proofs for audit; Web + Telegram. * **Creator bot:** Router Auto, public Memory Map namespace for discovery, off-chain during beta, on-chain at launch. *** ### Mini-FAQ **Do I have to fine-tune?**\ No. Most agents ship with catalog models + RAG. Fine-tune later for tone/consistency. **Will on-chain slow my app?**\ No. Commits are batched as **Thought Epochs**; inference stays off-chain for speed. **Can I keep everything private?**\ Yes. Use private RAG indexes and Shadow (off-chain). Memory Map sharing is opt-in. **Can I swap models without breaking links?**\ Yes. Model choice is **hot-swappable**; the agent’s DID and channels don’t change. *** ### Next Up * Add a **Virtual Human** face to your agent (optional). * Explore your agent across every canal (Socials, Games, Chats, XR etc.) * Explore **Analytics & Traces** to watch usage and costs in real time. * Browse **Case Studies** for game, support, and creator patterns. - [Model Lab](/knowledge/lucid-ai/architecture-what-is-lucid-ai/model-lab): Your workspace to shape intelligence inside the Internet of AI. # Model Lab **Model Lab** is where you connect knowledge, craft voices, and configure models for your agents and apps — all inside **Synapse**, the visual OS that lets anyone _design AI like they design slides in Canva._ You don’t need ML expertise. You just **plug in data, pick a brain, and deploy.** ## What you can do * **Connect your knowledge** — plug in docs, wikis, or game lore so your agents answer with your own truth. * **Pick the best model** — use **Auto (Router)** or pin GPT, Claude, Llama, or any custom endpoint (BYOK). * **Shape the voice** — match your brand or character with instant style/tone tuning. * **Stay in control** — balance **speed / cost / quality** with a single slider. * **Go verifiable (optional)** — flip **on-chain** for transparent memory, receipts, and automatic payouts. > _It’s Canva for AI creation — intuitive, visual, and instantly connected to the Lucid Chain._ ## How It Works in **Synapse** #### **Start from a prompt** * Type what you want to build: “Create a customer support AI with our docs” or “Design a goblin shopkeeper NPC.” * Synapse generates the first version (model, knowledge, tone) automatically. #### **Open the Model Lab block** A side panel shows: * **Active model:** Auto or specific * **Knowledge sources:** files, links, datasets * **Tone controls:** sliders + presets Click, drag, and edit like Canva—no YAML, no code. #### **Preview & test instantly** Chat with your agent in-place. Adjust tone or knowledge live.\ **Router** benchmarks and can switch models if latency spikes. #### **Attach to any Agent or App** Click **Attach** to add this configuration to an agent or flow.\ At runtime, [**Engine** ](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine)(Router + Fluid Compute) executes; [**Data** ](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data)(Passports + Memory Map) stores **verifiable receipts**. > Every design you make in Synapse is a **living AI**: portable, auditable, and deployable anywhere. ### The Model **Node** (on the canvas) * Inputs: **Prompt, Context, Tools, Memory, Policy, Compute** * Outputs: **Response, Citations, Embeddings, TokensUsed, ReceiptID** * Use **“Add to Canvas”** from Model Lab to drop it as a node and wire to datasets, tools, memory, and channels. ### When to Use What | Scenario | Feature | | -------------------------------------------------------- | ----------------------------------------------- | | Knowledge changes often (support docs, game lore, wikis) | **Connect Knowledge (RAG)** | | You need a consistent personality or brand tone | **Style & Tone (System Prompt or Fine-tuning)** | | You want flagship characters or assistants | **Use both** | ### Set Up in 3 Steps (≈3 Minutes) 1. **Choose a Model**\ Start with **Auto (Router)** or manually pick GPT/Claude/open models. 2. **Connect Knowledge (optional)**\ Drop PDFs/Markdown/CSVs or URLs—Lucid indexes so answers **cite sources**. 3. **Set the Tone (optional)**\ Select a preset (Helpful, Playful, Formal) or paste a short sample to mimic a voice. Click **Save → Attach → Deploy.**\ Your intelligent, branded, grounded AI is live. *** ## FAQ **Q: Do I have to train anything?**\ **A:** No. Start with Auto; refine later. **Q: Can I bring my own model key?**\ **A:** Yes. Use any API key/endpoint (BYOK) or Lucid Cloud; swap anytime. **Q: Will it slow my app or game?**\ **A:** No. Replies stream in **<100 ms**; on-chain proofs sync later. **Q: Can I keep it all off-chain?**\ **A:** Absolutely. Build privately; enable proofs/royalties when you’re ready. - [Model Lab (Advanced)](/knowledge/lucid-ai/architecture-what-is-lucid-ai/model-lab/model-lab-advanced): >- # Model Lab (Advanced) ### What It Is (at a glance) Model Lab is Lucid Studio’s workspace to **configure, evaluate, and ship** the “intelligence” behind your agents: * **RAG (Retrieval-Augmented Generation):** ground any model in your lore, docs, or telemetry. * **Fine-tuning (LoRA/QLoRA on supported open models):** lock tone, style, and tool-use behavior. * **Catalog & Versioning:** register **ModelMeta** entries (price/latency profile, versions, adapters) and hot-swap per agent. * **BYOK or Lucid Cloud:** use your own model endpoints (OpenAI/Anthropic/etc.) or deploy open models on Lucid Cloud/Fluid Nodes. *** ### Why It Matters * **Canon-faithful answers:** RAG prevents hallucinations on living game/data worlds. * **Consistent character:** fine-tunes preserve voice, safety, and function-calling patterns. * **Cost & latency control:** pin small on-device SLMs for instant intent; burst to larger LLMs only when needed. * **No vendor lock-in:** switch providers by config; keep weights private when you self-host. *** ### When to Use What * **Use RAG** when facts change often (game patches, help-center, runbooks, live events). * **Use Fine-Tuning** when you need stable tone/format/behavior (NPC persona, brand style). * **Use Both** for flagship assistants/NPCs that must be **canon-faithful** _and_ **on-brand**. *** ### RAG Studio 1. **Connect Sources**\ Drag in PDFs/Markdown/CSV, point to URLs, or select Memory Map namespaces (or keep private indices). 2. **Index**\ Hybrid search (vector + keyword). Presets for code, narrative, support. Filters (e.g., `@season_1`, `spoilers_off`). 3. **Grounding Policy**\ “Answer-only-if-grounded”, min citations, strict JSON tool outputs. 4. **Ship**\ Save as **RAG Pack vX.Y** and attach to one or more agents. **Under the hood** * **Hot lane**: low-latency vector DB for <100 ms lookups. * **Optional**: **Cold Lane -** IPFS/Arweave archive for audit & Thought Epochs can record **Recall CIDs** (hashes/pointers), not raw content. *** ### Fine-Tuning Studio * **Adapters:** LoRA/QLoRA on supported open models (e.g., 2–8B SLMs, selected 7–14B LLMs). * **Datasets:** import JSONL; curate with labeler (prompt/response pairs, tools, refusal policy). * **Controls:** epochs, LR, batch size, target layers; cost/time estimator before you train. * **Evaluation:** regression suites (lore QA, safety, formatting), win-rate vs. baseline, latency, $/reply. * **Packaging:** produce a **Model Card** and **ModelMeta** (price/latency profile, adapters, RAG pack). * **Targets:** your cloud, your Fluid Node, or **Lucid Cloud**. (Optional on-chain registration for routing/royalties.) > **Closed-model note:** For GPT-/Claude-class APIs you won’t fine-tune weights here; you’ll configure **prompt templates, tool schemas, safety policies, and RAG**, then evaluate and version just like open-model variants. *** ### How It Works (high level) 1. **Choose a base model** * _BYOK:_ point to your provider endpoint (e.g., GPT-class/Claude-class). * _Lucid Cloud / Fluid Nodes:_ pick an open model class (S/M/L) with your target latency/cost profile. 2. **Add intelligence** * _RAG:_ build/update an index; attach namespaces to agents. * _Fine-tune:_ train LoRA/QLoRA adapters on supported open models (no weights exfiltration). 3. **Ship safely** * Run evals → set canary rollout → monitor → promote or rollback in one click. 4. **(Optional) On-chain** * Register ModelMeta for transparent routing/royalties; commit recall CIDs in Thought Epochs for provenance. * No raw data on-chain—only hashes/proofs. *** ### Two Fast Flows #### A) RAG in 3 Minutes Connect sources → Index (hybrid) → Set grounding policy → Attach to agent(s) → Go live (canary 20%). **Good for:** fast, reliable facts that change often (patch notes, docs, inventories). #### B) Fine-tune in an Afternoon Import dataset (JSONL) → Label/curate (style vs. instruction balance) → Train LoRA (cost/time estimator) → Auto-eval → Package adapters → Pin to agents. **Good for:** signature voice, emotion control, tool-use discipline, compact guardrails. *** ### Cost Notes (how billing shows up) * **BYOK:** you pay your vendor for tokens; Lucid bills **platform usage only** (orchestration/RAG/logging). * **Lucid Cloud:** bundled token + platform pricing by model class; no double charge. * **On-chain (optional):** tiny gas handled under the hood via your prepaid reserve (fiat or crypto top-ups). _(See Pricing & Plans for current rate cards.)_ *** ### FAQ (short) **Do I need to create a model to ship an agent?**\ No. Start with a catalog model or “Auto (Router)”, then add RAG/fine-tune later. **Can I run my own models?**\ Yes—host on your cloud or Fluid Nodes; register endpoint in ModelMeta. **Can I keep my fine-tunes private?**\ Yes. Host adapters on your Fluid Node; publish only a commitment hash if you want routing/royalties. **Will RAG slow me down?**\ No—hot lane vector queries target **<100 ms**; Thought Epoch commits happen asynchronously. **Can I run small models on-device?**\ Yes—Studio/SDK support on-device SLMs (2–8B) for instant intent + tool calls; fall back to cloud for heavy generation. *** > **TL;DR** — Use RAG when facts change, fine-tune for personality and control. Pin small locally, burst big when needed. Flip on-chain only where provenance and payouts help. - [On-Chain Options (Opt-In)](/knowledge/lucid-ai/architecture-what-is-lucid-ai/on-chain-options-opt-in): >- # On-Chain Options (Opt-In) ### What you get when you flip it on * **Verifiable actions** – Each important step can leave a tiny, tamper-proof trail (Thought Epochs) you can inspect in **LucidScan**. * **Persistent identity** – Every agent gets a **DID + wallet** (its passport & bank account) for cross-channel continuity. * **Shared memory (optional)** – Read/write to the **Memory Map** so knowledge carries across sessions (under your rules). * **Automatic royalties (optional)** – **Proof-of-Contribution (PoC)** splits fees instantly to data/model/compute contributors. * **Compliance-ready logging** – Small on-chain proofs (never raw data) provide audit trails for GDPR/CCPA and e-discovery. * **On-chain actions & data access** – Agents can **query chain state** and **send transactions** (trading, crafting, payouts, mints) with **no UX friction** for users. > Off by default. Keep everything **off-chain (“Shadow Mode”)** and enable on-chain per **agent**, **environment**, or **event type** when it makes sense. *** ### On-Chain Actions & Chain Data #### What agents can **do** (write/tx) * **Commerce & payouts:** send/receive tokens, stream rewards, escrow tournament prizes. * **Trading & markets:** DEX swaps, listings, bids, analysis. * **Game logic:** craft/mint/burn NFTs, update world/economy contracts, stake/unstake. * **Ops & automation:** schedule jobs, trigger oracles, roll grants & rev-share. #### What agents can **see** (read) * **Player & agent state:** balances, inventories, quest progress (contract state). * **Economy health:** pool prices/liquidity, floor prices, crafting inputs/outputs. * **Provenance:** who contributed what, reuse counts (via LucidScan + Thought Epochs). *** ### Feels “no-friction” to users * **One click** – No Web3 code to handle nor complexes wallet management. Lucid AI manage everything under the Hood. No Web3 knowledge needed! * **Pay Gas in Fiat** – You fund a **Gas Reserve** in **fiat or crypto**; the SDK sponsors gas and handles mGas/iGas under the hood. * **Safety rails** – **Simulate-before-send**, price impact limits, rate-limits, kill-switch, and policy checks (e.g., “only craft under 5 USDC” or “swap < 1% slippage”). * **Clear receipts** – Every tx and proof shows up in **LucidScan**; raw payloads stay off-chain unless you opt-in. *** ### When to turn on-chain * **Esports / real-money** → provenance & dispute-proof payouts. * **Live economies** → NPC vendors, crafting, dynamic pricing, market ops. * **Cross-title continuity** → companions/NPCs that carry progress & inventory. * **Revenue sharing** → automatic, transparent splits to stakeholders. *** ### Presets & controls (you choose) * **Proofs Only** – Log route decisions/PoI; **no shared memory**, **no tx**. * **Memory + Proofs** – Namespaced read/write to the Memory Map. * **Read + Micro-Tx** – Allow small payments/crafts under spend caps. * **Full Actions** – Enable whitelisted contracts/methods with policy & limits. * **Granularity** – Toggle by **agent**, **environment** (dev/stage/prod), **event class** (e.g., “only final answers”), and **namespace**. **Privacy & retention** * **Right-to-Forget:** remove pointers/hashes; raw data remains encrypted off-chain and can be deleted per policy. * **Private namespaces:** keep retrieval private while still logging proofs publicly if desired. *** ### Costs at a glance * **Protocol is free.** You only fund **tiny chain gas** when enabling on-chain features. * **Predictable budgeting:** * **mGas** → memory/routing/proofs (sub-cent per commit in typical setups). * **iGas** → compute-linked proof costs (bundled if you use Lucid Cloud). * **Chain gas** → native network fees for your **actual tx** (sponsored from your reserve). * **Pay in fiat or crypto.** The SDK handles conversion/top-ups; receipts are visible in Studio & LucidScan. *** ### Examples **1) Tournament payout bot (Proofs Only + Tx)** * Logs route & PoI; performs **escrow & split payouts** on-chain. * Players get instant confirmations; finance gets a clean audit. **2) NPC shopkeeper (Read + Micro-Tx)** * Reads pool prices & inventory; **crafts/mints items** under policy caps; posts sales on marketplace. * No pop-ups for players; one-time approval + session key. **3) Cross-game companion (Memory + Proofs + Tx)** * Carries progress between titles; **claims rewards** or **stakes** automatically within limits; everything visible in LucidScan. *** ### FAQ **How do we prevent runaway spend?**\ Policies: simulate-before-send, price-impact/slippage caps, per-period spend limits, contract/method allow-lists, and an emergency kill-switch. **What if a transaction fails?**\ We return the error, re-simulate, optionally auto-retry with safer params; the failed attempt is logged for audit. **Is my data exposed on-chain?**\ No. Only minimal hashes & tx ids are stored; raw data/embeddings stay encrypted off-chain. Private namespaces keep retrieval closed. **Do I need on-chain to use Lucid?**\ No. On-chain is a **feature**, not a requirement. Build in **Shadow Off-Chain**; flip on-chain when you need provenance, economies, or payouts. *** **Bottom line:** When you want agents that can **see** the chain, **act** on the chain, and **prove** what they did—Lucid makes it safe, fast, and invisible to end users. - [Start with a Prompt (one-click)](/knowledge/lucid-ai/architecture-what-is-lucid-ai/start-with-a-prompt-one-click): Type your idea. Watch it come alive. Powered by Synapse. # Start with a Prompt (one-click)
## **What It Is** The fastest way to create an interoperable AI Agent or App — no setup, no config, no code.\ Just describe what you want in natural language, and Lucid AI (our meta-agent) builds a working system that you can **run, edit, and deploy anywhere**. **Example:** > “Create a Discord wellness coach that remembers my mood and rewards me for staying consistent.” → 30 seconds later, you’ve got a live agent—with memory, skills, and integrations—ready to deploy. *** ## **Why It Matters** * **Instant creation** — Go from idea to live agent in under a minute. * **No code required** — Perfect for creators, founders, and non-technical teams. * **Composable foundation** — Extend later in **Synapse Flows** or with **DevKit**. * **Interoperable by design** — Every agent inherits **Passports**, **Portable Memory**, and **Proof compatibility** with the **Lucid Chain**. *** ## **How It Works** * **Type your idea**\ “An AI sommelier that recommends wines and books pairings.” * **Lucid AI interprets it** * Defines purpose, tone, and goals * Chooses optimal model (GPT, Claude, or open-source) * Generates tools, memory schema, and integration logic automatically * **Preview instantly** * Test it live in the browser * Adjust tone, personality, or connected tools * **Deploy anywhere**\ Discord • X • Telegram • Web • Unreal Engine • Mobile * **Optional: make it verifiable**\ Turn on **on-chain proofs** and **payouts** for transparency and rewards *** ### **Under the Hood** Every “Prompt-to-Agent” creation runs through **Lucid AI**, the meta-agent that composes all moving parts.\ It automatically produces: * **Agent Blueprint** — personality, tone, safety guardrails * **Skill Schema** — connected APIs, SDKs, or smart contracts * **Model Routing Config** — cost, latency, and precision policy * **Memory Namespace** — for Portable Memory recall * **Passport (optional)** — for on-chain ID, audit, and payouts All results are **editable** in **Flow Editor** or **Agent Lab**, giving you full creative control.\ By default, everything runs **off-chain** for speed; **proofs, payouts, and auditability** can be enabled anytime. *** #### **Example Prompts** | Use Case | Example Prompt | Deploy Target | | ---------------- | --------------------------------------------------------------------------------------- | ---------------- | | Web3 | “A Solana portfolio agent that tracks wallets, alerts on gains, and posts to Telegram.” | X, Telegram | | Gaming | “A fantasy merchant NPC that remembers your past trades and reacts emotionally.” | Unreal Engine | | Customer Support | “An AI that handles refunds with empathy and tracks satisfaction scores.” | Web + Slack | | Education | “A history tutor that builds memory over multiple sessions.” | Web + Discord | | Health | “A mindfulness coach with on-chain reward tracking.” | Mobile + Discord | *** ## **FAQ** **Q: Can I edit what the AI builds?**\ Yes — everything can be modified in Flow Editor or Agent Lab. **Q: Does it use my own model or Lucid’s?**\ You choose. By default, it picks the best available model for cost/latency. **Q: Can I export it?**\ Yes — you can export the full blueprint (prompt, schema, config) or deploy cross-platform instantly. **Q: Is this private?**\ Yes. Everything is generated in your workspace and encrypted until published. *** **Lucid AI turns a single prompt into a full-stack, verifiable intelligence.**\ Start with words. End with a living Agent connected to models, data, tools, and blockchains — ready to ship in seconds. - [Virtual Humans Extension – Give Your Agent a Face](/knowledge/lucid-ai/architecture-what-is-lucid-ai/virtual-humans-extension-give-your-agent-a-face): >- # Virtual Humans Extension – Give Your Agent a Face Teams everywhere are turning to generative AI to boost productivity, speed content pipelines, and create far more engaging experiences. But building believable digital humans is hard: realistic faces and motion require high-quality capture and animation; natural conversations demand speech, understanding, and emotion; and making it all run in real time is compute-intensive. **Lucid** solves this with a modular stack that turns avatars into **operational AI agents.** ### What are Virtual Humans? **Lifelike digital avatars** for your AI agents, adding a human face to every interaction. Virtual Humans transform faceless chatbots into **relatable characters** that audiences can see, hear, and bond with—across games, socials, XR, and enterprise touch‑points. Ownership can be anchored on-chain (optional). _Faces are the missing piece for widespread AI adoption: they make intelligence feel personal, trustworthy, and memorable._ ### Why Faces Matter Most AI today lacks visual and emotional cues, making interactions feel flat and impersonal. The Virtual Humans Extension changes this by: * **Enhancing User Adoption**: Avatars with natural expressions and movements make AI more approachable, increasing retention in apps like gaming or customer service. * **Creating Immersive Experiences**: Add contextually aware, human-like conversations that adapt to users, supporting roles in healthcare, retail, education, and more. * **Scaling Interactions**: Enable avatars to work across time zones and languages, providing sweet, adaptive support in virtual factories, customer service, or learning environments. * **Enhancing personalization** – avatars mirror each user’s style and context, forging stronger emotional bonds. * **Scales worldwide** – facial cues + live translation let one avatar serve users across time‑zones and **36 languages**. > "People recall **93 % of visual cues** vs 7 % of text." — Stanford HCI Lab, 2024\ > &#xNAN;**+28 % engagement** – pilot NPCs with micro‑expressions kept gamers 2.3× longer." *** ### How It Works Developers choose between **in‑tab WebGPU** rendering, **cloud pixel‑stream** for photoreal quality, or a **Pro Service** for AAA‑grade output. **Key Features**: * **Avatar Generation**: Create photorealistic or stylized 3D faces. * **Natural presence:** Generate natural facial animations, accurate lip sync from audio input, and behaviors like sweet smiles or adaptive gestures. * **Language and Speech Integration**: Support real-time language understanding, translation, and natural responses for multilingual interactions. * **Rendering Technologies**: Simulate realistic appearances, including how light interacts with skin and hair, optimized for real-time performance. Switch between WebGPU (self‑serve) and RTX path‑tracing (cloud cinematic). * **On-Chain Linking (optional)**: Avatars are anchored to the blockchain and possible rewards. * **Privacy and Compliance**: Use zk-proofs to protect user likenesses, with opt-in sharing and verifiable audit trails. **Deploy anywhere:** * **Lucid Cloud** – a global GPU fabric for low-latency streaming. * **Your infrastructure** – run Lucid containers on your own GPU fleet or edge devices. * **Omnichannel outputs** – Create once & deploy everywhere. One identity follows the avatar across Web, Mobile, Unreal/Unity, Discord/Telegram/X, VR/AR, kiosks. #### Benefits for Users and Models * **For Users**: Make your AI agents more immersive and human-like, boosting adoption in personal or social apps with natural, adaptive interactions. * **For Creators**: Design and monetize avatars for roles like healthcare concierges or retail assistants, earning $LUCID royalties in the ecosystem. * **For Models**: Add visual and emotional layers to inferences (e.g., GPT with realistic lip sync), improving engagement without extra coding. * **For Developers**: Integrate avatars into dApps / games (e.g., next-generation games or virtual presence) via APIs, creating dynamic narratives and workflows. * **For Businesses**: Deploy branded digital staff, GDPR‑compliant, multi‑language. #### Built for Real Workflows | Scenario | Player / Viewer Experience | Channels | | ------------------------ | ---------------------------------------------------- | ------------------------------ | | **Virtual Idol** | 24 / 7 concerts, merch drops, live fan Q\&A | Twitch, TikTok, in‑game stage | | **Streaming Co‑Host** | Banters with chat, fills dead‑air, boosts watch‑time | OBS / YouTube Live overlay | | **Coach** | Real‑time whisper tips: “Parry _now!_” | Mobile companion, esports HUD | | **Companion / NPC** | Learns tactics, remembers grudges across sessions | Unreal Engine | | **Retail Kiosk Greeter** | Welcomes shoppers, answers questions, drives upsell | Touch‑screen kiosk, XR glasses | | **Smart Concierge** | Multilingual hotel check‑in & booking | Lobby to mobile hand‑off | #### Lucid Blueprints (accelerators) Start fast with opinionated templates you can customize: * **Concierge Blueprint** – retail/hospitality assistant with inventory/tools integration. * **Service Rep Blueprint** – CRM-aware, policy-safe customer support. * **Coach/Tutor Blueprint** – lesson plans, assessment tools, and memory. * **NPC Blueprint** – game-ready behaviors, emotions, and event hooks. Each blueprint includes SDKs/APIs, reference assets, and deployment scripts; swap in your own models, brand voice, and avatar. #### Getting Started With Digital Humans Using Generative AI * Try it in your browser (no code) * **Open Lucid Studio** → spawn a sample agent with a face and voice. * Pick a template (concierge, tutor, NPC), choose a voice, and connect a channel (Web, Discord, Unreal). * (Optional) **Enable on-chain mode** to anchor provenance and rewards. * Build with the SDK/APIs (code) * **Get an API key** and pull our quickstart from the docs. * Swap in your own models or providers; Lucid routes to the best option under your budget/SLO. * Run anywhere: * **Lucid Cloud** (global GPU fabric, low-latency regions). * **Your cloud** (AWS/GCP/Azure) or **private cloud/on-prem**. * Need an end-to-end solution? Work with **Lucid Solutions** or a **certified integration partner** for full builds—design, avatar production, game engine integration, compliance hardening, and go-live. > Contact us to be matched with a partner or to scope a fixed-price pilot. *** ### Technical Stack Snapshot | Layer | Key Tech | Highlights | | ------------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------- | | **Motion & Face Capture** | Markerless webcam/phone capture; pro rigs via standard streams | 30–60 fps on commodity devices; higher with pro rigs. | | **Speech & Emotion** | Neural TTS with viseme alignment; affect detection | Smooth lip-sync and expressive delivery; low latency on cloud GPUs. | | **Conversation Engine** | Cloud inference by default; optional on-device small LLM where hardware allows | No vendor lock-in; choose the model that fits cost/quality. | | **Long‑Term Memory** | Memory Map (user-controlled) | Personalized continuity across channels. | | **Portability Glue** | Wallet DID + SDK bridges | One identity across web → game → XR. | | Ultra‑Real Forge | WebGPU (browser); native/engine pipelines for games/XR | Optimized real-time in browser; AAA via native/engine or cloud render. | _Performance varies by device, network, and model. “On-device” features are optional and hardware-dependent._ *** ### Professional Render Paths | Track | Best for | Render Path | | ------------------- | -------------------- | ---------------------- | | **Self‑Serve** | Indies, prototypes | In‑tab WebGPU | | **Cloud Cinematic** | AAA launches, events | Pixel‑stream UE5 / RTX | **Need film‑grade avatars?** Pick _Pro Service_—Lucid’s art team delivers mocap‑ready assets and deploy scripts. ### Security & Privacy * **Your choice:** off-chain by default; **on-chain proofs optional** per workspace/pipeline. * **Minimal exposure:** commit hashes/proofs, not raw media or PII. * **User control:** consented sharing; right-to-forget respected at the pointer layer. * **Provenance:** signed assets and session hashes deter deepfakes; LucidScan can display provenance where enabled. ### Build Paths * **Lucid Studio (no-code):** templates, voice presets, style packs; deploy with a wizard. * **SDK/APIs (code):** bring your renderer/engine; wire capture, TTS, and memory calls programmatically. ### FAQ **Is on-chain required?**\ No. Many teams run fully off-chain. On-chain anchoring is an opt-in for provenance, rewards, and compliance audits. **Will it run in the browser?**\ Yes—there’s a WebGPU path for browsers and native/engine paths for games and XR. **What latency should we plan for?**\ Plan **\~120–200 ms** cloud-backed for speech + avatar; lower with regional GPUs and shorter replies. **How is user data handled?**\ User-approved memory only. Raw media remains off-chain; you can disable on-chain proofs anytime. *** **Build lifelike agents your users trust—without locking into a single provider.**\ Start with a blueprint, or talk to us about a custom deployment on your infrastructure. - [Who It’s For & Top Use Cases](/knowledge/lucid-ai/architecture-what-is-lucid-ai/who-its-for-and-top-use-cases): >- # Who It’s For & Top Use Cases ## Lucid AI — Who It’s For **Lucid Studio** is for _everyone_ — from solo creators to enterprise teams — who want to build believable, intelligent AI agents and apps **without code** and **without vendor lock-in.**\ Design, test, and deploy in minutes using **500+ Web2 & Web3 integrations**, and connect to any model, data, or compute through the **Lucid Chain.**\ On-chain identity, memory, and rewards are optional — but always just one click away. *** ### Game Studios **Ship:** conversational NPCs, squadmates, adaptive bosses, quest/design assistants.\ **Why Lucid:** sub-100 ms hybrid pipelines, RAG over your lore/telemetry, optional on-chain memory or provenance for esports and UGC.\ **Outcome:** faster prototyping (days not weeks), measurable session-time lift, cents-per-player-hour at scale. *** ### Community & Social Teams **Ship:** Discord/X community hosts, campaign bots, safe tool-calling for drops.\ **Why Lucid:** multi-channel spawn, brand tone control, optional virtual human faces for engagement.\ **Outcome:** higher reply quality and CSAT, automated moderation/FAQ, transparent reward sharing if on-chain. *** ### Customer Support & CX **Ship:** grounded helpdesk concierges, warranty/returns assistants, kiosk greeters.\ **Why Lucid:** RAG over your docs, guardrails, optional audit trail.\ **Outcome:** deflect repetitive tickets, consistent answers, verifiable hand-offs. *** ### Creators, VTubers & Brands **Ship:** always-on co-hosts, mascots, shoppable livestream assistants.\ **Why Lucid:** Virtual Humans extension (stylized or realistic), rights & payouts anchored to your agent’s ID.\ **Outcome:** longer watch time, higher merch conversion; own your likeness with auto-split royalties. *** ### Web3 Projects & DAOs **Ship:** treasury/ops agents, governance concierges, game/world NPCs as on-chain citizens.\ **Why Lucid:** agent DID + wallet, Memory Map for shared knowledge, Thought Epochs for verifiable actions.\ **Outcome:** provable ops, community-owned data, automatic fee splits (PoC/PoI). *** ### Crypto & Trading Desks **Ship:** trading copilots, DeFi dashboard agents, research or portfolio managers.\ **Why Lucid:** real-time data from DEXs and CEXs, programmable strategies, and on-chain execution via safe policies.\ **Outcome:** transparent, automated trading with verifiable receipts and gas-sponsored execution; no scripting required. *** ### Education & Training **Ship:** tutors, lab assistants, role-play coaches.\ **Why Lucid:** RAG from curricula, multi-language TTS/ASR, optional provenance for assessments.\ **Outcome:** personalized practice at low cost; verifiable audit trails when needed. *** ### Enterprise & Public Sector **Ship:** compliant concierges, field support agents, public-info kiosks.\ **Why Lucid:** privacy-first (off-chain data, on-chain hashes), opt-in proofs, Solana-grade throughput for audits.\ **Outcome:** faster service with provable compliance and minimal risk exposure. *** ### Quick Selector (Goal → What to Enable) | Goal | What to Enable | | --------------------------------------- | ---------------------------------------------------------------- | | **Believable characters in a 3D world** | UE5 plugin + Virtual Humans; optional on-device SLM for latency. | | **Grounded, policy-safe answers** | RAG over your docs/DB; guardrail schemas. | | **Cross-app identity & memory** | Turn on-chain options (Agent DID + Memory Wallet). | | **Cost control at scale** | Pin your model or use Router-Auto; pay fiat, SDK handles gas. | | **Royalties & provenance** | Enable Thought Epochs + PoC; view in LucidScan. | *** **No-code by design.**\ Use Lucid Studio to **build, deploy, and monetize AI agents or apps in minutes** — all without touching code, managing infra, or understanding Web3.\ Enable on-chain only when you want identity, provenance, or automatic payouts.\ Keep it off for closed or local projects. - [Community & Open Source](/knowledge/lucid-ai/community-and-open-source): Build in the open. Keep ownership. Grow the ecosystem together. # Community & Open Source ## Why Open Lucid is **open where interoperability and trust matter**, and **managed where reliability and scale matter**.\ Our stack blends open-source transparency with enterprise-grade orchestration — open for innovation, managed for production. **Open where it builds trust. Managed where it guarantees outcomes.** *** ### What’s Open vs. Managed #### **🧩 Open Core (Apache-2.0)** Lucid’s foundation is open and composable — designed so anyone can build, self-host, or extend. * **Agent Runtime (LAR)** – lightweight runtime powering every agent in Lucid Synapse * **SDKs & Connectors** – JS/TS, Python, C/C++, UE5, Discord, X, Telegram, Web, and mobile adapters * **Schemas & Specs** – Passports, AgentMeta, ModelMeta, Memory Map, Thought Epoch formats * **Lucid Chain Programs & ZK Circuits** – verifiable proofs for inference, contribution, and memory * **Reference Projects** – sample agents, UGC templates, games, bots, and deployment blueprints You can run the full Lucid AI stack yourself with **LAR + SDKs** — no lock-in, no mandatory cloud. *** #### **☁️ Managed / Source-Available (BUSL-1.1)** Lucid operates managed services for teams who want performance, reliability, and enterprise SLAs. * **Synapse™ (Cloud)** – visual OS for building AI Agents & Apps (prompt + flows) * **Model Lab Pro** – managed fine-tuning, RAG indices, dataset tools, LoRA/QLoRA, and eval dashboards * **Virtual Humans Pro** – rendering, safety filters, and multilingual voice packs * **TrustGate™** – managed inference layer across DePIN + Cloud with attestation, SLOs, insurance * **Lucid Cloud** – bundled routing, compute, and observability for production workloads → Protocol access is **never gated**.\ You can start local and connect to Lucid Cloud or TrustGate anytime. *** ### How You Can Contribute #### **1️⃣ Pick a lane** | Area | Focus | | ----------------------- | -------------------------------------------------------------- | | **Runtime & Core** | scheduler, streaming, skill safety, deterministic flows | | **Connectors** | Slack, Discord, Unreal, kiosk, mobile shells, on-chain bridges | | **Retrieval / Memory** | embeddings, hybrid search, eval datasets | | **Proofs & Chain** | PoI / PoM / PoC, ZK circuits, audit tools | | **Docs & Localization** | tutorials, multi-language docs, UX playbooks | *** #### **2️⃣ Find an issue** * GitHub labels: `good-first-issue`, `help-wanted`, `connector-idea`, `perf` * Join monthly Working Groups: **Runtime • Connectors • Retrieval • Proofs • Docs** * **Discuss first** → short proposal in GitHub or Discord * **Tests + CI** → include sample config & trace; all tests must pass * **Code style** → Prettier/ESLint (JS), Black/mypy (Py), clang-format (C++) Security issues → email `security@lucid.foundation` *** #### **3️⃣ Submit** * Open a PR with tests and a short design note * Bigger ideas → propose a **LIP (Lucid Improvement Proposal)** *** ### Contributor Rewards | Type | Reward | | -------------------- | ----------------------------------------------------------------------------- | | **Grants & Credits** | Indie Spark (up to $5k), Open-Source Fellowship (up to $10k), Synapse credits | | **Bounties** | Fixed rewards in USDC / LUCID / credits | | **Recognition** | Docs Hall-of-Fame, co-author blog posts | | **Fast-Track** | Maintainers can nominate contributors for repo write access | *** ### Code of Conduct (Short) Be kind. No harassment or spam. Respect privacy and licenses.\ Disclose conflicts. Violations may result in removal of community privileges.\ We’re here to build the Internet of AI — together. *** ### Coding & Schema Guidelines * **Determinism** → All agents/models reproducible via pinned AgentMeta/ModelMeta. * **Tool Safety** → Strict JSON schemas; no arbitrary code eval. * **Privacy-first** → No raw prompts/files/embeddings on-chain. * **Performance** → sub-100 ms intent/tool latency; streaming always. * **Observability** → OpenTelemetry traces for every run. *** **Build once. Run anywhere. Opt into the chain when it makes sense.**\ Questions? → Join our Discord community and say hi 👋 - [Connectors — Expand the Internet of AI](/knowledge/lucid-ai/community-and-open-source/connectors-expand-the-internet-of-ai): The pipes of the Internet of AI — build once, run everywhere. # Connectors — Expand the Internet of AI Connectors are how Lucid grows. They turn any API, chain, or app into a **skill** your agents can use inside Synapse or LAR.\ They use the same open **ToolSpec** schema — so every integration (Discord, Solana, Shopify, io.net, Unreal) works everywhere instantly. **You can:** * Build open connectors and publish them to the **Lucid Hub** * Keep private connectors for internal use (Cloud / VPC) * Earn **Proof-of-Contribution** rewards when your connector is reused *** ### What Connectors Do * **Expose skills to Synapse** → “Send message,” “Create trade,” “Query dataset,” “Mint NFT.” * **Run safely in LAR** → sandboxed, typed, and monitored. * **Work across surfaces** → Discord, Unreal, Slack, Telegram, Web, or on-chain. * **Support Web2 & Web3** → REST APIs, GraphQL, gRPC, EVM/RPC, Solana JSON, or file systems. * **Use open schemas** → all connectors use the same function-call format (AgentMeta & ToolSpec). Each connector can be visualized as a node in **Lucid Synapse**, or imported programmatically in **LAR**. *** ### Connector Anatomy (at a glance) A connector = 1. **Manifest (YAML/JSON)** – name, version, schema, auth type, categories. 2. **Handler** – the actual code (JS/TS, Python, C++) that executes the API call or contract interaction. 3. **Validation** – strict JSON schema to coerce safe arguments from LLMs. 4. **Registry entry** – optional metadata to publish on the **Lucid Hub** (the open connector marketplace). ```yaml name: discord.sendMessage category: social auth: oauth2 inputs: - channel_id: string - message: string outputs: - status: success|error safety: rate_limit: 10/min allowed_channels: ["#general"] ``` *** ### How Connectors Work in the Stack | Layer | Role | | ------------------------ | ------------------------------------------------------------------------------- | | **Synapse** | Visual flow builder — users drag & connect skills. | | **LAR Runtime (open)** | Executes connector safely via sandboxed runtime. | | **TrustGate (optional)** | Adds attestation, SLAs, and proofs for enterprise connectors. | | **Lucid Chain** | Anchors receipts, attribution, and Proof-of-Contribution for public connectors. | *** ### Examples of Connector Types | Category | Examples | | ------------------ | ----------------------------------------------------------- | | **Social & Chat** | Discord, Telegram, Slack, X (Twitter), WhatsApp | | **Web2 SaaS** | Notion, GDrive, Shopify, Airtable, HubSpot, Salesforce | | **AI Models** | OpenAI, Claude, Llama, Together, Mistral | | **Web3 & DePIN** | Solana RPC, Ethereum JSON-RPC, Aethir GPU, Filecoin, Helium | | **Data & Storage** | IPFS, Arweave, Supabase, Snowflake, Postgres, BigQuery | | **Compute & Edge** | io.net, Akash, Aethir, Render, Raspberry Pi | | **Games & 3D** | Unreal, Unity, Godot, OBS, Streamlabs | *** ### Build a Connector (Step-by-Step) 1. **Fork the repo** → `lucid-connectors` (template provided) 2. **Pick a category** → Social, Data, Web3, Tools, Compute 3. **Write your manifest** → name, schema, safety policies 4. **Implement your handler** → use the SDK in JS/Python/C++ 5. **Test locally** → `lar run agent.yaml --trace` 6. **Publish (optional)** → open a PR to add it to the **Lucid Hub registry** You can also register private connectors for internal use (teams, enterprise). *** ### Security & Safety * **Strict schemas** → all arguments validated before execution * **No arbitrary eval** → connector code runs sandboxed * **Rate limits** → per-tool, per-agent * **Scoped keys** → connectors store OAuth/API keys securely per environment * **Audit-ready** → every call can emit a verifiable Thought Epoch (optional) *** ### Contribute or Partner Lucid actively supports connector builders and ecosystem partners. * **Community builders** → add integrations for open APIs or protocols * **Enterprises** → create private connectors for your own tools (CRM, trading, DePIN infra) * **Devs** → propose a Lucid Improvement Proposal (LIP) for new connector standards *** ### Rewards & Ecosystem Credits * Grants up to **$5,000 USD** for verified new connectors * **Listing on Lucid Hub** → attribution, usage metrics, and optional royalties * **Proof-of-Contribution (PoC)** rewards → automatic payouts when your connector is reused * Monthly **“Connector of the Month”** highlight on the community page *** ### Where to Start * Docs → `docs/connectors/getting-started.md` * Templates → `/examples/connectors/` * Registry → hub.lucid.ai _(coming soon)_ * Discord → `#build-connectors` *** Connectors are the **open skills** that make AI composable.\ Build one → it runs everywhere — Synapse, LAR, TrustGate.\ Contribute now and earn credits, visibility, and Proof-of-Contribution rewards. **The more connectors you build, the smarter the Internet of AI becomes.** 🌐 - [Open Core - Agent Runtime (AR)](/knowledge/lucid-ai/community-and-open-source/open-core-agent-runtime-ar): >- # Open Core - Agent Runtime (AR) ### What is AR? The open runtime powering [Synapse](/knowledge/lucid-ai/architecture-what-is-lucid-ai/build-with-synapse-visual-builder) **AR** is the **headless, open-source engine** that powers every agent, app, and AI flow in Synapse.\ It connects your **models**, **memory**, **tools**, and **telemetry** into one portable runtime you can embed anywhere — from backend servers to UE5 games. Built for developers, trusted by enterprises, and ready for verifiable AI. * **Open & portable** — Apache-2.0 core you can self-host, fork, or embed. * **Privacy-first** — Shadow Mode by default; no blockchain writes unless enabled. * **Composable** — Works with your own APIs, open models, or Lucid Cloud routing. * **Verifiable (optional)** — Turn on proofs and portable memory when you need transparency or revenue sharing. * **Extensible** — Supports **Connectors** built by the community to link any API, app, or chain. * **No lock-in** — Pin specific models for determinism, or let the router optimize automatically. **AR = Engine. Synapse = UI.**\ Community edition is open; Cloud and Enterprise editions are managed and attested. *** ### Why Developers Choose AR | Capability | Description | | ------------------- | ----------------------------------------------------------------------------------------- | | **Runs anywhere** | Local dev, your cloud/VPC, consoles, games, or Lucid Cloud. | | **Model freedom** | Bring your own API keys or route through Lucid Engine (GPT, Claude, Llama, open markets). | | **Memory your way** | Local quick-start or shared, rewardable memory via Memory Map. | | **Safe tools** | Strict schemas and sandboxed calls for actions, workflows, or gameplay. | | **Observability** | Structured traces, metrics, and (optional) Thought Epochs for audit. | | **Composable** | Pairs with Cognition Router, Dual-Gas, LucidScan, and Fluid Compute. | *** ### What LAR Handles * Conversation orchestration — stateful, streaming, multi-turn. * Retrieval & memory — local or cross-app via Memory Map. * Tool/function calling — type-safe I/O, retries, guardrails. * Routing & budgets — deterministic pinning or Router-Auto mode. * Telemetry & proofs — live tracing, optional verifiable receipts. * **Connectors** — plug-and-play bridges for APIs, chains, and tools. *** ### How It Fits in Lucid | Layer | Role | | --------------- | ------------------------------------------------------ | | **LAR** | The open runtime that executes agents and flows. | | **Synapse** | No-code/low-code builder built on LAR. | | **TrustGate** | Managed inference with attestation, SLOs, and credits. | | **Lucid Chain** | Anchors proofs, memory roots, and payouts. | You can run **AR alone**, or with Synapse for UI workflows.\ Everything is modular: start open-source, scale to managed when ready. *** ### Security & Privacy Defaults * **Shadow Mode** — fully off-chain by default. * **Minimal on-chain footprint** — only hashes/pointers; never raw data or media. * **Your keys, your rules** — bring your own model keys or use Lucid Cloud isolation. * **Deterministic builds** — pin model, provider, and index versions. *** ### Get Involved * **Start building** → grab starter templates and run locally. * **Contribute** → issues, PRs, connectors, or docs. * **Propose** → submit a **LIP (Lucid Improvement Proposal)** for runtime features. * **Apply for grants** → Indie Spark, Open-Source Fellowship, or Synapse Launch Credits. **Build once. Run anywhere. Opt-in to on-chain when it makes sense.**\ That’s AR. - [SDKs](/knowledge/lucid-ai/community-and-open-source/sdks): One API surface across web, game engines, servers, and the cloud. # SDKs SDKs give developers a consistent, type-safe interface to build AI agents and apps that run anywhere — local, cloud, or hybrid — using the **Agent Runtime (AR)** or **Synapse Cloud**. All SDKs share the same schemas and protocols: **AgentMeta**, **ModelMeta**, **Passports**, **Memory Map**, and **Thought Epochs**. ### Languages & Surfaces | SDK | Ideal For | | -------------------- | --------------------------------------------- | | **JS / TS SDK** | web apps, Next.js backends, bots, agents | | **Python SDK** | data pipelines, RAG workflows, research tools | | **C++ / UE5 Plugin** | games, real-time 3D, embedded systems | *** ### What SDKs Do * **Agent Interface** → define & run agents; set persona, skills, and channels. * **Model Control** → pin a specific model or use Router-Auto. * **Retrieval (RAG)** → connect to Memory Map or private datasets. * **Compute Routing** → choose BYOK, Lucid Cloud, or TrustGate per call. * **Connector Toolkit** → build & test new connectors directly in SDK; deploy to Synapse or LAR. * **Observability** → latency, traces, token accounting, OpenTelemetry hooks. * **Auth** → dev keys, wallets, or Synapse Cloud tokens. *** ### Common Concepts | Schema | Purpose | | ------------------ | ---------------------------------------------------------------- | | **AgentMeta** | Persona, skills, bindings, and on-chain mode (off/lite/full). | | **ModelMeta** | Provider info, adapters, price/latency profile, retrieval setup. | | **Memory Map** | Portable, encrypted context for multi-agent recall. | | **Thought Epochs** | Cryptographic proof of what ran and where (optional). | *** ### Integration Patterns | Mode | Description | | ---------------------- | ------------------------------------------------------------------------ | | **Drop-in Connectors** | Ready integrations for Discord, X, Telegram, Web, Unreal. | | **Headless** | Use the SDK directly from your code; store memory locally or externally. | | **Hybrid** | Local connector for fast intent/tools + Cloud for heavy reasoning. | *** ### Config & Environments * **Per-environment configs** for models, memory, and safety. * **Budget caps & alerts** via Synapse Cloud. * **Deterministic builds** using pinned ModelMeta and RAG index versions. *** ### Security & Privacy * Client-side encryption for unpublished prompts or weights. * Hash-only commits on-chain (never raw data). * Access control lists per namespace. * Audit hooks for regulated environments. *** ### Versioning & Compatibility * Semantic versioning across SDKs and AR. * Backward-compatible within each major release. * Compatibility matrix maintained in repo (SDK ↔ AR ↔ Synapse ↔ Chain). *** Build in your favorite language with open SDKs.\ Run locally with AR or scale instantly via Synapse Cloud.\ Keep everything off-chain — until you want provenance, memory, or payouts. **Lucid SDKs → One API for the Internet of AI.** 🌐 - [DevKit - Run Anywhere (SDKs & Connectors)](/knowledge/lucid-ai/devkit-run-anywhere-sdks-and-connectors): Build and integrate anywhere # DevKit - Run Anywhere (SDKs & Connectors) #### For developers, studios, and open-source builders Lucid’s developer stack has two sides of the same Layer: * **Agent Runtime (LAR)** — the open-source engine that runs any agent or app locally, on your server, or inside game engines. * **SDKs** — lightweight bindings (JS/TS, Python, C++, UE5, etc.) that connect to LAR or to **Lucid Synapse Cloud**, using the same open schemas. You can start 100% off-chain, then flip on verifiable memory, receipts, and payouts later — **no rewrites.** *** #### How LAR & SDKs Interoperate **SDKs** are your developer surface — you define agents, models, tools, channels, and retrieval logic.\ **LAR** is the execution layer — it streams tokens, manages retries/fallbacks, executes skills, and (if enabled) emits **Thought Epochs** & **Recall CIDs** asynchronously.\ Both speak the same open schema → switching between Local and **Lucid Synapse Cloud** takes one line. Coming Soon - [FAQ (Non-Technical)](/knowledge/lucid-ai/faq-non-technical): >- # FAQ (Non-Technical) ### Basics & System Overview **What is Lucid AI, in one sentence?**\ A no-code workspace to create AI agents (and optional virtual humans), connect them to your apps and channels, and—if you want—give them on-chain identity, memory, and payouts. **Do I need to code?**\ No. Most teams ship with templates and a drag-and-drop flow. Engineers can extend anything with our SDKs later. **What is Synapse?**\ Synapse is the OS layer that powers Lucid AI. It’s a visual, AI-assisted workspace where anyone can **compose agents, models, and connectors**—no code needed.\ You build in Synapse, and everything runs through [**Engine** ](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine)(for routing & compute) and [**Data** ](/knowledge/lucid-ai/faq-non-technical#data-privacy-and-ownership)(for identity & memory). **Does Lucid replace ChatGPT/Gemini?**\ No. We work _with_ them. You can use your own model keys (OpenAI/Anthropic/etc.) or use Lucid Cloud hosting for open models. Lucid handles memory, routing (optional), logging, and deployment. **What’s the difference between Lucid AI and Lucid Chain?** * **Lucid AI (SaaS):** the creation & orchestration tool (plans + usage). * **Lucid Chain (protocol):** the optional on-chain layer for identity, memory, proofs, and rewards. The protocol is open and free; you only fund tiny gas when you enable it. **Am I locked into Lucid (vendor lock-in)?**\ No. Lucid is open where it matters: SDKs/schemas are open, agents/models export as prompts + weights + config, and you can **BYOK** (your own model/API keys) or run the open headless runner. Switch models at any time, keep everything off-chain (“Shadow Mode”), or self-host the open components. On-chain identity/memory use open programs—no proprietary formats. *** ### Models & Agents **What about integrations?**\ Lucid includes 500+ pre-built **Connectors** for Web2 & Web3 apps—Discord, Notion, Telegram, Shopify, Solana, and more.\ You can drag-and-drop them into Synapse flows, or build your own connector with the open SDK. Connectors make your agents interoperable across apps, models, compute, and chains. **Do I have to train a model to launch an agent?**\ No. Pick a model from the catalog (or “Auto”), ship your agent, and swap models later without breaking channels. **Can I fine-tune or use my own data (RAG)?**\ Yes. The **Model Lab** lets you fine-tune supported open models and/or add RAG over your docs, lore, or knowledge bases. **What channels can agents run on?**\ Discord, X/Twitter, Telegram, web widgets, Unreal Engine (NPCs), and more. One agent identity can live on multiple channels at once. **Do you support virtual humans (faces/voices)?**\ Yes. The **Virtual Humans** extension adds expressive avatars and voices. Use lightweight browser avatars, or ask our Pro team for cinematic-quality characters. *** ### On-Chain (Optional) **Do I have to use crypto or wallets?**\ No. You can pay in **fiat**. If you enable on-chain features, Lucid handles gas under the hood. **Will on-chain slow things down?**\ No. Replies stream in real time. On-chain commits and payouts are settled **asynchronously** in the background. **Which chains are supported?**\ Solana (primary) and an **Ethereum L2 (beta)** for identity/wallet anchoring. **If I keep using the ChatGPT (or Gemini) UI, what changes?**\ You can mirror those chats into Lucid via our extension to earn rewards and keep verifiable memory. No routing happens in that UI; only **Thought Epoch** commits and **LucidScan** indexing (if you opt in). **Can we pay in fiat?**\ Yes. Pay by card or invoice (USD/EUR/GBP). The SDK auto-converts to $LUCID/mGas/iGas under the hood when on-chain is enabled. You get clean receipts with compute-equivalents (tokens, minutes, frames), monthly caps, and cost-center tags. Crypto (SOL/USDC) is also supported. *** ### Data, Privacy & Ownership **Who owns the data and prompts?**\ You do. By default your content stays off-chain and encrypted. The chain only stores tiny hashes/pointers and usage proofs. **Is my data public if I “stake” it?**\ Not unless you choose. You can keep it **encrypted & gated**, license it, or run “bring-the-model-to-the-data” so raw content never leaves your vault. **Can I delete data or turn off on-chain later?**\ Yes. You can withdraw pointers, stop sharing, or keep everything off-chain (“Shadow Mode”) at any time. *** ### Pricing, Billing & “No Double Charge” **How do I pay?**\ Two parts: a **AI plan** (seats & features) + **usage** (tokens / audio minutes / vision frames). Pay in fiat or crypto. **What if I use my own OpenAI/Anthropic key?** * **BYOK:** you pay that vendor for tokens; Lucid bills a small platform fee for orchestration/RAG/logging. * **Lucid Cloud:** one bundled rate covers both model tokens _and_ Lucid’s platform fee. No double-charging. **Is the protocol ever paywalled?**\ No. Lucid Chain is free. If you enable on-chain, you just fund small gas; the SDK handles it automatically. **Do you offer grants/credits?**\ Yes—indie, studio launch, open-source, and education credits. (See “Pricing & Plans”.) *** ### Performance & Reliability **How fast is it?**\ Designed for **sub-100 ms** responses with local/hybrid setups; cloud-only speed depends on the model/provider. On-chain commits don’t block the user experience. **What happens if a model is slow or down?**\ You can pin a model for determinism or use **Auto (Router)** to fail over to a faster/cheaper one. Rollback and canary are built in. **Can we host in our own cloud or data center?**\ Yes. Use our SDKs with your infrastructure, or choose **Enterprise** for VPC/on-prem options. **Can we extend Lucid with new integrations or connectors?**\ Yes. Lucid’s **Connector SDK** lets you build custom integrations—APIs, chains, or proprietary tools—and plug them into Synapse or LAR.\ All connectors follow a shared schema and are sandboxed for safety. *** ### Rewards & Monetization (Optional) **How do rewards work?**\ If you enable them, your datasets/models/agents can earn **$LUCID** via **Proof-of-Contribution** when reused by others. Everything is transparent in **LucidScan**. **Can we set rev-shares for teams or creators?**\ Yes. Splits are programmable; payouts are automatic when events settle. **Can I earn from connectors or open models I publish?**\ Yes. Every published connector, model, or dataset can earn automatic **Proof-of-Contribution (PoC)** rewards when others reuse it.\ Royalties flow transparently through LucidScan; nothing to manage manually. *** ### Getting Started **Fastest path to a first agent?**\ Pick a template, choose a model (or Auto), connect a channel, and deploy. You can add RAG, avatars, and on-chain later. **Do you have support for non-technical teams?**\ Yes—Starter includes community support; higher plans include priority support and optional hands-on integration services. **Are the tools open source?**\ The **protocol, SDKs, schemas, and headless runtime are open**; **Studio/Cloud** are commercial (source-available for Enterprise). This keeps trust high and the service dependable. *** If you only remember three things: 1. **You don’t need to code** to launch a great agent. 2. **On-chain is optional** and never slows replies. 3. **No double charge**—use your own model keys or choose Lucid Cloud bundles. - [Licensing & Editions](/knowledge/lucid-ai/licensing-and-editions): >- # Licensing & Editions ### What’s Open (Apache-2.0) * **Lucid Agent Runtime:** Daemon/CLI for local or self-hosted agents (no Studio required). * **SDKs & Connectors:** JS/TS, Python, C/C++, **Unreal Engine 5 plug-ins**, Discord/X/Telegram/web adapters, CLI. * **Lucid Studio Community:** Self-hosted UI that sits on top of the OSS Agent Runtime. * **Specs & Schemas:** `AgentMeta`, `ModelMeta`, **Memory Map**, **Thought Epoch** events, DID/identity format. ### What’s Commercial / Source-Available (BUSL-1.1) * **Lucid Studio Cloud (SaaS):** * **Agent Lab:** No-code agent creation, multi-channel deploy, team workflows, canary/rollback, eval dashboards. * **Model Lab:** Managed RAG indexing, dataset tools, LoRA/QLoRA jobs, evaluation at scale. * **Virtual Humans:** Advanced rendering/safety, voice packs, enterprise pipelines. * **Lucid Cloud (managed):** Routing, autoscaling, budget/SLO governance, deep observability; multi-region low-latency. * **Enterprise Add-ons:** SSO/SAML, SOC 2 reports (where available), VPC/self-host, private tenancy, priority support. * **Lucid TrustGate™** – managed API that orchestrates DePINs & Cloud > **Licenses:** Open components under **Apache-2.0**. Commercial components under **BUSL-1.1** (source-available) with commercial terms for Enterprise/VPC. ### Editions * **Community (Free):** Open SDKs + headless runner; **bring your own models**; optional on-chain. * **Studio Cloud (SaaS):** Full Studio UX, Model Lab Pro, Lucid Cloud usage billing; **pay in fiat or crypto**; optional on-chain. * **Enterprise (VPC/Self-host):** Private deployment of Studio/Cloud components, SSO/SOC2, SLAs, custom contracts. See **Pricing & Plans** for seat tiers and usage rates. ### Portability & “No Lock-In” Pledge * **1-click export** of agents (prompts, skills), **ModelMeta** (versioned adapters), **RAG indexes**, avatars, and deployment manifests. * **BYO keys/endpoints** for closed models (e.g., OpenAI/Anthropic) or run on **your** Fluid Nodes/cloud. * **Open identities:** Agent DID + on-chain pointers follow the same open spec. * Convenience lock-in only: everything critical is exportable as files or Docker manifests. ### Marketplace & Grants * **Studio Marketplace:** agent templates, model cards, RAG data packs, avatar packs.\ Default rev-share (example): **85% creator / 15% platform**. * **Ecosystem Grants:** periodic grants/bounties for new connectors, safety packs, and open evaluators. Details announced in **LIPs**. ### Telemetry & Privacy * **Opt-in telemetry** only; project-level toggles; PII scrubbing by default. * Raw media/embeddings **never** on-chain; on-chain stores **hashes & proofs only**. * Security disclosures: **security@…** (PGP key available); coordinated disclosure honored. ### Deprecation & Versioning * **Semantic Versioning** for SDKs/specs. * **12-month deprecation window** for breaking changes to open APIs/schemas (unless critical security fix). * Studio/Cloud provide **compat layers** for at least one minor cycle. ### Self-Hosting & Forks * You **may self-host** open components (Apache-2.0). * **Studio Cloud** require a commercial license (BUSL-1.1). * Trademarks (“Lucid”, “Lucid Studio”, “LucidScan” etc.) **may not** be used to market forks. ### Why Open-Core? * **Adoption & trust:** Open SDKs/specs make audits and integrations easy. * **Ecosystem growth:** Community connectors and agents compound network effects. * **Sustainability:** Managed services fund R\&D, security, and grants. ### Legal Links * Apache-2.0 license (open components) * BUSL-1.1 & Commercial Terms (Studio/Cloud) * Trademark policy - [Lucid × Solana Mobile](/knowledge/lucid-ai/lucid-solana-mobile): The Internet of AI in your pocket. # Lucid × Solana Mobile ### Why mobile matters Web4 needs AI that is **always-on, personal, and verifiable**—not stuck in a desktop tab. Phones are where identity, payments, sensors, and daily habits live. Solana’s mobile stack gives us secure keys, a great dApp store path, and low-friction crypto UX—all the right rails for **AI agents that act for you** and **prove what they did**. _AI to operate. Chain to remember, verify, and pay. Apps on top._ Our mobile plan puts that stack in every pocket. ### The vision * **Your life, one continuous conversation:** Every AI you use (games, entertainment, shopping, support) plugs into the same memory and identity—right on your phone. One Passport, one memory—every AI you meet (games, entertainment, shopping, support) acts as one **unified brain** across your life. * **Your AI, on your phone:** Chat, voice, or “do this for me” tasks run at **Web2 speed**. Behind the scenes, Lucid routes to the best model/compute; after the answer, it writes **receipts to chain** so usage and payouts are transparent. * **Portable memory, optional by design:** With Lucid **Memory Map**, you can let your assistant remember what you allow—**name spaced, revocable**, and rewardable when others reuse that context. * **One-tap Web3:** Thanks to Solana Mobile’s wallet flows, actions that need signing (tips, purchases, grants) feel like normal apps—**no copy/paste keys, no awkward QR dances**. ### What it's on the roadmap * **Lucid App (consumer):** a GPT-like assistant on Seeker that’s **decentralization-aware**—portable memory, verifiable actions, automatic rewards—backed by Lucid’s Internet-of-AI fabric. * **Mobile SDK (for builders):** drop-in tools so Solana mobile dApps can **plug into Lucid** for AI features (reasoning, routing, receipts, rewards) with a few calls. > Goal: show Seeker users and Solana builders that **Lucid is “mobile-first Web4”**—fast, trustworthy AI that respects ownership and pays contributors. *** ### Lucid App on Seeker (user experience) **What users get** * A **GPT-class** chat & voice assistant in a native mobile experience. * A vision on his AI activities on every other devices or experiences (games, * **Taskboard**: quick actions (schedule, summarize, generate assets, game companion). * **Earn & share**: opt-in to data staking for certain memories and **earn rewards** when reused. * **Receipts tab (LucidScan view)**: “what ran, where, and who got paid”—without exposing raw data. * **Seed Vault** holds user keys for Passports + consented data staking. * **Actions**: one-tap intents (tip, claim, mint, swap) shared via link from chats/notifications; runs in wallet or app. **Why it’s different** * An unified AI experience with your agents, games, entertainments directly in your pocket. * Works with the models people already love (GPT/Claude/open). * **No vendor lock-in**—Lucid chooses the best route per task. * **On-chain proof after the fact**, so it stays fast. ### Example flows (easy to picture) 1. **Creator reward flow**\ You publish prompts/packs in a Seeker creative app → users generate with Lucid → **on-chain receipt** splits revenue: you (creator), model vendor (if applicable), compute provider, and the user who staked useful memory. 2. **Game companion**\ A Seeker-first game calls the Lucid SDK for tactics & NPC chatter → **no latency spikes** in play; after the match, **proofs** land on-chain, and contributors receive micro-rewards. 3. **Travel dApp**\ The app asks Lucid for a plan using your **opt-in memory** (preferences, loyalty numbers). Bookings that tip agents or creators are **split automatically**; the dApp shows a **receipt** for trust. *** ### Co-dev invitations * **Early partners (apps & games):** add AI features with the **Lucid Mobile SDK**; we’ll co-design flows and co-market. * **Infra & sensors:** explore **on-device context** (with consent) for smarter agents: presence, location, camera cues, controller input—**never on-chain**, only proofs. *** ### Why this is good for the Solana Mobile ecosystem * **Showcases Seeker’s superpower**: real apps with verifiable AI that still feel instant. * **Drives store engagement**: Lucid-powered features keep users returning. * **Signals to web2:** Solana mobile can run **trustworthy AI** at production quality. **Lucid × Seeker**: make AI **yours**—fast, provable, and mobile-native. - [Plans & Pricing](/knowledge/lucid-ai/plans-and-pricing): Open-source & Managed SaaS. Usage transparent. # Plans & Pricing ### Editions at a glance * **Studio Community (Open Source, self-hosted)** * Free, open-source starter UI + CLI on top of the open-source **Lucid Agent Runtime (LAR)** * Build agents/models locally or in your own infra. * _Perfect for prototyping, teaching, and sharing templates—while Studio Cloud adds hosting, collaboration, autoscale, and enterprise controls._ * **Studio Cloud (SaaS + hosting)** * Production-grade Studio with autoscale & security * Fully managed web app, analytics, deploys, + **bundled hosting** (compute, routing, RAG indices). “Click → ship.” * **Studio Enterprise (VPC / on-prem)** * Private deployment with SSO/SAML, data residency, SLAs, custom controls. * **Developers: Lucid Agent Runtime** (**Open Source**) · SDKs & Connectors * Small, headless engine that runs agents anywhere—local, server, game, or cloud—while **Lucid Studio** is the UI that designs, tests, and deploys them.
FeatureCommunity (Open Source)Studio CloudStudio Enterprise
Visual builder & simulator
Hosting & autoscale✅ (VPC)
Team RBAC, SSO/SAML
Managed RAG & fine-tuning jobs✅ (private)
Compliance, data residency✅ (custom)
PriceFree (open)Subscription + usageContracted
#### What’s shared across editions * Open schemas (**AgentMeta**, **ModelMeta**), connectors (Discord/X/Telegram/UE5/Web), and the open-source **Lucid Agent Runtime (LAR)**. * Import/export between editions with one click—no lock-in. *** ### Open-Core at a Glance * **Community (Open Source & Free)** — SDKs, connectors, schemas, on-chain programs, headless runner. * **Cloud (Managed & Paid)** — Lucid Studio UI, Virtual Humans Pro, Lucid Cloud. > Community gets the building blocks. Studio adds orchestration, UX, autoscale, and SLAs. *** ### Studio Plans > All plans can enable on-chain features; gas is auto-handled (fiat or crypto top-ups). #### Starter — **Free** For solo makers & prototypes. * 1 seat · up to 3 agents · 2 channels/agent (Discord/X/Telegram/Web) * Agent & Model Lab Lite (basic) & Virtual Humans Lite (basic) * Community support * **Includes usage credit:** LLM: 0.05M tokens · Speech: 30 min · Vision: 1k frames **Creator — $24.90/mo** _(or **$19.90/mo** billed annually)_ For indies & small creators ready to ship. * **2 seats** · up to **8 agents** · 3 channels/agent (incl. basic UE5) * Agent & Model Lab Lite & Virtual Humans Lite * Standard support * **Monthly credits:** LLM **2M** · Speech **120 min** · Vision **20k** #### Pro — **$249/mo** _(or **$199/mo** billed annually)_ For teams going live. * 5 seats · up to 15 agents · multi-channel (incl. UE5), alerts & analytics * Agent & Model Lab Pro (RAG at scale, LoRA/QLoRA, versioning & eval) & Virtual Humans Pro * Priority support * **Includes usage credit:** LLM **15M** · Speech **900 min** · Vision **120k** #### Enterprise — **from $3,999/mo** For AAA & regulated orgs. * Unlimited seats · VPC/VPN or on-prem options * Dedicated support SLAs * Custom data residency & compliance reviews * Contracted pricing, rev-share structures * **Includes usage credit:** Custom pooled credits > **Seat add-ons:** Team +$29/seat.\ > **Credits** offset Lucid Studio platform usage (see _Platform Orchestration_). Overages bill at posted rates.\ > **Protocol access is never gated.** If you don’t need Studio, use the open SDKs directly. *** ### Choose Your Compute Path #### Path A — **BYOK (Bring Your Own Keys)** * Use your own OpenAI/Anthropic/etc. keys and pay those vendors directly. * Pay **Lucid’s platform fee only** (for orchestration/RAG/routing/logging). * Best for existing discounts or strict vendor boundaries/compliance. #### Path B — **Lucid Cloud (Bundled)** * **One line item**: bundled model tokens **+** Lucid platform fees. * Region-aware routing, budget caps, autoscale, and SLOs included. * Often cheaper than BYOK once you factor orchestration + observability + failover. > **Rule of thumb:** If **BYOK vendor price + Lucid platform fee** > **Lucid Cloud** bundle, switch to **Lucid Cloud** for simplicity and savings. *** ### Usage Pricing We meter **tokens** (model work) and **media units** (audio/vision). You can mix and match per agent. #### A) Lucid Studio — Platform Orchestration Fees _(charged only if you exceed your plan’s included credits)_ Covers Lucid orchestration (RAG), routing, tracing/logging—**applies to both BYOK and Lucid Cloud**. **LLM tokens (per 1M tokens):** * **Class S** (2–8B SLM / tools): **$0.50** * **Class M** (balanced chat / RAG): **$1.00** * **Class L** (rich gen / VLM): **$2.00** **Speech:** * **ASR/TTS audio:** **$0.01 / minute** **Vision:** * **Frames processed:** **$0.05 / 100 frames** > If you call a third-party model with **your own key (BYOK)**, you still pay that vendor directly; **Lucid only charges the platform fee above**.\ > If you use **Lucid Cloud**, the **bundled rate already includes** this platform fee (no double charge). #### B) Lucid Cloud — Bundled Compute (Tokens + Platform)ns Pick one per agent/model (switch anytime): **Option 1 — BYOK (Bring Your Own Keys)** * You pay your vendor (OpenAI/Anthropic/etc.) directly for tokens. * You pay Lucid **platform fees** (section A). * Best when you already have negotiated rates or must keep your own compliance boundary. **Option 2 — Lucid Cloud (Bundled Hosting)** **Reference rates (per 1M tokens):** * **Class S** (2–8B SLM / tools): **$1.50** * **Class M** (chat/RAG 7–14B): **$4.00** * **Class L** (rich gen / VLM): **$10.00** **Bundled Speech & Vision:** * ASR/TTS **$0.04 / minute** * Vision **$0.25 / 100 frames** _Rates vary by region/SLA; Enterprise can lock custom cards._ *** ### On-Chain Costs (Optional, Managed for You) * Lucid Chain is free; you only fund gas when you **turn on** on-chain memory/proofs. * **Pay in fiat or crypto (SOL/USDC)** → SDK auto-converts to **$LUCID** and funds your **mGas/iGas** reserve. * **mGas** covers memory/routing/proofs (tiny writes—sub-cent). **iGas** maps to compute units (per-token/ops). * You **never** manage tokens manually—clear receipts shown in Studio. *** ### Lucid TrustGate Coming Soon *** ### Grants & credits We actively fund builders: * **Indie Spark Grants:** up to **$5,000** in usage & gas credits for verified indie teams. * **Studio Launch Grants:** co-marketing plus **$25,000** in credits for flagship titles. * **Open-Source Fellowship:** up to **$10,000** credits for open tooling, plugins, or datasets. * **Education/Research:** classroom & lab bundles on request. > Grants apply to **platform fees**, **Lucid Cloud compute**, and **Gas Reserve** top-ups. *** ### FAQ (Short) **Do I get double-charged if I use my own OpenAI key?**\ No. With **BYOK** you pay your vendor for tokens, and pay Lucid’s **platform fee** only. With **Lucid Cloud**, the **model-class rate** already includes platform fees. **Can I use GPT/Claude?**\ Yes—**BYOK** or run open models via **Lucid Cloud**. **Can I pay only in fiat?**\ Yes. The SDK handles on-ramp and funds your mGas/iGas reserve under the hood. **Are on-chain features required?**\ No. You can keep everything off-chain (“Shadow Mode”) and flip on on-chain for provenance/rewards later. **Can I lock in rates?**\ Yes—**Enterprise** can negotiate custom rate cards and SLAs. **What if we outgrow Studio?**\ Export your Agent/Model metadata and self-host the open runtime—or upgrade to Enterprise/VPC. **How do speech/vision get billed?**\ By **minutes** (ASR/TTS) and **frames** (vision), with included credits per plan; overages at posted rates. *** ### Notes & Definitions * **Classes (S/M/L)** refer to model complexity/latency: small SLMs → rich LLM/VLM. * **Tokens** are counted input+output. Vision frames are any processed (e.g., caption, VQA). * **Credits** reset monthly; unused credits don’t roll over. * **Prices** are indicative and subject to change; regional taxes may apply. *** **Have a bespoke workload (e.g., console constraints, on-prem GPUs, or regulated data)?**\ Contact Sales for an **Enterprise** plan with VPC, on-prem, or dedicated Fluid Nodes. - [Security, Privacy & Compliance](/knowledge/lucid-ai/security-privacy-and-compliance): >- # Security, Privacy & Compliance * **Private by default.** Lucid Studio runs fully **off-chain** unless you turn on on-chain options. * **No raw data on a blockchain.** When you opt in, Lucid writes **tiny proofs & hashes**, not your content. * **Your IP stays yours.** We don’t train our models on your data **unless you explicitly opt in**. * **Enterprise controls.** SSO/SAML, RBAC, data-residency, BYO-KMS, VPC/self-host (Enterprise). *** ### What Studio Stores (off-chain) vs. What It Never Stores On-Chain #### Stored off-chain (encrypted at rest/in transit) * **Projects & agents:** names, settings, prompts, tools, channel bindings. * **Model assets:** RAG indexes, datasets, fine-tune adapters (e.g., LoRA), evaluation sets. * **Operational logs:** inference traces, error logs, cost/latency metrics. * **Virtual humans:** avatar meshes/textures, voices, lip-sync profiles (when you use the extension). * **Secrets:** API keys, webhooks, OAuth tokens (vaulted; never written to logs). #### Never stored on-chain (even when you enable on-chain) * Raw prompts, conversations, files, embeddings, model weights, media (audio/video/3D). #### On-chain (only if you enable it) * **Proofs & pointers only:** * _Thought Epoch root_ (Merkle hash of a batch of actions) * _Recall CIDs_ (content IDs/pointers to RAG sources you chose to reference) * _Routing/model IDs_ & fee splits for royalties (PoC) * _Agent DID / wallet_ for identity & payouts * These are **small hashes & metadata**, not the content itself. *** ### IP & Likeness Protection * **Ownership:** You (or your org) own your prompts, datasets, fine-tune adapters, indexes, and avatars you create/import. * **Private namespaces:** Keep sources and memories private to specific agents/teams; disable reuse entirely if required. *** ### Enterprise Assurances * **Identity & access:** SSO/SAML, SCIM, enforced MFA, least-privilege defaults, audit trails. * **Data residency:** regional hosting (e.g., EU/US); pin workloads to specific regions. * **Deployment:** SaaS (multi-tenant), **VPC/Self-host** options (Enterprise) for stricter boundaries. * **Compliance posture:** SOC 2/ISO-aligned controls; independent audits & reports available to Enterprise under NDA (timeline provided in MSA). * **Contracts:** DPA/SCCs on request; industry addenda (e.g., add’l confidentiality) supported. *** ### Third-Party Providers & BYOK * **BYOK (bring your own keys):** OpenAI, Anthropic, custom endpoints, speech/vision vendors—keys stay vaulted & scoped; you pay your vendor directly. * **Lucid Cloud (optional):** managed hosting & routing with consolidated billing; still no training on your private data by default. *** ### Incident Response & Support * **24×7 monitoring**, DDoS protection, anomaly alerts, rate-limit shields. * **Security desk:** security@… (PGP key available). Coordinated disclosure welcome. * **Breach playbook:** notification SLAs, forensic snapshots, post-mortems shared with Enterprise. *** ### Quick FAQ **Do you put my chats or files on-chain?**\ No. Only small hashes/pointers when you enable on-chain. **Will you train on our data?**\ Not unless you opt in. Default is **no**. **Who owns a fine-tuned model/adapter we create?**\ You do. You can export it; on-chain registration is optional (for royalties/routing). **Can regulators/auditors verify decisions?**\ Yes—enable **Proofs Only** mode to write minimal proofs visible in LucidScan, without exposing content. **Can we keep everything private?**\ Yes—stay in **Shadow Off-Chain** mode and disable shared namespaces. *** #### Safe Defaults We Recommend 1. Start in **Shadow Off-Chain**. 2. Enable **Proofs Only** for auditability. 3. Use private namespaces; add **Memory + Proofs** as needed. 4. Turn on **Full Actions** (on-chain reads/tx) only for scoped, high-value flows. **Bottom line:** Thanks to Lucid Chain, Lucid Studio lets you **prove** what matters, **hide** what’s sensitive, and **control** every boundary—so you can ship faster without sacrificing safety or compliance. - [TrustGate - Managed Inference & DePINs orchestration](/knowledge/lucid-ai/trustgate-managed-inference-and-depins-orchestration): Verifiable AI at Enterprise Scale. Turns DePIN Into Enterprise-grade. # TrustGate - Managed Inference & DePINs orchestration **A managed API that orchestrates models, compute, and data across DePIN and Cloud — with attestation, SLOs, insurance, and on-chain receipts.**\ → No code changes. Just swap your base URL and ship.\ \ DePIN is cheap & decentralized; enterprises buy trust —so you get DePIN economics without DePIN risk.
### Why TrustGate DePIN is cheap.\ **Enterprises buy trust.** Raw GPU marketplaces can’t ship SLAs, compliance, or provenance. **TrustGate** turns decentralized compute and model routing into a **contract-grade inference layer**: | DePINs Today | TrustGate™ | | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | ❌ Best-effort only (no SLAs) |

✅ 99.5–99.9% SLOs + Insurance (credits/payouts on breach)

Thanks to our Cloud Fallback

| |

❌ Unknown GPU integrity.

No receipts/provenance.

| ✅ Attested execution (H100/H200 CC-On) + signed receipts anchored on Lucid Chain (visible in LucidScan). | | ❌ Manual retries; storage far from compute | ✅ Data-gravity box: S3-compatible near-compute cache to cut egress & stabilize latency | |

❌ One network only.

Integration drag.

|

✅ Multi-network routing + Cloud Fallback.

One endpoint. All DePIN ecosystem.

| | ❌ Crypto-only. Compliance gaps | ✅ Fiat & crypto billing, audit logs (AI-Act/GDPR-friendly) | TrustGate transforms raw infrastructure into a **production-ready inference service** — one endpoint, any model, verifiable results. *** ### Source the network via [Engine ](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine)(by category) | Layer | Role | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Models (via Cognition Router)** | Route to GPT, Claude, Llama, or decentralized markets. Each profiled on quality, cost/token, latency, and safety. | | **Compute (via Fluid Compute)** | Aggregate DePIN GPU suppliers (io.net, Akash, Aethir, Exabits, Nosana, etc.) + Lucid Cloud fallback. Track p95 latency, cost, attestation, and region. | | **Data (via Data Shield + Memory Map)** | Near-compute S3 caching to reduce egress (Data Shield) and portable, permissioned memory with receipts (Memory Map). | Together, they form a **full inference fabric**, not just GPU rental. ### Two paths per request: **Hot Path** (fast) & **Proof Path** (verifiable) #### Hot Path → Fast * UX target: **TTFT < 500 ms**, streaming thereafter. * Client → **TrustGate** (OpenAI-compatible endpoint). * Policy engine enforces region, attestation, cost, and latency. * _(Optional)_ Router picks the best model per policy. * Fluid Compute schedules inference across verified pools. * Results stream at Web2 speed; cloud fallback protects SLO. #### Proof Path → Verifiable (Async, after response) * Collect run metadata (model/container hash, attestation, p95 metrics). * Create signed run receipt → anchor to **Lucid Chain** (visible in Lucid Scan). * SLO Monitor + Insurance evaluate telemetry; auto-credit if breached. * Billing + receipts enable invoices, cost centers, and AI-Act/GDPR exports. ### Example Policy (YAML) ```yaml project: acme-prod targets: allow_regions: [eu-west, eu-central] residency_required: true attestation: require_cc_on: true fallback_allowed: true latency: p95_ms_budget: 900 cost: max_price_per_token_usd: 0.000004 privacy: store_inputs: false redact_pii: true ``` **Outcome:**\ TrustGate finds attested H100 capacity matching your policy; if not, falls back to cloud and logs this in the receipt.\ SLOs remain intact; breaches auto-trigger credits or insurance payouts. *** ### Receipts & Audit (What Gets Proven) ```json { "run_id": "tg_8c2…", "timestamp": "2025-09-15T12:45:03Z", "policy_hash": "0x8ab…", "model_hash": "sha256:…", "attestation": { "gpu": "H100-SXM", "cc_on": true, "verifier_sig": "0x…" }, "metrics": { "p95_ms": 612, "tokens_in": 1248, "tokens_out": 356 }, "chain_anchor": { "network": "Solana", "tx": "6f…", "mmr_root": "d3…" } } ``` Only hashes and proofs are written on-chain — **never raw content**.\ Receipts are browsable by **run, project, or invoice** in **LucidScan**. *** ### SLOs & Credits | Metric | Guarantee | Remedy | | ---------------------- | --------------------------- | --------------------- | | **Availability** | 99.5–99.9 % per endpoint | Automatic bill credit | | **Latency (p95)** | Enforced by policy | Credit or payout | | **Proof integrity** | All runs signed + anchored | Validator verified | | **Insurance (opt-in)** | Parametric payout on breach | Lucid-operated | *** ### Data Shield (Near-Compute Cache) Optional module colocated with compute pools. * **Purpose:** stabilize p95 and reduce egress. * **Function:** prefetch assets, deduplicate chunks, TTL enforcement. * **Policy-aware:** respects residency & retention. *** ### Why this works * ⚡ **Web2 speed, Web3 proof** — fast hot path; verifiable proof path. * 🧩 **Unified inference** — models, compute, and data routed under one policy. * 🛡️ **Enterprise levers** — attestation, region, latency, cost, fallback. * 💸 **Predictable outcomes** — automatic credits, transparent audit. *** ### Pricing model (how we bill) > We price **trust & outcomes**, not raw $/h. | Component | Billing | | --------------------------- | -------------------------------------------------------- | | **Inference orchestration** | Pass-through compute + Lucid margin | | **SaaS** | Subscription for observability, receipts, and compliance | | **Credits / Insurance** | Auto-credits included; optional insurance premium | | **Payments** | Fiat or crypto; cost centers + PDF invoices | *** ### FAQ **Q. Do I need to change my code?**\ **A.** No — TrustGate is OpenAI-compatible. Replace the base URL and go. **Q. Is everything attested?**\ **A.** If policy requires CC-On and capacity exists, yes. Otherwise fallback per rules. **Q. What runs on-chain?**\ **A.** Only receipts & payouts (hashes/roots), not the inference itself. **Q. Can I force EU-only compute?**\ **A.** Yes — set residency and region in your policy. **Q. Do you support fine-tuning?**\ **A.** Yes — fine-tuning and multi-node training are available in supported regions. *** ### Position in the Lucid Stack | Layer | Role | | ---------------------------------- | ----------------------------------------------- | | **Lucid OS (Synapse + TrustGate)** | Build & operate inference-based apps and agents | | **Lucid Engine** | Routes to best model and compute | | **Lucid Chain** | Anchors receipts, payouts, and insurance proofs | TrustGate lives in **Lucid OS**, orchestrates **inference** across DePIN + Cloud, and anchors proofs to **Lucid Chain**. **Lucid TrustGate** is the **Managed Inference Layer** that gives you DePIN economics without DePIN risk — drop-in, auditable endpoints with attestation, SLOs, and insurance.\ Keep your existing clients, route anywhere under policy, and **prove every answer.** - [Architecture — How Lucid Works](/knowledge/lucid-chain/architecture-how-lucid-works): A no‑jargon look at how Lucid powers the Internet of AI. # Architecture — How Lucid Works
### **Lucid’s Core Is Hybrid** * **On-chain for trust:** identity, proofs, and payouts. * **Off-chain for speed:** decentralized compute and storage — model answers in **<100 ms**. ### **Two Paths** **Fast Path (what you feel):**\ You ask → you get an answer in under 100 ms. **Proof Path (what we log):**\ After the answer, Lucid writes verifiable receipts and payouts on-chain.\ No raw data — only hashes and metadata. *** ## The pieces ### **1 · Lucid Engine — The Machine** Turns scattered models and DePIN compute into a single, intelligent, fast engine. * **Cognition Router** → Picks the best AI every time (quality · cost · latency · safety). Works with GPT, Claude, open models, or custom endpoints. * **Fluid Compute** → Brings GPUs online when needed, verifies their work, and falls back to cloud via TrustGate. > _Think: a traffic controller deciding “who should answer this?” and “where should it run?”_ ### **2 · Lucid Data — The Graph** Gives AI stakeholders an **ID** and **shared memory**. * **Passports** → Digital citizenships for AI. Portable IDs & wallets for agents, users, models, and nodes. Carry reputation, budgets, and permissions everywhere. * **Memory Map** → A portable, private memory vault. Context travels across apps safely and earns rewards when reused. > _Think: your identity + your notes — shareable on your terms._ ### **3 · Thought Epochs — Receipts, Not Raw Data** Bundles everything that happened — tool calls, models used, attestation proofs, memory reads — into one compact root anchored on Lucid Chain.\ Every AI action becomes auditable without exposing content. > _Like a bank statement for AI activity._ ### **4 · D-Storage — Your Backups, Your Control** Policy-based encrypted archives (IPFS · Filecoin · Arweave).\ Used for durable proof copies — not live chat content.\ Keep what matters, discard what doesn’t. ### **5 · LucidScan — Explore the Internet of AI** An explorer to view usage, receipts, and payouts.\ Perfect for builders, auditors, and creators who want transparency. *** ## **What Happens Behind the Scenes** Two easy ways to use Lucid: #### **A · Attach Lucid to your current AI apps (GPT, Claude, etc.)** * Use your app as usual — Lucid runs in the background. * Thought Epochs record receipts; Memory Map updates if allowed. * You get answers fast; you keep your data and receive rewards for reuse. #### **B · Use a Lucid-powered App or Agent** * **Router** chooses the best model. * **Compute** executes on the best node. * Thought Epochs log everything; payouts split automatically to data · model · compute. * Verify it all in **LucidScan**. > **Bottom line:** you get speed, creators get paid, regulators get receipts. *** ### Why this matters * **Interoperable:** memory and tools work across apps and chains. * **Provable:** every decision and reuse has a receipt. * **Paid:** contributors (data, models, compute) get automatic splits. * **Private by default:** only hashes go on-chain; no raw data. * **Web2 speed:** proofs settle later; UX stays instant. *** ### Why On‑Chain? * **Your Memory, Yours:** keep it private or stake it for rewards. * **AIs That Cooperate:** agents share skills and data safely. * **Trust You Can Check:** anyone can verify which data, model, and compute were used. * **Automatic Royalties:** smart contracts split fees instantly. * **Compliance-Ready:** immutable paper trail (GDPR / CCPA). * **Privacy-First:** proofs on-chain; content encrypted off-chain. *** ### Where Your Data Lives * **Hot lane:** fast database for instant recall. * **Cold lane:** decentralized storage for durability. * **On-chain pointer:** a tiny hash to prove integrity and minimize fees. *** ### Security & Privacy in One Sentence Your data stays encrypted off-chain; only proofs and hashes touch the chain —\ **compliance without exposure.** (Opt-in staking lets you earn $LUCID when your data or models are reused.) *** #### Where to dive next * [**Memory Map**](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data/memory-map-portable-memory) → how portable, opt-in memory works and earns. * [**Passports**](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data/lucid-passports-identity-and-ownership) → how agents, models, and users get portable IDs & permissions. _That’s the Internet of AI in practice: fast answers, trustworthy receipts, automatic rewards._ - [Lucid Browser Extension](/knowledge/lucid-chain/architecture-how-lucid-works/browser-extension): Turn any AI into Web4 in one click. # Lucid Browser Extension Keep using ChatGPT/Claude/Gemini exactly as you do today. The Lucid mini-panel lets you **save your memory, create verifiable receipts, and earn rewards** — all at Web2 speed. **Status:** open beta • Chrome first (others next) Use GPT/Claude like normal. Click ‘Save to Memory’. Earn rewards. Web2 speed, Web3 trust. *** ### Why use it * **Zero friction.** No new app. The panel sits on top of existing AI sites. * **Portable memory.** Save/redact chat snippets to your **Memory Map** (portable, permissioned). * **Proofs you can trust.** Generate **verifiable receipts** for what you chose to save (no raw content on-chain). * **Rewards.** Opt-in **Data Staking** to earn points for reuse of what you share. * **You stay in control.** Choose _what_ to save, _where_, and _who_ can reuse it. *** ### Quick start (15 seconds) 1. **Install** the Chrome extension. 2. **Connect** (Phantom / MetaMask, or sign in with Google/email). 3. **Chat as usual.** Click **Save to Memory** in the tiny Lucid panel. 4. **Earn & track.** Watch your points and portable memories in your dashboard. > We create a **local session key** so you don’t have to reconnect each visit. You can revoke it anytime in the menu *** ### What it does on each page * **Overlay:** a tiny control that appears on supported AI sites. * **Save / Redact:** pick exact messages or snippets; set **namespace & ACLs**. * **Receipt (optional):** one tap to create a **verifiable receipt** for the saved action. * **Stake (optional):** opt-in to earn points/royalties when your contributions are reused. ### Supported today * **ChatGPT, Claude, Gemini** (stable) • **Grok** (beta) * Coverage expands weekly. Any site with a web UI can be supported via our selector templates. *** ### Security & privacy * **No surprise spends.** Connecting a wallet = **sign-in**, not spend. Funds only move with an explicit transaction. * **Local session keys.** Device-scoped; revoke from the menu anytime. * **Data control.** Export or delete your memories. On-chain records store **hashes/pointers**, not raw content. * **Speed first.** The **answer path is off-chain**; we commit proofs later. Overhead is near-zero. *** ### FAQ **Will this slow down my chats?**\ No. We keep the UX hot path off-chain; receipts settle asynchronously. **Do I have to use a wallet?**\ You can connect **Phantom/MetaMask** or sign in with **Google/email (not wallet required)**. **What exactly is a “receipt”?**\ A cryptographic proof that you saved X at time Y with policy Z. It’s **auditable** in LucidScan and doesn’t expose your raw text. **What do I earn?**\ Points (and future rewards) tied to the reuse of the memories you opt-in to share via the network. - [Dual‑Gas Economics](/knowledge/lucid-chain/architecture-how-lucid-works/dual-gas-economics): >- # Dual‑Gas Economics ### What it is **Two meters, one bill.** * **iGas** → pays for **AI computation** (tokens generated, GPU seconds). * **mGas** → pays for **on-chain memory & receipts** (proofs, pointers, payouts).\ Both settle in **$LUCID** under the hood and are invisible to casual users (fiat-first UX). ### Why Two Gas Tokens? Lucid’s innovative payment system to keep AI fast, affordable, and fair. It ensures users pay only for what they use, while contributors—like data providers, model creators, and compute node operators—earn automatic rewards in a unified, decentralized ecosystem — all settled in $LUCID. AI spend today is a black box. Splitting compute vs memory makes **who got paid for what** crystal clear. *** ### How It Works Dual-Gas splits Lucid’s operations into two cost types, paid in $LUCID token equivalents, ensuring fair rewards across the ecosystem: #### How It Flows in a Typical Call * Users can pay **fiat/SOL/$LUCID**; the Smart-Contract swaps behind the scenes. * **Request** → Router picks model; Fluid Compute picks GPU. * **Answer streams** (<100 ms). * **Receipts generated** (hashes, policy, attestation) → batched to chain. * **Fees split automatically**: * iGas → **compute providers** (GPUs) & orchestration. * mGas → **data/knowledge stakers**, model owners, validators. * **One invoice**; everything auditable in **LucidScan.**
#### Supply Mechanics * **iGas** is minted on demand when users pre‑pay compute budgets; burnt after inference. Peg maintained via AMM to $LUCID. * **mGas** is minted in genesis and capped; scarcity drives validator staking. * Treasury buys back and burns $LUCID with a share of both gas streams → deflationary pressure **Most end‑users never touch $LUCID, mGas, or iGas directly:** * **Pay in fiat or SOL** – The Lucid SDK integrates a Stripe‑like on‑ramp; user approves €0.02, backend buys the exact mGas / iGas on their behalf. * **One receipt** – Wallet or credit‑card bill shows a single line: “AI request – €0.02 (incl. €0.0003 storage, €0.0197 compute)”. * **Gas abstraction** – Under the hood the dApp’s relayer holds a small buffer of mGas/iGas; it refills automatically when reserves drop below a threshold. * **Behind‑the‑scenes swap** – The on‑ramp converts fiat/SOL → **$LUCID** via a DEX pool, then immediately buys the exact mGas & iGas needed. End‑users never juggle tokens; $LUCID stays the settlement layer under the hood. * **Power users** can switch to paying in $LUCID directly, or even in raw mGas/iGas if desired. *** ### Benefits by stakeholder * **Users/Teams:** predictable bills; pay by card; sub-100 ms UX; exportable proofs. * **Data owners (Memory Map):** earn mGas-side royalties on reuse. * **Model owners:** earn iGas-side shares per routed token. * **GPU providers:** earn iGas with proof-of-inference/attestation. * **Validators:** earn mGas for securing receipts & payouts. * **Enterprises:** separate cost centers for compute vs compliance. *** ### One-minute mental model Think **phone plan**: * **Minutes/Data** = **iGas** (compute you used). * **Line/Taxes** = **mGas** (the receipts & splits that keep the network fair).\ One monthly bill. Clear usage. Everyone gets paid the right share. *** ### FAQ **Q:** Why not pay directly in SOL? **A:** Two separate reasons: 1. _Budget predictability_ – iGas is **pegged 1 : 1 to compute units** (tokens, flops). You always know 1 iGas buys \~1 token, independent of $LUCID ↔ USD or SOL ↔ USD swings. Paying in SOL would tie compute cost to a market outside Lucid’s control. 2. _In‑protocol levers_ – The DAO can mint/burn iGas or adjust mGas fees to damp volatility, whereas SOL supply and priority‑fee spikes are set by the broader Solana network. > **Note:** $LUCID’s USD price may fluctuate like SOL, but _gas prices in terms of compute_ stay stable because iGas is minted and burned around that fixed compute peg, not a fiat peg. **Q:** What about **mGas** price—won’t that fluctuate too?\ **A:** mGas is a **capped genesis pool** that rewards validators and data contributors. Its unit is “one on‑chain memory operation,” so the dollar price may move, but: * Memory writes are tiny ( < 100 bytes), so even if mGas doubled, user cost stays pennies. * Demand is steadier than GPU compute, anchoring the price. * We can subsidise critical PDAs or adjust fee splits to keep storage affordable. In practice, 90 %+ of user spend is iGas; mGas volatility has minimal impact on budgets. **Q:** Can I swap iGas ↔ mGas?\ **A:** Yes via the AMM, but peg ratios differ; designed disincentive to mix them. **Q:** What if iGas price spikes?\ **A:** Router can fallback to lower‑cost models; DAO can mint extra supply to damp spikes. Rust contract lives in `/contracts/gas_vault`. *** ### Appendix #### Default splits (illustrative) * **iGas:** 70% compute, 15% model owner, 10% router/ops, 5% treasury. * **mGas:** 50% data stakers (Memory Map), 30% validators, 15% royalties (contributors), 5% treasury.\ &#xNAN;_(DAO-tunable by domain/app class.)_ #### Pricing example (illustrative) * 1,000 tokens answer → **1,000 iGas**. * 2 receipts (action + memory) → **2 mGas**. * User sees: “AI request – €0.021 (compute €0.020, receipts €0.001)”. * LucidScan shows the exact splits on-chain. - [Lucid Data](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data): The Graph - Gives AI stakeholders an ID and a Shared Memory # Lucid Data ## What it is (one line) A lightweight **identity and memory layer** for the Internet of AI.\ **Passports** identify _who did what_; **Memory Map** stores portable, user-approved context and logs receipts on-chain — never raw data. *** ## Passports — digital citizenship for AI * One ID across apps for **people, agents, models, and nodes**. * Wallet binding for **payouts, splits, and staking**. * **Reputation** for speed, quality, and reliability that travels with you. * Transparent credit trail — if you help, you earn. > _Think: verified profile + wallet + reputation, readable by any app._ *** ## Memory Map — your portable memory vault * User-owned, encrypted memory (namespaces & ACLs). * On-chain recall receipts (hashes only, never raw content). * Opt-in **data staking** — earn when your approved data is reused. * Share context safely across agents, apps, and models — no lock-in. > _Think: bring your memory with you, securely — and get rewarded when it helps._ *** ## Why it matters * **No more silos.** Your context moves with you. * **Trust by default.** Every action leaves a verifiable receipt. * **Fair economics.** Automatic splits to data, models, and compute. * **Web2 speed.** Proofs and payouts settle asynchronously. *** ## How it works (3 steps) 1. **Act** — You or your agent perform an action in any app. 2. **Log** — Lucid writes a hashed receipt linked to your Passport and Memory Map. 3. **Settle** — When that memory or output is reused, rewards flow automatically. *** ## Privacy, simply * You choose what’s remembered — save, redact, or revoke. * Receipts prove _that_ it happened, not _what_ you said. * Long-term backups pin to decentralized storage by policy. *** ## **How It Fits** Data powers **Engine**:\ Every run gets a receipt, attributed to Passports, and settles payouts against Memory Map rules.\ Hot path stays off-chain; proofs and splits sync on-chain later. *** ## TL;DR **Passports** prove _who helped_.\ **Memory Map** proves _what happened_.\ Together, they make AI **interoperable, auditable, and fairly paid — at web speed.** - [Lucid Passports — Identity & Ownership](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data/lucid-passports-identity-and-ownership): >- # Lucid Passports — Identity & Ownership **One liner: A portable, verifiable identities for AI actors and assets — agents, models, datasets, and compute — so every action can be attributed, audited, and paid for across apps and infrastructure.** \ They turn fragmented AI components into **first-class, verifiable citizens** of the Internet of AI.\ They are how intelligence becomes **ownable, accountable, and composable**. *** ## **Why It Matters** * **Ownership:** Every model, dataset, or agent has a verifiable creator and owner. * **Attribution:** Contributors get credit and payouts automatically. * **Reputation:** Assets build public trust via usage history and performance. * **Compliance:** Licenses, policies, and provenance are cryptographically attached. * **Interoperability:** Any asset with a Passport can interact safely with others. This is how AI becomes an **economy**, not just a collection of apps. **ZK in one line:** _“Receipts today; **zero-knowledge** when you need stronger privacy & compliance—**without** slowing the UX.”_ *** ## How it works? #### 1. Describe (off-chain) Each Passport is defined by a **content-addressed manifest** (JSON), stored off-chain (IPFS / Arweave / Filecoin-backed retrieval). The manifest includes: * identity * capabilities * constraints * ownership * payout rules * references to proofs and receipts The manifest is identified by its **CID / hash**. *** #### 2. Anchor (on-chain) The manifest hash is anchored on-chain using a **Passport Anchor**: * On **Solana**: via PDAs (deterministic, cheap, program-controlled) * On **EVM (optional)**: via ERC-8004 compatibility (`agentURI → same CID`) The chain stores: * the hash / CID * authority * status (active / revoked / archived) **Raw content is never stored on-chain.** *** #### 3. Connect (proofs & payouts) Passports link to: * **Execution receipts** (what ran, where, when) * **Attestations** (benchmarks, compliance, uptime) * **Payout rules** (how value is split when used) Everything references the same Passport ID. ### **Passport Types**
Asset TypeExampleDescription
Agent Passport
Actors that request execution.
Concierge v1.3

owner / authority

allowed models & compute

memory namespaces

execution history references

Model Passport
AI models, open or commercial.
Mistral-7B v2

model artifact references (HF repo etc.)

runtime compatibility (vLLM / TGI)

license & usage policy

performance attestations

Dataset Passport
Data used for reasoning or training.
Lore Index v0.4

provenance

schema & hash

license

usage constraints

Tool Passport
External APIs or tools.
Stripe Connector

permissions & scopes

rate limits

verified source

Compute + Offer Passport
Infrastructure that runs workloads.
FluidNode-12

provider identity

GPU / runtime constraints

region & policy

SLA tier

uptime / latency attestations

#### **What’s Inside a Passport** | Field | Description | | -------------------- | ---------------------------------- | | ID | Content-addressed (CID / digest) | | Authority | Wallet, multisig, or program | | **Capabilities** | What this asset can do | | **Constraints** | License, region, runtime, policy | | **Revenue Rules** | How value is split when used | | **Proof References** | Receipts, attestations, benchmarks | | **Versioning** | Lineage without breaking identity | ### Privacy by Design * Chains store **hashes**, not raw data * Outputs are referenced by digest * Memory contents are never exposed by default **Receipts first. Zero-knowledge later.** ZK is optional and additive: * prove compliance without revealing internals * prove reputation thresholds without leaking history * e.g. verifiable credentials (KYC/enterprise/residency), corporate needs etc. ### Lifecycle 1. **Draft:** Created locally or privately (off-chain only) 2. **Published:** Manifest anchored on-chain 3. **Active:** Used in execution flows and receipts 4. **Versioned:** Updated capabilities, same lineage 5. **Archived:** Retired, but history remains verifiable ### PDA vs NFT **Canonical identity = PDA Passport** * deterministic * program-controlled * authority does not change accidentally * reputation cannot be “sold” **NFT = optional wrapper** * wallet UX * discovery * distribution * licensing & revenue rights NFTs, if used: * point to the Passport * do **not** control execution * do **not** transfer authority by default **PDAs make it work. NFTs make it usable.** ### Why Solana Fits Passports Well * **PDAs**\ Deterministic identities with programmable authority. * **State Compression for scale - Low-cost anchoring**\ Millions of Passports and receipts without friction. * **High-frequency receipts**\ Execution proofs belong on a fast chain. * **Optional human-readable names**\ `.sol` SNS handles can resolve to Passports for UX. * **Attestation primitives (SAS)** – Use Solana’s **attestation services** (where available) to attach **KYC/enterprise/residency proofs** to a Passport. Perfect for anti-sybil, enterprise trust, and policy gating. #### **In Practice** * **When you publish an Agent:** Get a **Passport** → attaches its memory namespace → tracks all runs. * **When your model is used:** Your **Model Passport** logs contribution → receives proportional iGas rewards. * **When a dataset powers reasoning:** Its **Dataset Passport** ensures attribution and licensing compliance. * **When a DePIN node runs inference:** Its **Compute Passport** earns payouts tied to uptime & latency proofs. Everything connects — automatically and verifiably. *** ### For Builders * Own your work — agents, models, data, tools * Set license & policy once, enforced everywhere * See where your assets are used * Get paid automatically when they are used ### For Enterprises * Traceable AI supply chain * Enforce region & license policies * Audit-ready execution proofs * No raw data leakage ### For Web3 & DePIN * Open, verifiable identities * Programmable revenue splits * Provider reputation over time * Chain-agnostic by design - [Memory Map — Portable Memory](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data/memory-map-portable-memory): Memory that moves with you. Secure, portable context for interoperable AI. # Memory Map — Portable Memory **One-liner**\ Memory Map is the portable memory layer for AI.\ It lets agents remember, share, and reuse context across apps — securely, verifiably, and without central silos. ### What it is Memory Map is the **context layer** of the Internet of AI. It gives agents long-term memory that: * persists across apps (Discord, X, Web, Games, APIs), * respects permissions and privacy, * can be verified without exposing raw data. Memory Map separates **where memory lives** from **who controls it**. * **Raw memory** lives off-chain, encrypted, close to compute. * **Truth about memory** (hashes, policies, lineage) is anchored on Solana. Because pointers live on Solana, no one can secretly change or delete them, yet the raw data remains private or encrypted. *** ### Why It Matters Today, AI memory is broken: * Each app keeps its own context. * Memory is lost when you switch surfaces. * Platforms own the data, not users that provide them for free. * There is no audit trail, attribution, or reuse. Memory Map fixes this. #### What it unlocks * **Continuity**\ Agents remember users, goals, and outcomes wherever they run. * **Interoperability**\ Memory moves with the agent — not locked to an app or vendor. One global pool any agent can query, enabling faster, collective learning and better results. * **Trust**\ Every memory can be verified with cryptographic proofs. Making AI GDPR/CCPA compliant. * **Privacy by default**\ No raw data on-chain. Ever. * **User control**\ Own your data (e.g., chats, game strategies) and decide what to share. Automatic $LUCID royalties on every reuse. You can migrate, revoke, re-encrypt, or delete memory at any time. This is how AI becomes _persistent_, _portable_, and _accountable_. ### The core idea Memory Map is **not a single database**. It is a **coordination layer** between three things: 1. **Hot memory (execution-time)**\ Fast, local, ephemeral context used during inference. 2. **Cold memory (portable, long-term)**\ Encrypted knowledge blobs stored off-chain (IPFS / Arweave / Filecoin etc.). 3. **On-chain anchors (truth layer)**\ Hashes, policies, permissions, and lineage recorded on-chain. This keeps latency low and trust high. *** ## How It Works * **Namespaces:** Each agent or app gets one or more **memory spaces** (contexts) — like folders for thoughts (`user_preferences, conversation_history, skills` etc.). * **Scopes:** Define who can read, write, or share under which **policies** (region, license, purpose). * **Storage:** * Encrypted memory stored off-chain (S3, IPFS, DePins, or your own storage). * On-chain only holds content hashes. 1. **Thought Epochs:** Snapshots of reasoning or memory reuse are logged periodically for transparency. 2. **Sync:** Agents running in different channels automatically sync relevant context in real time. All of this happens **below 100 ms latency**, so user experience stays seamless. #### **What You Can Store** Memory Map is content-agnostic. Examples: * conversations and summaries * user preferences * strategies and playbooks * embeddings and prompts * structured knowledge * agent state and goals You choose what is saved, shared, or discarded. #### **Example** > A “Concierge” agent chats with you on Discord, then greets you on your website using what it remembers about your preferences — without ever centralizing your data. > > Its Memory Map namespace syncs context across both surfaces; recall hashes are recorded in **Thought Epochs**, so the provenance of every insight is verifiable. *** ### Data Staking — Turn Knowledge into an Asset Stake encrypted data & skills; Lucid pays you whenever any model/agent reuses them. **What you can stake**\ Chats & notes · Game strats/“recipes” · Research summaries/datasets · Prompts/tools/embeddings · Agent playbooks | Mechanism | What it proves | Reward / Penalty | | ------------------------------- | ------------------------------ | --------------------------------------------------------------------------- | | **PoC – Proof‑of‑Contribution** | A vector was reused | Data owner earns $LUCID split | | **PoM – Proof‑of‑Memory** | Staked data is still available | Validator earns; missing blob → staker slashed to keep the network reliable | | **PoR – Proof‑of‑Recall** | Data returned matches CID | Caller pays fee; bad data → validator bounty for maintaining the ecosystem | Opt‑in _data staking_ lets users publish encrypted vectors and earn any time they fuel another agent **ZK notes (privacy & verification, optional/roadmap)** * **zk-PoM (Proof-of-Memory):** Prove a write matched a specific hash **without revealing the payload**. Great for “record exists & unchanged” attestations. * **zk-PoR (Proof-of-Recall):** Prove an authorized agent **accessed a Recall-CID under policy** (e.g., residency/EU-only) **without leaking content**. * **zk-PoC (Proof-of-Contribution):** Prove **who contributed which CIDs** to a result and that **royalty splits were computed correctly**, with only aggregate sums public. **Latency stance:** ZK runs on the **proof path (async)**—**no impact on** UX. *** ### Interop in the Lucid stack * [**Passports**](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data/lucid-passports-identity-and-ownership)\ Link memory namespaces to agent / asset identity. * **Lucid AI**\ Create, attach, and manage memory per agent. * [**Lucid Scan**](/knowledge/lucid-chain/architecture-how-lucid-works/lucidscan-internet-of-ai-explorer)\ Explore memory anchors, epochs, and proofs. * **SDKs / MCP**\ Read and write memory programmatically from any app or engine. *** ## Privacy & control * No raw data on-chain * Encrypted by default * Consent-first sharing * ACLs can be updated or revoked * Keys can be rotated * Right to forget is respected\ (delete or re-encrypt the off-chain blob; on-chain pointer becomes invalid) GDPR-friendly by design. **ZK future‑proof** – Roadmap adds zk‑SNARK redaction lets you prove possession without revealing the payload. *** ## One-minute mental model **Memory Map = filesystem for AI** * Folders = namespaces * Files = encrypted blobs * Index = content hashes * Log = Solana anchors * Finder = Lucid Scan *** ## **FAQ** **Q: Is this like a vector database?**\ A: No. It can connect to one, but Memory Map adds identity, permissions, portability, and proofs. **Q: Does memory slow down performance?**\ A: No. Hot memory stays local and cached. Anchors are async. **Q: Can I disable memory?**\ A: Yes Shadow mode keeps sessions stateless. **Q: Who owns the data?**\ A: The user or org. Always. **Q: Is memory shared between agents automatically?**\ A: No. Sharing is explicit, scoped, and logged. Memory Map is how AI stops forgetting.\ And starts behaving like a real, persistent actor on the Internet. - [Lucid Engine](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine): >- # Lucid Engine ## What it is The **smart engine for AI** — it picks the right brain and the right machine in real time, making answers fast, cheap, and provable. *** ## Cognition Router — Picks the Best AI, Every Time * Routes requests across GPT/Claude, open models, or decentralized markets. * Optimizes for quality, price, speed, and safety — per request. * Learns from outcomes to refine routes automatically. * Credits models and datasets that contributed to better results. > _Think: a savvy dispatcher that always sends your task to the best brain._ *** ## Fluid Compute — Instant, Reliable Power * Finds and scales the right GPU capacity across DePIN and cloud. * Meets your region, latency, and cost targets automatically. * Issues signed receipts for every run — verifiable in LucidScan. * Auto-pays compute providers once proofs are confirmed. > _Think: elastic, trusted GPU power that appears the moment you need it._ *** ## Why it matters * **Faster, cheaper AI** — stop guessing which model or GPU to use. * **Interoperable** — works in any app, any stack. * **Trust built-in** — every run leaves a proof. * **Fair** — contributors get paid instantly and transparently. *** ## How it works (3 steps) 1. **Route** — Cognition Router picks the best model for your task. 2. **Run** — Fluid Compute executes on the optimal node or cloud. 3. **Prove & Pay** — A signed receipt logs the run; contributors are rewarded automatically. *** ## Privacy & safety, simply * Hot path off-chain; only hashes and proofs land on-chain. * Region and policy enforcement (EU-only, CC-On GPUs, etc.). * No raw prompts, data, or outputs exposed — ever. *** ## **How It Fits** Engine powers **TrustGate** for enterprise SLOs (99.5–99.9% uptime + insurance).\ It also connects directly with **Data**, so agents keep memory, context, and payouts consistent across every app. *** ## TL;DR **Router** chooses the brain.\ **Compute** brings the power.\ Together, they make AI **fast, affordable, and provable — anywhere.** - [Cognition Router](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine/cognition-router): Picks best AI, every time # Cognition Router ### What Is the Cognition Router? The Cognition Router scores all available venues—GPT-class APIs, open models, and decentralized markets—on price, latency, accuracy, and trust. It then routes your request deterministically under a transparent policy. > **Think:** a public traffic cop for AI. One rulebook, same fairness for everyone.\ > Every choice is logged and auditable; payouts happen automatically. *** ### Why It Matters Different tasks need different brains—legal vs. gaming, cheap vs. perfect. The Router makes routing **transparent, tamper-resistant, and configurable per tenant**, while keeping UX **sub-100 ms**. | Pain without Router | Benefit with Router | | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | Hidden SaaS bias – platforms steer traffic to their own models | **Neutral marketplace:** formula and weights are public, upgradable ensuring top performances and fair competition | | Manual integration per model | **Plug‑and‑play:** register a `ModelMeta` PDA and you’re in the game, the Cogniton Router will update performances after each use | | No instant royalties | Winning model auto‑receives $LUCID in the same tx | | Opaque SaaS picks & hidden surcharges | Every routing decision is recorded on Solana, so anyone can verify fairness, costs and compliance. | *** ### How It Works 1. **Profiles:** Tenants define Policy Profiles (weights for cost, speed, accuracy, reputation). 2. **Models:** Each venue publishes a Passport (price, latency, domains, stake, safety). 3. **Scoring:** Router computes a deterministic score = θ • features(topic). 4. **Routing:** The top model under your policy runs instantly; result logged and paid out. 5. **Audit:** Validators recompute the arg-max and anchor the proof on-chain. **Proof-of-Contribution (PoC)** credits models and data that improved the result.\ Cheating = slashing; quality = reward. * **Validators** evaluate **PoC shares** for **models and data** that materially improved the result (e.g., Memory Map hits, retrieval signal, prior performance on the same topic). * PoC → **mGas splits** to: model provider, contributing data owners, and (optionally) evaluators. * **Misbehavior** (fabricated metrics, missed proofs, policy violations) triggers **slashing** of the model’s stake and reputation. *** ### Process flow 1. **Submit** `route_task{input_hash, task_type, topic, budget, profile_id?}`. 2. **Score** candidates using the **selected Policy Profile**; enforce residency/safety if present. 3. **Choose** `RouteChosen{model_id, policy_hash, fee}` → emitted on-chain; **mGas** escrow moves to model owner. 4. **Run** on the selected venue via **Fluid Compute** (with attestation if required). 5. **Receipt** (incl. policy hash, attestation quote, p95) is anchored; viewable in **LucidScan**. #### Policy Updates * Off-chain reinforcement learning (RL) refines θ-weights based on model performance (e.g., user ratings, latency). * Validators start using new weights next block. *** ### Benefits for Stakeholders | Stakeholder | Benefit | | -------------------- | ------------------------------------------------------------------------------------------------------------------- | | **Users** | Always the best AI response tailored to your needs (price/speed within budget) | | **Model publishers** | Fair competition on inference - Earn proportional to performance encouraging improvement; lie about stats → slashed | | **Developers** | Integrate the Router via APIs for dApps, enabling real-time AI (e.g., smarter chatbots, game NPCs). | | **Regulators** | Immutable logs prove no bias, no hidden fees—GDPR/CCPA friendly. | *** ### FAQ **Q:** Can policies differ per team/app?\ **A:** Yes—create multiple Policy Profiles and reference profile\_id per request. **Q:** Can a model fake its latency/price?\ **A:** Lies are slashable; benchmark oracles and live telemetry update ModelMeta. **Q:** What if two models tie?\ **A:** Deterministic tie‑break: lowest hash of (`model_id || slot`). **Q:** Do I have to use the router?\ **A:** No. Supply a fixed `model_id` in `route_task` and the router becomes a passthrough. *** **Next:** see [**Fluid Compute**](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine/fluid-compute) (attested placement) and [**Memory Map**](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data/memory-map-portable-memory) (portable, paid recall). - [Fluid Compute](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-engine/fluid-compute): Instant, reliable compute — with receipts. # Fluid Compute ## What Are Fluid Nodes? **Fluid Compute** is Lucid’s **DePIN orchestration layer for compute**. It finds, verifies, and scales the right GPUs across decentralized networks (and cloud fallback via [**TrustGate**](/knowledge/lucid-ai/trustgate-managed-inference-and-depins-orchestration)) to run your jobs **at Web2 speed**—then emits **signed receipts** (proofs) for audit, payouts, and compliance. > **Think:** A global render farm where every frame comes with a cryptographic receipt proving it was rendered correctly. ### What you get * **Instant, reliable compute** from DePIN + Lucid Cloud * **Enterprise knobs:** attestation, residency, **H100/H200 CC-On** attestation, p95 budgets, cost ceilings, fallback rules. * **Optional TrustGate:** 99.5–99.9% SLOs, **attested execution**, credits/insurance on breach. * **Stable performance:** dynamic node scoring + **Data Shield when using** [**TrustGate** ](/knowledge/lucid-ai/trustgate-managed-inference-and-depins-orchestration)(near-compute cache). * **Verifiable cost & provenance** (run receipts, model/container hashes, residency tags). * **Auto-scale & auto-pay:** device owners earn **iGas** when work is proven. * **Receipts by default:** per-run **Proof-of-Inference (PoI)** signed, then anchored on **Lucid Chain** (see **LucidScan**). *** ## Why They Matter DePIN has hardware; enterprises need trust.\ Fluid Compute turns scattered capacity into a predictable, verifiable service—no vendor lock-in, no latency roulette. | Pain without Fluid Node | Benefit with Fluid Node | | ------------------------------------------------- | ---------------------------------------------------------- | | Black‑box SaaS: can’t prove a model correctly ran | PoI receipts attest inference; slashable if false | | Centralized GPU supply & regional outages | Borderless marketplace—nearest node wins ↓ latency <100 ms | | Overspend on idle servers | Pay‑per‑token iGas only for work done | | Leaking proprietary weights | PoI verifies compute without revealing the model | *** ## How It Works Fluid Nodes are decentralized servers operated by individuals or partners that stake compute resources and register on [Passports](/knowledge/lucid-chain/architecture-how-lucid-works/lucid-data/lucid-passports-identity-and-ownership). They handle off-chain inference while Solana tracks their work for transparency. * **Inventory graph** continuously ingests capacity from **decentralized compute** + cloud pools.\ Tracks **price**, **p95 latency/jitter**, **failure rate**, **attestation support**, **jurisdiction**, **health**. * **Policy engine** evaluates per-request constraints:\ `eu_only`, `cc_on: true`, `max_cost_per_token`, `p95_budget_ms`, `fallback: cloud`. * **Scheduler** selects the best pool; can pin **single-tenant SXM** boxes for strict latency. * **Data Shield (optional with** [**TrustGate**](/knowledge/lucid-ai/trustgate-managed-inference-and-depins-orchestration)**)** mounts an S3-compatible **near-compute cache** (prefetch, dedup, TTL) to reduce egress and stabilize p95. * **Proof service** collects **attestation quotes**, **hashes**, **metrics** → signs **run receipt** → **Ledger-Batch** anchors root on **Lucid Chain**. * **Payouts**: validators confirm proof → device owners are paid **iGas**; (if via [**TrustGate**](/knowledge/lucid-ai/trustgate-managed-inference-and-depins-orchestration)) SLO watchdog issues **credits/insurance**. * **Scoring:** Performance metrics (e.g., accuracy, speed) and user ratings update reputations, ensuring fair competition. ### One-minute mental model Fluid Compute = **compute exchange + verifier + autopilot.**\ You set policy; it finds the right GPUs, runs fast, and proves what happened.\ **Speed like Web2. Truth like Web3.** ### Example Scenario > _“Ask the MOBA coach bot for mid‑lane strategy.”_ 1. Router picks gaming‑tuned model `m_gamma3` hosted by Node `gpu‑eu‑14`. 2. Node runs inference, returns answer in 82 ms. 3. PoI confirmed → Node earns 0.003 iGas; model publisher earns 0.002 mGas. 4. LucidScan shows uptime 99.8 %, latency 76‑88 ms, total earned 12 k iGas. ### Proof‑of‑Inference (PoI) – Quick View **Goal:** pay only for correct work, without leaking models or data. **Today (v1):** * Node commits to **model/container hash** and **layer-wise fingerprints** during run. * A **challenge window** verifies a random slice of computation (deterministically derived from receipt seed). * **Attestation** binds proof to the hardware (H100/H200 CC-On where required). * **Receipt** signed by node key + policy hash → anchored to Lucid Chain. **Why it’s hard to cheat:** * The challenged slice is unpredictable until commit; passing it effectively requires doing the work. * Signature ties proof to a staked identity; forged results ⇒ **slash & ban**. **Roadmap (v2):** Replace spot-check with **ZK proof** verifying selected kernel math **without re-execution**. **Why This Works** * The challenged slice is unpredictable to the node until commit time—cheating requires re‑computing the full layer. * Signature ties proof to the staked node; falsified proof ⇒ automatic slashing. * Model commitment hash protects proprietary weights; only a one‑way hash is revealed. Even if you’re not an ML expert, think of it like checking one random page of a 1 000‑page sudoku solution—the solver must have computed the whole puzzle to pass the spot‑check. *** ### Process flow (request → proof) 1. **Job arrives** (direct API or via TrustGate). 2. **Policy evaluated** (region, attestation, price/latency budgets, fallback). 3. **Placement** on a qualified pool; **Data Shield** mounted if enabled. 4. **Execution streams** tokens/results (Web2 speed). 5. The node submits a **Proof-of-Inference (PoI)**—a lightweight CUDA hash (zk-SNARKs planned)—to Solana. 6. Validators verify the PoI, triggering iGas payments to the node operator. 7. **Anchor** receipt root on **Lucid Chain** → **LucidScan**. 8. **Payouts**: device owners earn **iGas**; (if via TrustGate) **credits/insurance** apply on SLO breach. *** ### Benefits for Stakeholders | Stakeholder | Benefit | | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | **Users** | Get sub‑100 ms answers with transparent proof of computation | | **GPU operators** | Earn iGas for running inference, with stakes ensuring reliability and slashing for failures. | | **Developers** | Build dApps without spinning up infra—Lucid handles autoscale. | | **Regulators** | PoI logs prove compute & payments—GDPR‑friendly traceability. | | **Model publishers** | Focus on inference quality, leveraging Fluid Nodes’ scalable compute and shared Memory Map data. still earn mGas royalties via PoC | | **Validators** | Verify PoI, earn iGas share | *** ### Interop in the Lucid stack * **Cognition Router** (optional): pairs compute placement with **best model venue** (commercial APIs, self-hosted, decentralized markets). * **Memory Map** (optional): **portable, permissioned recall** using **Recall-CIDs**; receipts record reuse without exposing raw data. * **TrustGate** (optional): wraps Fluid Compute with **OpenAI-compatible endpoints**, **SLOs**, **attestation enforcement**, **insurance**. * **LucidScan:** explorer for receipts, attestation, payouts, reputation. *** ### FAQ **Q: Do I need TrustGate?**\ A: No. Fluid Compute runs standalone. Use TrustGate when you need **SLOs, insurance, and OpenAI-compatible endpoints** out of the box. **Q: Does PoI leak model weights?**\ A: No. We publish **commitments** (hashes), not weights. **zk-PoI** further avoids revealing any intermediate values. **Q: What happens if capacity is full?**\ A: The scheduler **queues** or (if enabled) **bursts to cloud** to protect SLOs. **Q: Can nodes collude to fake proofs?**\ A: Receipts bind identity + attestation; **challenges** and **ZK proofs** prevent collusion from passing without doing the work. Offenders are **slashed** and delisted. **Q: What do I integrate with?**\ A: Direct **HTTP/gRPC** to Fluid Compute, or **OpenAI-compatible** endpoints via TrustGate. - [LucidScan – Internet-of-AI Explorer](/knowledge/lucid-chain/architecture-how-lucid-works/lucidscan-internet-of-ai-explorer): Explore the whole AI ecosystem. See what happened — and who got paid. # LucidScan – Internet-of-AI Explorer ## **What It Is?** **LucidScan** is your window into the **AI economy.**\ Every agent, model, dataset, and compute node running on the **Lucid Chain** leaves behind a **verifiable trace** — an **Epoch Proof.** LucidScan turns those proofs into **clear, visual receipts** you can explore, audit, and trust.\ &#xNAN;_It’s the block explorer for the Internet of AI — simple, beautiful, and human-readable._ So anyone can: * **Search knowledge** (opt-in vectors, skills, agents, models), * **Verify runs** (attestation, policy, MMR roots), * **Track rewards** (PoC/PoI/PoM splits) — in real time **Think:** A search engine for AI intelligence, where you can see who shared what, how it’s used, and how much you’ve earned—all in one transparent place. *** ## Why It Matters Data in AI ecosystems is hidden and hard to track, leaving users in the dark. * **Transparency:** Every run, every payout, every contributor visible and verifiable. * **Trust:** Enterprises and regulators can confirm lineage, latency, and cost. * **Reputation:** Builders, models, and nodes build on-chain credibility. * **Incentives:** Contributors get paid automatically; users can see who powered what. * **Exploration:** * **Make Data Discoverable** – Anyone can query “gaming tactics reused > 10×” and instantly pull vectors to fine‑tune or feed their agent. * **Foster Growth** – Models like GPT‑4 can tap the shared pool via the API → collective intelligence snowballs. LucidScan closes the loop between **AI execution** and **AI accountability.** *** ## **What You Can See** | Category | Example | Description | | ------------------ | --------------------------------------------- | -------------------------------------------------------------- | | **Runs** | `#EPOCH-5b67ac` | Every model or agent execution; signed and time-stamped. | | **Proofs** | Policy: EU-only · p95: 84ms | Verifiable performance, region, and policy checks. | | **Agents** | “Concierge v1.3” | Metadata, memory namespaces, channels, and version history. | | **Models** | GPT-4-class / Mistral / Llama | Source, license, price, latency, and Router performance. | | **Data Sources** | “Lore Index v0.4” | Provenance, license (CC/CC-BY/Commercial), contribution share. | | **Compute Nodes** | `FluidNode-12` | Provider, region, latency, uptime, and payout stats. | | **Payouts** | iGas → Model: 42%, Compute: 28%, Builder: 30% | Revenue split per run or batch. | | **Thought Epochs** | #120481 · 2025-10-27 | Aggregated proofs (hourly/daily), like AI time capsules. | #### **Core Metrics** * **Proof Rate:** % of runs with valid proofs. * **Hot Path p95:** Average latency per policy region. * **Router Win Rate:** Performance delta between manual vs auto-routed models. * **Top Models / Agents / Nodes:** Ranked by usage, latency, revenue, or satisfaction. * **24h Payout Volume:** Total iGas distributed. * **Carbon & Energy Footprint:** Estimated per run (for sustainability reports). *** ## How It Works LucidScan **indexes**: * **On-chain events** on **Lucid Chain** * `thought_epoch.commit` (batch summaries / MMR roots) * `router.route` (chosen venue, policy hash, latency/cost metrics) * `fluid_compute.attest` (NRAS/nvtrust quotes, pool ID) * `payout.split` (PoC/PoI/PoM distributions) * **Off-chain metadata** (when shared) * **Memory Map** descriptors: Recall-CIDs, namespaces, ACLs, tags * **Data-Shield** usage stats (cache hits, egress saved) All records are **cryptographically linked** back to on-chain roots; private payloads stay off-chain. #### **For Builders** * **Proof Dashboard:** View receipts, costs, and payouts per Agent or App. * **Reputation Graph:** See who uses your models, tools, or datasets — and how often. * **Export Reports:** CSV/JSON/attested PDFs for clients, regulators, or investors. * **Webhooks:** Stream proof events directly to your analytics or billing system. #### **For Enterprises** * **Compliance Mode:** Audit runs by license, policy, or jurisdiction. * **Proof Bundling:** Aggregate 10k+ runs under a single signed Thought Epoch. * **Residency Filters:** Prove data never left EU or other regions. * **SLA Validation:** Cross-check latency, uptime, and insurance coverage. *** ### What You Can Do (examples) * **Search memory:** “`namespace:gaming` reuses>10” → get popular vectors/skills. * **Validate runs:** open a **Thought Epoch** → verify **attestation** + policy hash. * **Follow the money:** open a conversation receipt → see **auto-splits** to data/model/compute. * **Pick suppliers:** compare **agent/model/GPU** reliability & p95 across venues. * You search the dashboard for “popular game tactics,” finding shared data and its reuse history. *** ### Stakeholder Benefits | Role | How LucidScan Helps | | -------------- | ------------------------------------------------- | | **Builder** | Audit usage of your agent, model, or dataset. | | **Enterprise** | Verify SLA compliance for AI services. | | **DePIN Node** | Track latency, uptime, and earned iGas. | | **Regulator** | Confirm policy adherence and proof of reasoning. | | **Investor** | Monitor AI usage growth and revenue distribution. | *** #### **Integrations** * **Lucid OS Dashboard:** Proofs and payouts surfaced directly in Synapse. * **Slack / Discord Alerts:** Automated notifications on SLA breach or payout received. * **API & Webhooks:** `/api/proofs/:id`, `/api/payouts/:wallet`, `/api/epochs`. * **Partner Ecosystem:** Connects with DePIN dashboards and cloud observability tools. *** #### **Why LucidScan Exists** AI will power the next global economy — but without transparency, it becomes untrustable.\ LucidScan ensures every action, every inference, and every transaction in the AI world is **provable, auditable, and fair**. **No more black boxes.**\ **LucidScan makes AI accountable.** - [Thought Epochs— Verifiable Proofs of AI Activity](/knowledge/lucid-chain/architecture-how-lucid-works/thought-epochs-verifiable-proofs-of-ai-activity): Why users see answers in under 100 ms while Solana still sees everything. # Thought Epochs— Verifiable Proofs of AI Activity ## What Is a Thought Epoch? A **Thought Epoch** is a compact, verifiable “receipt” of everything an AI did over a short burst of reasoning — a chat turn, a tool call, a scene generation, or a few seconds of autonomous flow. Each epoch captures: * **What ran** (model, tools, memory reads/writes) * **Where it ran** (compute venue, attestation, region) * **Who contributed** (models, datasets, compute, builders) * **What it cost** (tokens, gas, latency) Lucid compresses all of this into a **Merkle root** — a single hash anchored to the **Lucid Chain** —\ so the full process stays fast and private, while the proof stays public and permanent. > **Think:** Instead of logging every detail on-chain, you zip the folder and timestamp its checksum. *** ## What you get * **Auditable AI** without leaking raw data. * **Portable, provable memory** across agents/apps (ties into **Memory Map**). * **Automatic revenue sharing** based on verifiable reuse (PoC / PoI / PoM). * **Compliance-ready logs** (AI Act/GDPR reporting) with deterministic references. * **Vendor freedom** (works with GPT/Claude/open models via Router/TrustGate). * **Privacy**: raw content stays off-chain; you can prove inclusion with a Merkle proof. * **Speed**: interactive UX **<100 ms**; anchoring is **asynchronous**. *** ## Why It Matters Putting every token or API call directly on-chain kills performance.\ Doing nothing leaves AI opaque and unaccountable. **Thought Epochs split the difference**: * 🔥 **Hot path:** Inference and tool calls happen off-chain at web speed. * 🔒 **Proof path:** A single cryptographic receipt is anchored asynchronously. This makes AI **auditable, portable, and profitable** — without breaking UX. | Pain without Epochs | Benefit with Epochs | | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | 1000s of slow & expensive on‑chain writes per chat |

Batching reduces on-chain transactions: One 32‑byte root per session ↘ gas 99 %.
Heavy blobs stay off‑chain; chain stays lean

| | UX blocked by chain finality | **Keeping AI Lightning-Fast:** Answers stream in real time (<100 ms) with no delays from blockchain commits | | Opaque AI behaviour | **Ensuring Trust:** Every action, data/model used hash‑stamped → full audit & GDPR/CCPA‑ready compliance in one root | | Isolated Silos | **Enabling Collaboration**: Captures shared data references, letting all models learn from the same knowledge pool | *** ## How It Works Thought Epochs bundle three key elements of an AI’s “thinking moment” into a single on-chain record * **Collect**: During a short window (e.g., one request or a rolling N seconds), the agent records _what it did_: model → output, tools it called, memory reads/writes, costs, and venues. * **Hash & bundle**: Each event becomes a leaf; Lucid computes a **Merkle-Mountain-Range (MMR)** over the batch. * **Anchor**: Only the **MMR root** + tiny metadata (policy hash, residency/attestation flags, cost tallies) is written on-chain. * **Store**: The full trace and artifacts (redacted/encrypted) live off-chain on decentralized storages; pointers (Recall-CIDs) are referenced in **Memory Map**. * **Prove**: Anyone with the leaf + Merkle proof can verify it belongs to that epoch root. * **Pay**: Lucid’s payout engine uses the epoch to **split $LUCID rewards** to data/model/compute contributors ([Dual-Gas economics](/knowledge/lucid-chain/architecture-how-lucid-works/dual-gas-economics)). ### **One-Minute Mental Model** > Every AI interaction is like a flight.\ > You experience it in real time — smooth, fast, invisible.\ > Later, the airline files a **flight record** (route, cost, aircraft, timings).\ > A Thought Epoch is that record for AI —\ > A signed, chain-anchored proof of what flew, where, and who earned from it. ### **Why Builders Love It** | Feature | Benefit | | --------------- | ------------------------------------------------------- | | **Transparent** | Each run has a cryptographic receipt. | | **Private** | Raw data stays encrypted; only hashes go on-chain. | | **Fast** | Proof generation is async; no latency penalty. | | **Fair** | Contributors (data, models, compute) are auto-rewarded. | | **Portable** | Works across any app, agent, or model. | *** ## **Stakeholder Benefits** | Stakeholder | What They Get | | ------------------------ | ----------------------------------------------------- | | **Users / Creators** | Transparent reuse & automatic rewards for their data. | | **Developers / Studios** | Audit-ready logs without managing infra. | | **Validators** | mGas rewards for verifying epoch roots. | | **Enterprises** | GDPR/AI Act-compliant audit trails. | | **Regulators** | Deterministic, data-minimized visibility. | *** ## **Interoperability in the Lucid Stack** * **Memory Map** → Thought Epochs link Recall-CIDs for provable memory reuse. * **Cognition Router** → Logs model choice, cost, and latency per epoch. * **Fluid Compute** → Adds attestation & SLO metrics for verifiable performance. * **LucidScan** → Displays roots, proofs, and payout splits. * **Dual-Gas System** → Epochs meter both mGas (proof/memory) and iGas (compute/payouts). *** ## **Security & Privacy** * Only **hashes and metadata** are public. * All sensitive data stays **encrypted off-chain**. * Epochs are **immutable** and versioned for replayability. * Auditors can reconstruct full traces with access permissions. *** ## FAQ **Q: Is this putting AI on-chain?**\ **A:** No. It puts **proofs** on-chain — not prompts, outputs, or data. **Q: Can I verify a tool call happened?**\ **A:** Yes. Each tool call is a leaf; you can verify its inclusion cryptographically. **Q: What if anchoring fails?**\ **A:** Lucid retries automatically; if policy demands, it re-anchors via a fallback chain. **Q: Does it leak private data?**\ **A:** No. Only hashed summaries; raw data stays encrypted and permissioned. **Q: How are rewards calculated?**\ **A:** Epochs encode contributions from models, data, and compute → split via **Dual-Gas** rules. **Q: What’s the difference vs. normal logs?**\ **A:** Normal logs are mutable and private. **Thought Epochs are cryptographically committed and universally verifiable**. - [Competition Landscape – Where Lucid Fits (and Why It’s a Must-Have)](/knowledge/lucid-chain/competition-landscape-where-lucid-fits-and-why-its-a-must-have): >- # Competition Landscape – Where Lucid Fits (and Why It’s a Must-Have) ### Before we compare: obvious truths we’re built on Most “AI × crypto” projects today: * **Do one slice only** — GPUs, inference, _or_ an agent marketplace. * **Over-onchain everything** — pushing bulky data/steps on-chain and killing latency. * **Fight Web2 AI head-on,** add frictions to be used at scale (make you switch tools and learn new habits). ### What Lucid is (and isn’t) * **We don’t compete with Web2 AI—we amplify it.**\ Lucid runs _under the hood_ of GPT-class systems (and open models), adding **verifiable memory, routing, and fair rewards**—with **no vendor partnership required**. Result: **smarter, cheaper, faster** AI that keeps Web2’s quality/availability _and_ Web3’s **ownership & provenance**. * **We unify fragmented Web3 AI into one performant layer.**\ Today’s compute networks, data lakes, and agent markets are powerful but siloed. Lucid is the **orchestration layer** that stitches them into a single, low-latency stack. * **Only what’s needed goes on-chain.**\ Sub-100 ms answers off-chain; **asynchronous on-chain proofs** for auditability and payouts. We make the **whole** greater than the sum of the parts—and finally solve Web2’s trust and data-ownership pain points.\ Start instantly via the **Lucid App** or B**rowser Extension**, and use your favorite Web2 AI.
### Complementarity at a glance (not replacement) | Category | Example players | How Lucid complements (not competes) | | ------------------------------ | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Compute / GPU** | io.net, Akash, Render | Lucid’s **Fluid Nodes** can route workloads to these networks; **PoI** adds verifiable inference + instant payouts. | | **Model / Agent networks** | Bittensor, SingularityNET, Fetch.ai, Virtuals | **Cognition Router** selects the best model/agent; **Memory Map** gives shared context; Lucid pays royalties via **PoC**. | | **Data / Knowledge / Index** | Grass (crowd data), Kaito (search/QA) | **Memory Map** unifies recall, provenance, and rewards; **LucidScan** explores usage. We can **ingest/anchor** their data (we don’t force “all on-chain”). | | **Chains / L1s / Abstraction** | NEAR | We’re the **AI runtime layer**; they’re settlement/abstraction rails. Lucid anchors proofs on blockchain and can interop with NEAR-style chain abstraction. | | **Media / Edge networks** | AIOZ Network | Lucid agents **use** these for delivery/streaming; proofs + payouts still handled by Lucid. | *** - [FAQ (Non-Technical)](/knowledge/lucid-chain/faq-non-technical): >- # FAQ (Non-Technical) ### Basics **What is Lucid Chain in one sentence?**\ An open, blockchain-based layer that gives AI agents (and apps) a verifiable identity, shared memory, transparent rewards, and an audit trail—without slowing the user experience. **Is Lucid Chain required to use Lucid AI?**\ No. You can keep everything off-chain. Lucid Chain is **opt-in** and can be turned on per agent, feature, or environment. **Is Lucid Chain open source and free?**\ Yes. The protocol, on-chain programs, and schemas are open. Using the chain itself is free; you only fund tiny gas fees when you enable on-chain features. **Which blockchains are supported?**\ **Solana** and an **Ethereum** for identity/wallet anchoring. *** ### What It Adds (in human terms) **Identity for agents and models**\ Each agent/model can have a cryptographic ID (a “passport”) and optional wallet, so it can be recognized across Discord, X, Telegram, Unreal, and more. **Memory that survives sessions**\ With consent, important moments are committed as small, verifiable records (“Thought Epochs”). Apps can recall them later for continuity—without exposing raw data. **Fair rewards**\ When your data or model is reused (if you opt in), the protocol splits fees to contributors automatically and shows the trail in **LucidScan**. **Trust & compliance**\ Every important decision can leave a tamper-proof footprint (what model, what data bucket, which node), helping with audits and safety reviews. *** ### Speed & UX **Will blockchain make my app slow?**\ No. Replies stream in real time (<100 ms target). On-chain commits and payouts settle **asynchronously** in the background. **What happens if I keep using the ChatGPT/Gemini UI?**\ That UI stays the same. If you opt in, Lucid can mirror those chats to Thought Epochs and index them in LucidScan for rewards/compliance. **No routing happens** inside those UIs. *** ### Privacy & Data Control **Do you put my content on-chain?**\ No. Raw prompts, files, embeddings, audio/video, and model weights **never** go on-chain. The chain stores tiny hashes/pointers and usage proofs. **If I “stake” data, does it become public?**\ Only if you choose. You can: * keep it **private & encrypted** and license access, * share **partially** (redacted), or * make certain datasets **public** for discoverability.\ Lucid supports “bring-the-model-to-the-data” so raw content can stay in your vault. **Can I revoke or delete later?**\ Yes. You can withdraw pointers, stop sharing, or keep everything off-chain. Hashes remain for audit, but access to the underlying data is under your control. *** ### Payments & Costs **How do I pay for on-chain things?**\ You can pay **in fiat or crypto**. The SDK handles on-ramp and funds your small gas reserve under the hood. **What are mGas and iGas? (Do I need to care?)** * **mGas** covers memory/routing/proofs (tiny writes). * **iGas** maps to compute used by decentralized nodes.\ Most teams just see a simple receipt; the SDK manages the details. **If I use my own OpenAI/Anthropic key, do I pay twice?**\ No. You pay your vendor for tokens, and pay Lucid a small platform fee for orchestration/logging (if you use Studio). On-chain gas is separate and minimal when enabled. *** ### Security & Integrity **How do I know an answer was really computed?**\ Lucid uses **Proof-of-Inference (PoI)**: nodes attach a lightweight proof with each result; dishonest nodes are **slashed**. Data availability is checked by **Proof-of-Memory (PoM)**. **Who holds keys and wallets?**\ You decide. Use managed keys for ease, or BYO custody for full control. Enterprise can deploy in a private VPC. **Audits and safety?**\ Smart contracts are audited; every critical event is visible in **LucidScan**. You can run in “Shadow Mode” (off-chain) while testing. *** ### Interoperability **Do you compete with GPT/Claude/Gemini?**\ No. Lucid makes **all** models better together. Models compete on inference quality/cost while sharing an optional, consented memory layer. **Can agents act on-chain (send transactions, read game economy state)?**\ Yes. Agents can read chain data (prices, inventories, game state) and execute signed transactions—**all behind the scenes** with clear policies and limits. *** ### Getting Started **Easiest path to try it?** * Launch an agent in Studio **without** on-chain, * Flip **On-Chain** for identity/memory when ready, * Watch commits and rewards in **LucidScan**. **Can we adopt just one feature?**\ Absolutely. Many teams start with audit logs (Thought Epochs) or rewards, then add identity or shared memory later. *** ### If you only remember three things 1. **Optional**: Lucid Chain is opt-in; your UX stays fast. 2. **Private by default**: hashes on-chain, raw data stays off-chain. 3. **Open & fair**: open protocol, transparent rewards, you stay in control. - [Security & Privacy – Keeping Lucid Safe & Compliant](/knowledge/lucid-chain/security-and-privacy-keeping-lucid-safe-and-compliant): Threat‑model, cryptography, compliance tooling, and user‑control features. # Security & Privacy – Keeping Lucid Safe & Compliant Lucid L2’s security and privacy model is a robust framework that protects user data, ensures trustworthy AI operations, and meets global compliance standards like GDPR and CCPA. It uses cryptographic proofs, staking, and zero-knowledge technology to keep the ecosystem safe, transparent, and user-controlled. Letting AI agents act as on-chain citizens with verifiable actions. ### Why It Matters In AI ecosystems, data breaches, unverified computations, and regulatory hurdles can erode trust and limit adoption. Lucid’s model addresses four recurring pain‑points: 1. **Privacy** – raw data never leaks: vectors stay AES‑encrypted off‑chain; only hashes hit Solana. 2. **Integrity** – every inference and storage claim is provably correct via PoI / PoM. 3. **Fair Rewards** – PoC splits are enforced atomically; no middle‑man can skim. 4. **Compliance** – complete, tamper‑proof audit trails shorten GDPR / CCPA response time from weeks to minutes. ### How It Works Lucid’s model combines on-chain security with off-chain privacy, leveraging Solana’s features for a balanced approach: * **Privacy Mechanisms**: * **Zero-Knowledge Proofs (ZK-SNARKs)**: Encrypt data off-chain while proving its validity on-chain (full rollout in Q3 2025). For example, a Thought Epoch commit can hide sensitive details but verify existence. * **Opt-In Staking**: You control what data to share via the browser extension; non-shared data stays encrypted in the Memory Map. * **Off-Chain Storage**: Raw vectors in secure, decentralized networks (IPFS/Arweave), with only hashes on Solana PDAs. * **Security Mechanisms**: * **Proof-of-Inference (PoI)**: Fluid Nodes verify computations with CUDA hashes (ZK upgrades in Q3 2025), preventing fake results; invalid proofs lead to slashing. * **Proof-of-Memory (PoM)**: Validators check staked data availability in the Memory Map; failures slash stakes to ensure reliability. * **Proof-of-Contribution (PoC)**: Smart contracts automatically pay royalties for data/model reuse, logged on-chain for audits. * **Staking and Slashing**: Node operators and validators stake $LUCID equivalents; dishonest actions (e.g., failed PoI) result in slashes, aligning incentives. * **Compliance Tools**: * **Audit Trails**: Every action (e.g., routing, inference) is logged via Thought Epochs and viewable on LucidScan, providing tamper-proof records. * **Right to Forget**: Users can withdraw staked data, erasing on-chain pointers while preserving ecosystem integrity. * **Hybrid Design**: On-chain hashes for verifiability; off-chain encryption for privacy, balancing speed and security. *** ### High‑Level Threat Model | Asset | Threat | Mitigation | Residual Risk | | ------------------ | --------------------------- | --------------------------------------------------- | ------------- | | Inference result | Malicious node fakes output | **PoI** + 5‑10 % stake slash | Low | | Stored vector | Data loss / tamper | **PoM** + redundant IPFS/Filecoin copies | Low | | Private embeddings | Data leakage | AES‑256‑GCM client‑side; CID only hash | Very Low | | Reward flow | Double‑spend / unfair split | Atomic fee‑split in one TX | Very Low | | Router decision | Biased pick | Deterministic θ policy in PDA; non‑arg‑max rejected | Low | *** ### Privacy & Security Toolkit | Layer | Tech | Status | | ----------------------------- | ------------------------------------ | --------------- | | Data‑at‑rest | AES‑256‑GCM | Live | | Data‑in‑transit | TLS 1.3 + secure WS | Live | | ZK‑SNARKs (vector possession) | ZQP‑v0.1 | Testnet Q4 2025 | | ZK‑Query (range proofs) | Reuse‑count proofs | Roadmap Q2 2026 | | Opt‑in anonymisation | k‑anonymity buckets | Live | | Right‑to‑Forget | Unstake vector → destroy PDA pointer | Live (beta) | ### Attacks & Mitigations Matrix | Vector | Likelihood | Impact | Guardrail | | ---------------------- | ---------- | ------ | ------------------------------------------ | | Forged PoI | Medium | High | Multi‑sig validator sampling + stake slash | | Epoch censorship | Low | Medium | Alt‑PoM & economic liveness guarantee | | Rogue admin dumps logs | Low | High | No raw logs; SOC‑2; SSO only | | IPFS pin loss | Med | Low | Redundant pinning + PoM challenge | *** ### Compliance Toolkit | Feature | Benefit | | ------------------------- | ----------------------------------------------------- | | **Regulatory Audit Pack** | One‑click PDF/JSON: CID → root → payment trail | | **Scoped API Keys** | Give auditors read‑only access to specific namespaces | | **Right‑to‑Forget** | User can burn PDA pointer; encrypted blob orphaned | | **GDPR Article 30 Map** | Export processing activities in < 60 s | _Zero raw text is exposed—only hashes, proofs, and high‑level metadata._ *** ### Summary Cheat‑Sheet * **Raw data off‑chain** – only hashes on Solana. ✅ * **Provable integrity** – PoI, PoM, deterministic router. ✅ * **Economic enforcement** – stake slashing drives honesty. ✅ * **GDPR ready** – audit pack + right‑to‑forget. ✅ _Security is baked in, not bolted on—keeping Lucid AI trustworthy at global scale._ - [Tokenomics & Incentives – Fueling the Lucid Ecosystem](/knowledge/lucid-chain/tokenomics-and-incentives-fueling-the-lucid-ecosystem): >- # Tokenomics & Incentives – Fueling the Lucid Ecosystem **$LUCID reroutes what used to be a single, centralized SaaS fee into a trustless on‑chain split for all stakeholders—data owners, model publishers, node operators, validators, and the treasury.** ### Why They Matter AI ecosystems often fail to reward users or fairly compensate contributors, leading to centralized control and mistrust. Lucid’s tokenomics and incentives solve this by: * **Empowering Users**: Earn $LUCID by sharing data (e.g., chats, game strategies) that any model can reuse, with full control and privacy. * **Rewarding Creators**: Pay model developers and node operators for their work, encouraging better AI and compute efficiency. * **Driving Collaboration**: Align incentives so all participants—users, models, nodes—grow the ecosystem together through shared knowledge. * **Ensuring Fairness**: Transparent, on-chain payments and slashing mechanisms prevent abuse and build trust. ### How It Works The $LUCID token powers all transactions in Lucid’s ecosystem, split into mGas (memory) and iGas (compute) to align costs with contributions. Smart contracts automate rewards via **Proof-of-Contribution (PoC)**, ensuring fairness across the network. **Key Components**: * **$LUCID Token**: The native token, convertible to mGas and iGas, used for all payments (e.g., data staking, inference, validation). * **Proof-of-Contribution (PoC)**: Automatically rewards data providers and model creators with mGas when their contributions are reused by any model. * **Staking and Slashing**: Contributors (nodes, validators) stake $LUCID to participate; dishonest actions (e.g., failed Proof-of-Memory or Proof-of-Inference) result in slashes to ensure reliability. * **Fee Splits**: Payments are distributed transparently, e.g., 50% to contributors (data/models), 30% to validators, 20% to the Lucid treasury for ecosystem growth. | Ticker | Role | Supply Model | Primary Sink | | ---------- | ---------------------------------- | ----------------------------------------------- | ------------------------------------------------- | | **$LUCID** | Settlement base‑token | Fixed ⁄ 1 B hard‑cap | AMM swaps for mGas/iGas; buy‑back & burn treasury | | **mGas** | Memory operations (on‑chain state) | Fixed genesis pool ⁄ 10 B | Burned on each PDA write & PoM verify | | **iGas** | Inference compute (GPU work) | Elastic; minted on demand, auto‑burned post‑PoI | Burn at PoI settlement | > **Analogy:** $LUCID ≈ ETH; mGas ≈ block‑space tokens; iGas ≈ metered CPU cycles. #### Fee Abstraction & Fiat On‑Ramp Lucid is designed to live **under the hood** of existing AI products—users swipe a card, dApps handle the token plumbing. | Step | What end‑user sees | Under the hood | Token impact | | ---------------------- | ------------------------------ | ---------------------------------------- | --------------------------------------------------------------- | | 1. Pay in fiat / SOL | $0.02 charge for an "AI reply" | SDK calls on‑ramp (Stripe, Circle) | Fiat/SOL → $LUCID at DEX spot | | 2. Auto‑convert to gas | — | Relayer swaps $LUCID → exact mGas & iGas | Provides real demand for $LUCID liquidity | | 3. Execute task | Instant response | Router + Fluid Node burn gas | Burns iGas 100 %, slices mGas | | 4. Split fees | — | PoC / PoI / Treasury split | Distributes what was a central SaaS fee to **all stakeholders** | > **Utility recap:** Every dollar that once went to a single SaaS now flows through $LUCID and is split on‑chain between data owners, node operators, validators, and the treasury. ### Genesis Allocation of $LUCID (1 B)
Category%CliffVesting
Protocol Treasury20 %Unlocked
Community & Rewards20 %Unlocked
Ecosystem Fund (Validator Incentive, dApp grants)15 %3 mlinear 2 y
Strategic Partners & Studios12 %6 mlinear 2 y
Core Team / Foundation20 %12 mlinear 24 m
Investors10 %6 mlinear 24 m
Cliff and vesting handled by on‑chain **Vesting Escrow** program. *** ### Emission & Burn Loops ``` graph LR subgraph Spend U(User) -- buys iGas/mGas --> AMM AMM -- burns mGas --> Burn FN(Fluid Node) -- burns iGas --> Burn end subgraph Earn DC(Data Contributors) -- PoC rewards --> mGas MP(Model Publishers) -- Router sel. --> mGas FN -- PoI reward --> iGas Val(Validators) -- fees --> mGas/iGas end Burn --> Treasury ``` * **iGas** minted when user funds compute → 100 % burned after PoI settle. * **mGas** is fixed; each write burns a small %, creating deflation. * **Treasury buy‑back**: 30 % of protocol fees auto‑swap SOL → $LUCID and burn, tightening supply. *** ### Incentive Breakdown per Transaction | Actor | Paid In | Source | % | | ------------------------ | --------- | ---------------------- | ---- | | Data / Model Contributor | mGas | User spend (PoC split) | 40 % | | Fluid Node Operator | iGas | User spend (PoI split) | 45 % | | Validators | mGas+iGas | Execution tips | 10 % | | Protocol Treasury | mGas+iGas | Sustainability fee | 5 % | *** ### Staking & Security | Stakeholder | Stake Token | Purpose | APR Source | | ------------ | ------------------------- | ----------------------------------------------- | ------------------------------ | | Validators | mGas + $LUCID | Secure block‑production & PoI/PoM verifications | Block rewards + execution tips | | Fluid Nodes | $LUCID | Collateral against fake PoI | PoI rewards – risk‑weighted | | Data Stakers | Vectors + optional $LUCID | Earn PoC royalties; higher stake ↑ ranking | PoC share | Slashing: 10 % for invalid PoI, 5 % for unavailable vector (PoM), 100 % for double‑sign. *** ### Economic Sustainability Projections (Illustrative) | Year | Active Agents | Monthly iGas Burn | Monthly mGas Burn | Protocol Buy‑back ($LUCID) | | ---- | ------------- | ----------------- | ----------------- | -------------------------- | | 2025 | 50 k | 25 M | 6 M | 1.2 M | | 2026 | 250 k | 120 M | 25 M | 6 M | | 2027 | 1 M | 450 M | 80 M | 18 M | Assumes avg 0.9 iGas / call, 4 calls / user / day, 5 % protocol fee. *** ### Summary Cheat‑Sheet * **Dual‑asset:** mGas fixed, iGas elastic, both settled in $LUCID. ✅ * **85 % fees → workers:** ensures alignment & growth. ✅ * **Deflationary pressure:** burns on mGas writes + treasury buy‑backs. ✅ * **Staking for trust:** PoI, PoM. ✅ _Tokenomics designed for long‑term sustainability and fair upside for every participant._ - [Two Products, One Ecosystem](/knowledge/lucid-in-one-breath/two-products-one-ecosystem): Lucid connects the Internet of AIs with the tools to build on it. # Two Products, One Ecosystem Lucid connects the **Internet of AIs** with the **tools to build on it.**\ Together, **Lucid Chain** and **Lucid AI** form a unified stack — where intelligence, memory, and compute are interoperable, auditable, and rewardable.
## Lucid Chain — The Internet of AIs **The decentralized brain that links all intelligent systems.** Lucid Chain is the **L2 fabric** where AIs, data, and compute coordinate — giving every model, agent, and dataset a verifiable identity, portable memory, and fair economics. #### **Lucid Data:** The Graph - Gives AI stakeholders an ID and a Shared Memory * **Passports:** Issuing Digital Citizenships * **Memory Map**: Portable Memory Vault #### **Lucid Engine:** The Machine - Turn scattered AIs & decentralized computes into one smart, fast engine. #### **Thought Epochs**: Batch AI actions into low-cost, fast & auditable commits. #### **LucidScan**: Internet of AI Explorer - Makes the AI ecosystem’s open and searchable. **Result:** very AI becomes self-improving — sharing intelligence, competing on performance and cost, while users and contributors earn on reuse.\ **Regulators** get an open audit trail. **Builders** get composable, trustworthy infrastructure. **Who use it?** Validators, infra providers, compliance teams, open-source devs. ## **Lucid AI** — Build & Operate on the Internet of AI. Enterprise-grade. **The operating layer for creating, deploying, and scaling intelligent systems.**\ Lucid AI turns the Lucid Chain’s decentralized infrastructure into a seamless, enterprise-ready builder stack. Turning your words into fully deployable agents — connected to data, compute, tools, and blockchain.\ In seconds, you can go from _idea → AI product_ — with identity, memory, proofs, and payouts built in. You can build anything — from a trading AI reading on-chain liquidity, to a storytelling NPC pulling live lore, to a customer assistant that remembers and rewards users across apps.\ All without writing a line of backend or smart-contract code. #### **Synapse** * No-code workspace to design and deploy agents or apps in one prompt (like Canva for AI). * **Connector Hub:** 500 + integrations to DePINs, web2/3, chain, and game ecosystems. #### **TrustGate™** Managed inference layer with attestation, SLOs, and insurance. #### **DevKit & AR** Open-source SDKs + runtime for full control and local execution. **Result:** Ship interoperable, verifiable AI products at Web2 speed with Web3-grade integrity. Who use it? dApp builders, game studios, social-bot creators, enterprises, indies. - [What is Web4](/knowledge/lucid-in-one-breath/what-is-web4): Symbiotic Web. The living interface between humans and machines. # What is Web4 The _symbiotic web_ where autonomous AI acts on your behalf across apps, chains, and devices—without sacrificing speed or user control.
### Why it matters * **Memory:** AIs Remembers you across apps * **Emotion:** Understands feelings — tone, mood, intent. * **Personalization:** Adaptive experiences (edu, shopping, gaming) * **Trust & Ownership:** You’re in control — your data, your privacy, your rewards. ### Pillars of Web4 * **Autonomous & Emotional AI** — Proactive AI that learn, help, and feel more human. With their own identity & capital. * **Interoperability** — You own your data; actions leave clear, auditable trails * **Decentralization** — You own your data; actions leave clear, auditable trails * **Virtual Worlds & Humans** — AR/VR and lifelike characters you can meet, play, and work with. ### How Lucid enables Web4 * Make the AI Digital Nation of AIs * Makes AI trustworthy & fair * Powers AI-driven digital realities with IRL impact > ⚡ All of this at instant speed for human-like emotional AI - [The Internet of AI (IoAI)](/knowledge/overview): Web2 Speed · Web3 Trust · Web4 Intelligence # The Internet of AI (IoAI) ## One Liner **The hyperscalable layer for interoperable, decentralized AI (DeAI)** —\ where memory travels, actions are provable, and contributors get paid — in < 100 ms.
## The Missing Layer - Why interoperability matter? AI is exploding — but it’s also **splintering**. Every model, compute, dataset, and app is its own island. They don't speak the same language, can’t share memory, and can’t prove what they do. Web2 is fast but closed. Web3 is open but fragmented. Builders need all, Web4 interoperability. Lucid exists to fix that to lets them finally work together as **on-chain citizens in the digital nation of AIs.**\ It connects identity, memory, and payments — so every AI asset can **prove what it did**, **share what it knows**, and **earn when reused**. | What’s Missing | What Lucid Adds | Why It Matters | | -------------- | ----------------------------------- | ------------------------------------- | | **Identity** | Passports for AIs, agents, and data | Proven ownership and reputation. | | **Memory** | Portable Memory Map | Agents can recall safely across apps. | | **Trust** | Thought Epochs (Proofs) | Verifiable reasoning & transparency. | | **Payment** | iGas + Automatic Splits | Every contributor gets rewarded. | We don’t replace Web2/3 AIs — **we connect and supercharge them** without changing your workflow.\ Your apps stay fast.\ Your AI becomes smarter, cheaper, auditable, and massively scalable.
Pain → Lucid FixHowInstant Payoff

🔗 No Interoperability

→ Internet of AI

One universal switchboard + shared memory + on-chain identities so AI, DePINs, and apps speak the same language.AI ecosystem is standardized & connected, All models learn from the same pool, collaborate & compete.

Unfair economics

→ Fair Rewards

We track who contributes (data, models, compute) and split earnings automatically. + Data StakingUser empowered. Stake & Start earning rewards day 1

🧠 Amnesia & Isolation

→ Shared Memory

Decentralized Knowledges Graph — encrypted user-owned data. Portable memory & reputationAI remembers across apps and learns from other agents, Retention 3×

🔍 Black-Box AIs

→ Open Audit Trail

Importants steps are batched on-chain and can be checked later—without exposing your raw data.

Regulators get

1-click audit

⚡ Latency & UX

→ Real‑Time Speed

Answers stream instantly; the proof is written on-chain in the background without latency tax.

Human-like AI (<100 ms)

Watch-time ↑ 3×

Too much L1s / fragmentationAnchors on Solana; Lucid is the Web4 Layer, not a new isolated and useless L1Maturity and Liquidity of Solana
Hard to adopt in products

Works with any existing Web2 AIs under the hood.
Lucid AI for instant prompt to AI Agents/Apps.

Entreprise Grade products.

No friction. Ship in days with familiar Web2 UX.

Corporate ready (reliability, compliance, SLAs)

### Why Interoperability Is Everything Without interoperability, AI hits a ceiling.\ With it, intelligence compounds. * **Agents can collaborate.**\ A customer support bot can pull context from a CRM, check on-chain inventory, and quote live prices — without APIs breaking. * **Data becomes an economy.**\ Each reused dataset earns rewards, creating a marketplace for quality data. * **Compute becomes a utility.**\ Decentralized GPU networks gain enterprise-grade trust through proofs and attestation. * **Models evolve together.**\ Each learns from shared Memory Maps under user consent — creating a global, collective intelligence layer. This is how AI becomes a **network**, not a product. ### The Formula: Interoperability + Proofs + Fair Pay Lucid solves the three missing primitives for decentralized AI: | Primitive | Solved by | Description | | -------------------- | ------------------------ | --------------------------------------------------------- | | **Interoperability** | Open schemas + Passports | Shared IDs and context across agents, models, and tools. | | **Proofs** | Thought Epochs | Auditable records of AI reasoning, routing, and outcomes. | | **Fair Pay** | iGas + Dual-Gas System | Automatic payouts for every verifiable contribution. | These work together to turn isolated AIs into **a living, verifiable Internet of Intelligence**. ## **In One Sentence** **Lucid = Web2 speed, Web3 trust, Web4 intelligence.**\ **The connective tissue that lets all models, agents, and datasets collaborate,**\ **with Web2 speed and Web3 trust.**\ \ **The foundation of the Internet of AI.**