[{"data":1,"prerenderedAt":1605},["ShallowReactive",2],{"navigation":3,"/sdk/php":130,"/sdk/php-surround":1600},[4,9,14,28,38,104,126],{"title":5,"path":6,"stem":7,"icon":8},"Introduction","/","01.index","i-lucide-house",{"title":10,"path":11,"stem":12,"icon":13},"Quickstart","/quickstart","02.quickstart","i-lucide-rocket",{"title":15,"icon":13,"path":16,"stem":17,"children":18,"page":27},"Get started","/get-started","03.get-started",[19,23],{"title":20,"path":21,"stem":22},"API keys","/get-started/api-keys","03.get-started/01.api-keys",{"title":24,"path":25,"stem":26},"Identifiers","/get-started/identifiers","03.get-started/02.identifiers",false,{"title":29,"icon":30,"path":31,"stem":32,"children":33,"page":27},"Concepts","i-lucide-book-open","/concepts","04.concepts",[34],{"title":35,"path":36,"stem":37},"Limits and pricing","/concepts/limits-and-pricing","04.concepts/01.limits-and-pricing",{"title":39,"path":40,"stem":41,"children":42,"icon":103},"API reference","/api","05.api/01.index",[43,45,49,53,57],{"title":44,"path":40,"stem":41},"Overview",{"title":46,"path":47,"stem":48},"Authentication","/api/authentication","05.api/02.authentication",{"title":50,"path":51,"stem":52},"Errors","/api/errors","05.api/03.errors",{"title":54,"path":55,"stem":56},"Rate limits","/api/rate-limits","05.api/04.rate-limits",{"title":58,"children":59,"ui":98,"defaultOpen":27},"Memory",[60,69,74,79,86,91],{"title":61,"path":62,"stem":63,"badge":64},"Ingest","/api/ingest","05.api/05.ingest",{"label":65,"color":66,"variant":67,"class":68},"POST","neutral","soft","rounded-md px-1.5 ring-0 bg-(--docs-sage)/50 text-[#34372F]",{"title":70,"path":71,"stem":72,"badge":73},"Context","/api/context","05.api/06.context",{"label":65,"color":66,"variant":67,"class":68},{"title":75,"path":76,"stem":77,"badge":78},"Retrieve","/api/retrieve","05.api/07.retrieve",{"label":65,"color":66,"variant":67,"class":68},{"title":80,"path":81,"stem":82,"badge":83},"List","/api/memories","05.api/08.memories",{"label":84,"color":66,"variant":67,"class":85},"GET","rounded-md px-1.5 ring-0 bg-info/12 text-info",{"title":87,"path":88,"stem":89,"badge":90},"Get","/api/memories-get","05.api/09.memories-get",{"label":84,"color":66,"variant":67,"class":85},{"title":92,"path":93,"stem":94,"badge":95},"Delete","/api/memories-delete","05.api/10.memories-delete",{"label":96,"color":66,"variant":67,"class":97},"DEL","rounded-md px-1.5 ring-0 bg-warning/12 text-warning",{"itemWithChildren":99,"trigger":100,"linkTrailingIcon":101,"content":102},"mt-0","mb-0 text-sm font-normal normal-case tracking-normal","block","ms-2.5 ps-2 border-s border-default","i-lucide-code",{"title":105,"icon":106,"path":107,"stem":108,"children":109,"page":27},"SDK","i-lucide-package","/sdk","06.sdk",[110,114,118,122],{"title":111,"path":112,"stem":113},"JavaScript","/sdk/javascript","06.sdk/01.javascript",{"title":115,"path":116,"stem":117},"Vercel AI SDK","/sdk/ai-sdk","06.sdk/02.ai-sdk",{"title":119,"path":120,"stem":121},"PHP","/sdk/php","06.sdk/03.php",{"title":123,"path":124,"stem":125},"Laravel","/sdk/laravel","06.sdk/04.laravel",{"title":127,"path":128,"stem":129},"Changelog","/changelog","08.changelog",{"id":131,"title":132,"body":133,"description":1593,"extension":1594,"links":1595,"meta":1596,"navigation":1597,"path":120,"seo":1598,"stem":121,"__hash__":1599},"docs/06.sdk/03.php.md","PHP SDK",{"type":134,"value":135,"toc":1579},"minimark",[136,159,164,189,193,293,325,338,344,347,351,354,485,507,513,516,519,598,629,634,637,651,900,951,1001,1006,1009,1012,1092,1097,1100,1103,1140,1145,1148,1151,1183,1189,1194,1197,1204,1295,1298,1319,1325,1562,1566,1575],[137,138,139,140,144,145,149,150,154,155,158],"p",{},"The ",[141,142,143],"code",{},"neurophic/neurophic"," package is a typed client for the ",[146,147,148],"a",{"href":40},"REST API",". It sends requests with Guzzle and needs ",[151,152,153],"strong",{},"PHP 8.2 or later",". Using Laravel? See the ",[146,156,157],{"href":124},"Laravel package",".",[160,161,163],"h2",{"id":162},"install","Install",[165,166,172],"pre",{"className":167,"code":168,"filename":169,"language":170,"meta":171,"style":171},"language-bash shiki shiki-themes github-dark-default","composer require neurophic/neurophic\n","composer","bash","",[141,173,174],{"__ignoreMap":171},[175,176,179,182,186],"span",{"class":177,"line":178},"line",1,[175,180,169],{"class":181},"sQhOw",[175,183,185],{"class":184},"s9uIt"," require",[175,187,188],{"class":184}," neurophic/neurophic\n",[160,190,192],{"id":191},"create-a-client","Create a client",[165,194,198],{"className":195,"code":196,"language":197,"meta":171,"style":171},"language-php shiki shiki-themes github-dark-default","use Neurophic\\Neurophic;\n\n$client = new Neurophic(\n    apiKey: getenv('NEUROPHIC_API_KEY'),\n    baseUrl: 'https://api.neurophic.ai',\n    timeout: 10,\n);\n","php",[141,199,200,214,221,239,260,274,287],{"__ignoreMap":171},[175,201,202,206,210],{"class":177,"line":178},[175,203,205],{"class":204},"suJrU","use",[175,207,209],{"class":208},"sFSAA"," Neurophic\\Neurophic",[175,211,213],{"class":212},"sZEs4",";\n",[175,215,217],{"class":177,"line":216},2,[175,218,220],{"emptyLinePlaceholder":219},true,"\n",[175,222,224,227,230,233,236],{"class":177,"line":223},3,[175,225,226],{"class":212},"$client ",[175,228,229],{"class":204},"=",[175,231,232],{"class":204}," new",[175,234,235],{"class":208}," Neurophic",[175,237,238],{"class":212},"(\n",[175,240,242,245,248,251,254,257],{"class":177,"line":241},4,[175,243,244],{"class":181},"    apiKey",[175,246,247],{"class":212},": ",[175,249,250],{"class":208},"getenv",[175,252,253],{"class":212},"(",[175,255,256],{"class":184},"'NEUROPHIC_API_KEY'",[175,258,259],{"class":212},"),\n",[175,261,263,266,268,271],{"class":177,"line":262},5,[175,264,265],{"class":181},"    baseUrl",[175,267,247],{"class":212},[175,269,270],{"class":184},"'https://api.neurophic.ai'",[175,272,273],{"class":212},",\n",[175,275,277,280,282,285],{"class":177,"line":276},6,[175,278,279],{"class":181},"    timeout",[175,281,247],{"class":212},[175,283,284],{"class":208},"10",[175,286,273],{"class":212},[175,288,290],{"class":177,"line":289},7,[175,291,292],{"class":212},");\n",[294,295,296,307,313,319],"ul",{},[297,298,299,302,303,306],"li",{},[141,300,301],{},"apiKey",": a project key. Falls back to the ",[141,304,305],{},"NEUROPHIC_API_KEY"," environment variable; if neither is set the constructor throws.",[297,308,309,312],{},[141,310,311],{},"baseUrl",": where requests go. Defaults to the production API.",[297,314,315,318],{},[141,316,317],{},"timeout",": seconds before the client stops waiting. Defaults to 30.",[297,320,321,324],{},[141,322,323],{},"http",": your own Guzzle client, for middleware or a proxy.",[326,327,328],"note",{},[137,329,330,331,334,335,158],{},"Pass ",[141,332,333],{},"identifier"," as the first argument of every call. Keep keys server-side; see ",[146,336,337],{"href":21},"Get started > API keys",[137,339,340,341,158],{},"Every date argument takes an ISO 8601 string or any ",[141,342,343],{},"DateTimeInterface",[160,345,58],{"id":346},"memory",[348,349,61],"h3",{"id":350},"ingest",[137,352,353],{},"Stores a memory. The write is queued, not written on the spot.",[165,355,357],{"className":195,"code":356,"language":197,"meta":171,"style":171},"use Neurophic\\Enums\\MemoryRole;\n\n$receipt = $client->ingest(\n    'user-123',\n    'Prefers window seats on long flights.',\n    name: 'Ada',\n    occurredAt: '2026-08-12T09:12:00Z',\n    role: MemoryRole::User,\n);\n\n$receipt->id;     // becomes the memory id once the write is processed\n$receipt->status; // \"queued\"\n",[141,358,359,368,372,390,397,404,416,428,447,452,457,472],{"__ignoreMap":171},[175,360,361,363,366],{"class":177,"line":178},[175,362,205],{"class":204},[175,364,365],{"class":208}," Neurophic\\Enums\\MemoryRole",[175,367,213],{"class":212},[175,369,370],{"class":177,"line":216},[175,371,220],{"emptyLinePlaceholder":219},[175,373,374,377,379,382,385,388],{"class":177,"line":223},[175,375,376],{"class":212},"$receipt ",[175,378,229],{"class":204},[175,380,381],{"class":212}," $client",[175,383,384],{"class":204},"->",[175,386,350],{"class":387},"sc3cj",[175,389,238],{"class":212},[175,391,392,395],{"class":177,"line":241},[175,393,394],{"class":184},"    'user-123'",[175,396,273],{"class":212},[175,398,399,402],{"class":177,"line":262},[175,400,401],{"class":184},"    'Prefers window seats on long flights.'",[175,403,273],{"class":212},[175,405,406,409,411,414],{"class":177,"line":276},[175,407,408],{"class":181},"    name",[175,410,247],{"class":212},[175,412,413],{"class":184},"'Ada'",[175,415,273],{"class":212},[175,417,418,421,423,426],{"class":177,"line":289},[175,419,420],{"class":181},"    occurredAt",[175,422,247],{"class":212},[175,424,425],{"class":184},"'2026-08-12T09:12:00Z'",[175,427,273],{"class":212},[175,429,431,434,436,439,442,445],{"class":177,"line":430},8,[175,432,433],{"class":181},"    role",[175,435,247],{"class":212},[175,437,438],{"class":208},"MemoryRole",[175,440,441],{"class":204},"::",[175,443,444],{"class":208},"User",[175,446,273],{"class":212},[175,448,450],{"class":177,"line":449},9,[175,451,292],{"class":212},[175,453,455],{"class":177,"line":454},10,[175,456,220],{"emptyLinePlaceholder":219},[175,458,460,463,465,468],{"class":177,"line":459},11,[175,461,462],{"class":212},"$receipt",[175,464,384],{"class":204},[175,466,467],{"class":212},"id;     ",[175,469,471],{"class":470},"sH3jZ","// becomes the memory id once the write is processed\n",[175,473,475,477,479,482],{"class":177,"line":474},12,[175,476,462],{"class":212},[175,478,384],{"class":204},[175,480,481],{"class":212},"status; ",[175,483,484],{"class":470},"// \"queued\"\n",[294,486,487,493],{},[297,488,489,492],{},[141,490,491],{},"occurredAt",": when the content was said. Defaults to now; set it when backfilling history, oldest first.",[297,494,495,498,499,502,503,506],{},[141,496,497],{},"role",": who said it, ",[141,500,501],{},"MemoryRole::User"," by default. Store your agent's own replies as ",[141,504,505],{},"MemoryRole::Assistant","; they never replace what the person said.",[137,508,509,510,158],{},"Learn more under ",[146,511,512],{"href":62},"API reference > Ingest",[348,514,70],{"id":515},"context",[137,517,518],{},"Fetches a short, ready-to-prompt summary for a query, as a string. It is empty when nothing is relevant.",[165,520,522],{"className":195,"code":521,"language":197,"meta":171,"style":171},"use Neurophic\\Enums\\RerankMode;\n\n$context = $client->context(\n    'user-123',\n    'Booking a flight to Lisbon next month',\n    sources: true,\n    rerank: RerankMode::Fast,\n);\n",[141,523,524,533,537,552,558,565,577,594],{"__ignoreMap":171},[175,525,526,528,531],{"class":177,"line":178},[175,527,205],{"class":204},[175,529,530],{"class":208}," Neurophic\\Enums\\RerankMode",[175,532,213],{"class":212},[175,534,535],{"class":177,"line":216},[175,536,220],{"emptyLinePlaceholder":219},[175,538,539,542,544,546,548,550],{"class":177,"line":223},[175,540,541],{"class":212},"$context ",[175,543,229],{"class":204},[175,545,381],{"class":212},[175,547,384],{"class":204},[175,549,515],{"class":387},[175,551,238],{"class":212},[175,553,554,556],{"class":177,"line":241},[175,555,394],{"class":184},[175,557,273],{"class":212},[175,559,560,563],{"class":177,"line":262},[175,561,562],{"class":184},"    'Booking a flight to Lisbon next month'",[175,564,273],{"class":212},[175,566,567,570,572,575],{"class":177,"line":276},[175,568,569],{"class":181},"    sources",[175,571,247],{"class":212},[175,573,574],{"class":208},"true",[175,576,273],{"class":212},[175,578,579,582,584,587,589,592],{"class":177,"line":289},[175,580,581],{"class":181},"    rerank",[175,583,247],{"class":212},[175,585,586],{"class":208},"RerankMode",[175,588,441],{"class":204},[175,590,591],{"class":208},"Fast",[175,593,273],{"class":212},[175,595,596],{"class":177,"line":430},[175,597,292],{"class":212},[294,599,600,609,615],{},[297,601,602,605,606,608],{},[141,603,604],{},"roles",": whose words to include, the person's own by default. Add ",[141,607,505],{}," for what your agent said.",[297,610,611,614],{},[141,612,613],{},"sources",": also return the original turns, each once: the turns behind the block, plus up to five that match the query directly.",[297,616,617,620,621,624,625,628],{},[141,618,619],{},"rerank",": a second ranking stage before the cut, ",[141,622,623],{},"RerankMode::Fast"," or ",[141,626,627],{},"RerankMode::Thorough",". Off by default; a paid mode adds the reranking model's cost to the request.",[137,630,509,631,158],{},[146,632,633],{"href":71},"API reference > Context",[348,635,75],{"id":636},"retrieve",[137,638,639,640,642,643,646,647,650],{},"Searches memory. ",[141,641,636],{}," builds the call and nothing is sent until you choose the shape of the result: ",[141,644,645],{},"->markdown()"," returns Markdown ready to drop into a prompt, ",[141,648,649],{},"->structured()"," returns the same results as typed objects.",[165,652,654],{"className":195,"code":653,"language":197,"meta":171,"style":171},"use Neurophic\\Enums\\MemoryRole;\nuse Neurophic\\Enums\\RerankMode;\n\n$markdown = $client->retrieve('user-123', 'travel preferences')->markdown();\n\n$result = $client->retrieve(\n    'user-123',\n    'travel preferences',\n    goal: 'book a flight for the user',\n    since: '2026-08-01T00:00:00Z',\n    roles: [MemoryRole::User, MemoryRole::Assistant],\n    limit: 10,\n    referenceDate: '2026-08-19',\n    sources: true,\n    rerank: RerankMode::Fast,\n)->structured();\n\nforeach ($result->memories as $memory) {\n    echo $memory->content;\n}\n",[141,655,656,664,672,676,711,715,730,736,743,755,767,793,804,817,828,843,855,860,880,894],{"__ignoreMap":171},[175,657,658,660,662],{"class":177,"line":178},[175,659,205],{"class":204},[175,661,365],{"class":208},[175,663,213],{"class":212},[175,665,666,668,670],{"class":177,"line":216},[175,667,205],{"class":204},[175,669,530],{"class":208},[175,671,213],{"class":212},[175,673,674],{"class":177,"line":223},[175,675,220],{"emptyLinePlaceholder":219},[175,677,678,681,683,685,687,689,691,694,697,700,703,705,708],{"class":177,"line":241},[175,679,680],{"class":212},"$markdown ",[175,682,229],{"class":204},[175,684,381],{"class":212},[175,686,384],{"class":204},[175,688,636],{"class":387},[175,690,253],{"class":212},[175,692,693],{"class":184},"'user-123'",[175,695,696],{"class":212},", ",[175,698,699],{"class":184},"'travel preferences'",[175,701,702],{"class":212},")",[175,704,384],{"class":204},[175,706,707],{"class":387},"markdown",[175,709,710],{"class":212},"();\n",[175,712,713],{"class":177,"line":262},[175,714,220],{"emptyLinePlaceholder":219},[175,716,717,720,722,724,726,728],{"class":177,"line":276},[175,718,719],{"class":212},"$result ",[175,721,229],{"class":204},[175,723,381],{"class":212},[175,725,384],{"class":204},[175,727,636],{"class":387},[175,729,238],{"class":212},[175,731,732,734],{"class":177,"line":289},[175,733,394],{"class":184},[175,735,273],{"class":212},[175,737,738,741],{"class":177,"line":430},[175,739,740],{"class":184},"    'travel preferences'",[175,742,273],{"class":212},[175,744,745,748,750,753],{"class":177,"line":449},[175,746,747],{"class":181},"    goal",[175,749,247],{"class":212},[175,751,752],{"class":184},"'book a flight for the user'",[175,754,273],{"class":212},[175,756,757,760,762,765],{"class":177,"line":454},[175,758,759],{"class":181},"    since",[175,761,247],{"class":212},[175,763,764],{"class":184},"'2026-08-01T00:00:00Z'",[175,766,273],{"class":212},[175,768,769,772,775,777,779,781,783,785,787,790],{"class":177,"line":459},[175,770,771],{"class":181},"    roles",[175,773,774],{"class":212},": [",[175,776,438],{"class":208},[175,778,441],{"class":204},[175,780,444],{"class":208},[175,782,696],{"class":212},[175,784,438],{"class":208},[175,786,441],{"class":204},[175,788,789],{"class":208},"Assistant",[175,791,792],{"class":212},"],\n",[175,794,795,798,800,802],{"class":177,"line":474},[175,796,797],{"class":181},"    limit",[175,799,247],{"class":212},[175,801,284],{"class":208},[175,803,273],{"class":212},[175,805,807,810,812,815],{"class":177,"line":806},13,[175,808,809],{"class":181},"    referenceDate",[175,811,247],{"class":212},[175,813,814],{"class":184},"'2026-08-19'",[175,816,273],{"class":212},[175,818,820,822,824,826],{"class":177,"line":819},14,[175,821,569],{"class":181},[175,823,247],{"class":212},[175,825,574],{"class":208},[175,827,273],{"class":212},[175,829,831,833,835,837,839,841],{"class":177,"line":830},15,[175,832,581],{"class":181},[175,834,247],{"class":212},[175,836,586],{"class":208},[175,838,441],{"class":204},[175,840,591],{"class":208},[175,842,273],{"class":212},[175,844,846,848,850,853],{"class":177,"line":845},16,[175,847,702],{"class":212},[175,849,384],{"class":204},[175,851,852],{"class":387},"structured",[175,854,710],{"class":212},[175,856,858],{"class":177,"line":857},17,[175,859,220],{"emptyLinePlaceholder":219},[175,861,863,866,869,871,874,877],{"class":177,"line":862},18,[175,864,865],{"class":204},"foreach",[175,867,868],{"class":212}," ($result",[175,870,384],{"class":204},[175,872,873],{"class":212},"memories ",[175,875,876],{"class":204},"as",[175,878,879],{"class":212}," $memory) {\n",[175,881,883,886,889,891],{"class":177,"line":882},19,[175,884,885],{"class":208},"    echo",[175,887,888],{"class":212}," $memory",[175,890,384],{"class":204},[175,892,893],{"class":212},"content;\n",[175,895,897],{"class":177,"line":896},20,[175,898,899],{"class":212},"}\n",[294,901,902,911,919,932,945],{},[297,903,904,696,907,910],{},[141,905,906],{},"since",[141,908,909],{},"until",": only memories observed in that window.",[297,912,913,915,916,918],{},[141,914,604],{},": whose words to return, the person's own by default. Add ",[141,917,505],{}," for what your agent said; patterns are always the person's.",[297,920,921,923,924,927,928,931],{},[141,922,613],{},": also return the original turns, each once, as ",[141,925,926],{},"$result->sources",", with ",[141,929,930],{},"sourceId"," on each memory they were taken from.",[297,933,934,620,936,624,938,940,941,944],{},[141,935,619],{},[141,937,623],{},[141,939,627],{},". Off by default; a paid mode adds the reranking model's cost to the request, and ",[141,942,943],{},"limit"," still applies after it.",[297,946,947,950],{},[141,948,949],{},"referenceDate",": the day relative time in the query, such as \"last week\", is read from. Defaults to today.",[137,952,953,954,696,957,696,960,963,964,966,967,696,970,696,973,963,976,979,980,983,984,986,987,989,990,993,994,997,998,1000],{},"The structured result holds ",[141,955,956],{},"memories",[141,958,959],{},"observations",[141,961,962],{},"patterns"," and ",[141,965,613],{},", as lists of ",[141,968,969],{},"RetrievedMemory",[141,971,972],{},"RetrievedObservation",[141,974,975],{},"RetrievedPattern",[141,977,978],{},"RetrievedSource",". Timestamps are ",[141,981,982],{},"DateTimeImmutable"," and each ",[141,985,497],{}," is a ",[141,988,438],{},". ",[141,991,992],{},"relevance"," is ",[141,995,996],{},"null"," when ",[141,999,619],{}," was used; the order of the list is then the ranking.",[137,1002,509,1003,158],{},[146,1004,1005],{"href":76},"API reference > Retrieve",[348,1007,80],{"id":1008},"list",[137,1010,1011],{},"Pages through every memory stored for an identifier, newest first.",[165,1013,1015],{"className":195,"code":1014,"language":197,"meta":171,"style":171},"$page = $client->memory->list('user-123', page: 2, perPage: 10);\n\n$page->total;\n$page->memories[0]->content;\n",[141,1016,1017,1059,1063,1073],{"__ignoreMap":171},[175,1018,1019,1022,1024,1026,1028,1030,1032,1034,1036,1038,1040,1043,1045,1048,1050,1053,1055,1057],{"class":177,"line":178},[175,1020,1021],{"class":212},"$page ",[175,1023,229],{"class":204},[175,1025,381],{"class":212},[175,1027,384],{"class":204},[175,1029,346],{"class":212},[175,1031,384],{"class":204},[175,1033,1008],{"class":387},[175,1035,253],{"class":212},[175,1037,693],{"class":184},[175,1039,696],{"class":212},[175,1041,1042],{"class":181},"page",[175,1044,247],{"class":212},[175,1046,1047],{"class":208},"2",[175,1049,696],{"class":212},[175,1051,1052],{"class":181},"perPage",[175,1054,247],{"class":212},[175,1056,284],{"class":208},[175,1058,292],{"class":212},[175,1060,1061],{"class":177,"line":216},[175,1062,220],{"emptyLinePlaceholder":219},[175,1064,1065,1068,1070],{"class":177,"line":223},[175,1066,1067],{"class":212},"$page",[175,1069,384],{"class":204},[175,1071,1072],{"class":212},"total;\n",[175,1074,1075,1077,1079,1082,1085,1088,1090],{"class":177,"line":241},[175,1076,1067],{"class":212},[175,1078,384],{"class":204},[175,1080,1081],{"class":212},"memories[",[175,1083,1084],{"class":208},"0",[175,1086,1087],{"class":212},"]",[175,1089,384],{"class":204},[175,1091,893],{"class":212},[137,1093,509,1094,158],{},[146,1095,1096],{"href":81},"API reference > List",[348,1098,87],{"id":1099},"get",[137,1101,1102],{},"Fetches one memory by id.",[165,1104,1106],{"className":195,"code":1105,"language":197,"meta":171,"style":171},"$memory = $client->memory->get('5f1d2c3e-...', identifier: 'user-123');\n",[141,1107,1108],{"__ignoreMap":171},[175,1109,1110,1113,1115,1117,1119,1121,1123,1125,1127,1130,1132,1134,1136,1138],{"class":177,"line":178},[175,1111,1112],{"class":212},"$memory ",[175,1114,229],{"class":204},[175,1116,381],{"class":212},[175,1118,384],{"class":204},[175,1120,346],{"class":212},[175,1122,384],{"class":204},[175,1124,1099],{"class":387},[175,1126,253],{"class":212},[175,1128,1129],{"class":184},"'5f1d2c3e-...'",[175,1131,696],{"class":212},[175,1133,333],{"class":181},[175,1135,247],{"class":212},[175,1137,693],{"class":184},[175,1139,292],{"class":212},[137,1141,509,1142,158],{},[146,1143,1144],{"href":88},"API reference > Get",[348,1146,92],{"id":1147},"delete",[137,1149,1150],{},"Deletes one memory by id.",[165,1152,1154],{"className":195,"code":1153,"language":197,"meta":171,"style":171},"$client->memory->delete('5f1d2c3e-...', identifier: 'user-123');\n",[141,1155,1156],{"__ignoreMap":171},[175,1157,1158,1161,1163,1165,1167,1169,1171,1173,1175,1177,1179,1181],{"class":177,"line":178},[175,1159,1160],{"class":212},"$client",[175,1162,384],{"class":204},[175,1164,346],{"class":212},[175,1166,384],{"class":204},[175,1168,1147],{"class":387},[175,1170,253],{"class":212},[175,1172,1129],{"class":184},[175,1174,696],{"class":212},[175,1176,333],{"class":181},[175,1178,247],{"class":212},[175,1180,693],{"class":184},[175,1182,292],{"class":212},[137,1184,330,1185,1188],{},[141,1186,1187],{},"restorePrevious: true"," to delete only this version and restore the one it superseded.",[137,1190,509,1191,158],{},[146,1192,1193],{"href":93},"API reference > Delete",[160,1195,50],{"id":1196},"errors",[137,1198,1199,1200,1203],{},"Any response outside the 2xx range is thrown as a ",[141,1201,1202],{},"Neurophic\\Exceptions\\NeurophicException"," carrying:",[1205,1206,1207,1218,1240,1254,1260,1275],"field-group",{},[1208,1209,1212],"field",{"name":1210,"type":1211},"status","int",[137,1213,1214,1215,1217],{},"The HTTP status; ",[141,1216,1084],{}," for timeouts and connection failures.",[1208,1219,1222],{"name":1220,"type":1221},"errorCode","string",[137,1223,1224,1225,1228,1229,989,1232,1235,1236,1239],{},"The API error code, for example ",[141,1226,1227],{},"VALIDATION_ERROR","; see ",[146,1230,1231],{"href":51},"API reference > Errors",[141,1233,1234],{},"UNKNOWN"," when the body is not the standard envelope, for example a plain-text ",[141,1237,1238],{},"413"," from the edge.",[1208,1241,1244],{"name":1242,"type":1243},"knownCode()","?ErrorCode",[137,1245,1246,1247,1250,1251,1253],{},"The same code as an ",[141,1248,1249],{},"ErrorCode"," enum case, or ",[141,1252,996],{}," for a code this version of the SDK does not know.",[1208,1255,1257],{"name":1256,"type":1221},"getMessage()",[137,1258,1259],{},"The API message.",[1208,1261,1264],{"name":1262,"type":1263},"details","list\u003CValidationDetail>",[137,1265,1266,1267,1269,1270,963,1272,158],{},"The field-level problems on a ",[141,1268,1227],{},", each with ",[141,1271,1208],{},[141,1273,1274],{},"message",[1208,1276,1279],{"name":1277,"type":1278},"body","mixed",[137,1280,1281,1282,696,1285,963,1288,1291,1292,158],{},"The raw response body, decoded from JSON when possible. On ",[141,1283,1284],{},"INSUFFICIENT_CREDIT",[141,1286,1287],{},"balance",[141,1289,1290],{},"required"," are under ",[141,1293,1294],{},"body['error']",[137,1296,1297],{},"Two subclasses cover failures that never reach the API:",[294,1299,1300,1308],{},[297,1301,1302,1307],{},[151,1303,1304,158],{},[141,1305,1306],{},"NeurophicTimeoutException"," The client stopped waiting; the API may still have handled the request.",[297,1309,1310,1315,1316,158],{},[151,1311,1312,158],{},[141,1313,1314],{},"NeurophicConnectionException"," A network failure, with the cause as ",[141,1317,1318],{},"getPrevious()",[1320,1321,1322],"tip",{},[137,1323,1324],{},"The client never retries; add your own backoff if you need it.",[165,1326,1328],{"className":195,"code":1327,"language":197,"meta":171,"style":171},"use Neurophic\\Enums\\ErrorCode;\nuse Neurophic\\Exceptions\\NeurophicException;\nuse Neurophic\\Exceptions\\NeurophicTimeoutException;\n\ntry {\n    $client->ingest('user-123', 'Prefers window seats.');\n} catch (NeurophicTimeoutException $e) {\n    error_log('No reply in time; the write may still go through.');\n} catch (NeurophicException $e) {\n    match ($e->knownCode()) {\n        ErrorCode::ValidationError => error_log($e->getMessage().' '.json_encode($e->details)),\n        ErrorCode::InsufficientCredit => error_log('Not enough credit. Top up the project.'),\n        default => error_log(\"{$e->status} {$e->errorCode} {$e->getMessage()}\"),\n    };\n}\n",[141,1329,1330,1339,1348,1357,1361,1369,1389,1405,1417,1430,1446,1490,1510,1553,1558],{"__ignoreMap":171},[175,1331,1332,1334,1337],{"class":177,"line":178},[175,1333,205],{"class":204},[175,1335,1336],{"class":208}," Neurophic\\Enums\\ErrorCode",[175,1338,213],{"class":212},[175,1340,1341,1343,1346],{"class":177,"line":216},[175,1342,205],{"class":204},[175,1344,1345],{"class":208}," Neurophic\\Exceptions\\NeurophicException",[175,1347,213],{"class":212},[175,1349,1350,1352,1355],{"class":177,"line":223},[175,1351,205],{"class":204},[175,1353,1354],{"class":208}," Neurophic\\Exceptions\\NeurophicTimeoutException",[175,1356,213],{"class":212},[175,1358,1359],{"class":177,"line":241},[175,1360,220],{"emptyLinePlaceholder":219},[175,1362,1363,1366],{"class":177,"line":262},[175,1364,1365],{"class":204},"try",[175,1367,1368],{"class":212}," {\n",[175,1370,1371,1374,1376,1378,1380,1382,1384,1387],{"class":177,"line":276},[175,1372,1373],{"class":212},"    $client",[175,1375,384],{"class":204},[175,1377,350],{"class":387},[175,1379,253],{"class":212},[175,1381,693],{"class":184},[175,1383,696],{"class":212},[175,1385,1386],{"class":184},"'Prefers window seats.'",[175,1388,292],{"class":212},[175,1390,1391,1394,1397,1400,1402],{"class":177,"line":289},[175,1392,1393],{"class":212},"} ",[175,1395,1396],{"class":204},"catch",[175,1398,1399],{"class":212}," (",[175,1401,1306],{"class":208},[175,1403,1404],{"class":212}," $e) {\n",[175,1406,1407,1410,1412,1415],{"class":177,"line":430},[175,1408,1409],{"class":208},"    error_log",[175,1411,253],{"class":212},[175,1413,1414],{"class":184},"'No reply in time; the write may still go through.'",[175,1416,292],{"class":212},[175,1418,1419,1421,1423,1425,1428],{"class":177,"line":449},[175,1420,1393],{"class":212},[175,1422,1396],{"class":204},[175,1424,1399],{"class":212},[175,1426,1427],{"class":208},"NeurophicException",[175,1429,1404],{"class":212},[175,1431,1432,1435,1438,1440,1443],{"class":177,"line":454},[175,1433,1434],{"class":204},"    match",[175,1436,1437],{"class":212}," ($e",[175,1439,384],{"class":204},[175,1441,1442],{"class":387},"knownCode",[175,1444,1445],{"class":212},"()) {\n",[175,1447,1448,1451,1453,1456,1459,1462,1465,1467,1470,1473,1475,1478,1480,1483,1485,1487],{"class":177,"line":459},[175,1449,1450],{"class":208},"        ErrorCode",[175,1452,441],{"class":204},[175,1454,1455],{"class":208},"ValidationError",[175,1457,1458],{"class":204}," =>",[175,1460,1461],{"class":208}," error_log",[175,1463,1464],{"class":212},"($e",[175,1466,384],{"class":204},[175,1468,1469],{"class":387},"getMessage",[175,1471,1472],{"class":212},"()",[175,1474,158],{"class":204},[175,1476,1477],{"class":184},"' '",[175,1479,158],{"class":204},[175,1481,1482],{"class":208},"json_encode",[175,1484,1464],{"class":212},[175,1486,384],{"class":204},[175,1488,1489],{"class":212},"details)),\n",[175,1491,1492,1494,1496,1499,1501,1503,1505,1508],{"class":177,"line":474},[175,1493,1450],{"class":208},[175,1495,441],{"class":204},[175,1497,1498],{"class":208},"InsufficientCredit",[175,1500,1458],{"class":204},[175,1502,1461],{"class":208},[175,1504,253],{"class":212},[175,1506,1507],{"class":184},"'Not enough credit. Top up the project.'",[175,1509,259],{"class":212},[175,1511,1512,1515,1517,1519,1521,1524,1527,1529,1531,1534,1536,1538,1540,1542,1544,1546,1548,1551],{"class":177,"line":806},[175,1513,1514],{"class":204},"        default",[175,1516,1458],{"class":204},[175,1518,1461],{"class":208},[175,1520,253],{"class":212},[175,1522,1523],{"class":184},"\"{",[175,1525,1526],{"class":212},"$e",[175,1528,384],{"class":204},[175,1530,1210],{"class":212},[175,1532,1533],{"class":184},"} {",[175,1535,1526],{"class":212},[175,1537,384],{"class":204},[175,1539,1220],{"class":212},[175,1541,1533],{"class":184},[175,1543,1526],{"class":212},[175,1545,384],{"class":204},[175,1547,1469],{"class":387},[175,1549,1550],{"class":184},"()}\"",[175,1552,259],{"class":212},[175,1554,1555],{"class":177,"line":819},[175,1556,1557],{"class":212},"    };\n",[175,1559,1560],{"class":177,"line":830},[175,1561,899],{"class":212},[160,1563,1565],{"id":1564},"licence","Licence",[137,1567,1568,1569,158],{},"The SDK is MIT-licensed; use of the API it calls is governed by the ",[146,1570,1574],{"href":1571,"rel":1572},"https://neurophic.ai/policies/terms-of-use",[1573],"nofollow","Terms of Use",[1576,1577,1578],"style",{},"html pre.shiki code .sQhOw, html code.shiki .sQhOw{--shiki-default:#FFA657}html pre.shiki code .s9uIt, html code.shiki .s9uIt{--shiki-default:#A5D6FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .suJrU, html code.shiki .suJrU{--shiki-default:#FF7B72}html pre.shiki code .sFSAA, html code.shiki .sFSAA{--shiki-default:#79C0FF}html pre.shiki code .sZEs4, html code.shiki .sZEs4{--shiki-default:#E6EDF3}html pre.shiki code .sc3cj, html code.shiki .sc3cj{--shiki-default:#D2A8FF}html pre.shiki code .sH3jZ, html code.shiki .sH3jZ{--shiki-default:#8B949E}",{"title":171,"searchDepth":178,"depth":216,"links":1580},[1581,1582,1583,1591,1592],{"id":162,"depth":216,"text":163},{"id":191,"depth":216,"text":192},{"id":346,"depth":216,"text":58,"children":1584},[1585,1586,1587,1588,1589,1590],{"id":350,"depth":223,"text":61},{"id":515,"depth":223,"text":70},{"id":636,"depth":223,"text":75},{"id":1008,"depth":223,"text":80},{"id":1099,"depth":223,"text":87},{"id":1147,"depth":223,"text":92},{"id":1196,"depth":216,"text":50},{"id":1564,"depth":216,"text":1565},"Install the PHP SDK, create a client and call every endpoint from PHP 8.2 or later","md",null,{},{"title":119},{"title":132,"description":1593},"d63b11pOVgaI5wR-CXgpfOiJ-V4406Q9Xi9VHf_NgsQ",[1601,1603],{"title":115,"path":116,"stem":117,"description":1602,"children":-1},"Easily integrate memory into your models with the Vercel AI SDK",{"title":123,"path":124,"stem":125,"description":1604,"children":-1},"Add memory to a Laravel app with a facade, per-user scoping and Laravel AI SDK tools",1796212675915]