[{"data":1,"prerenderedAt":1333},["ShallowReactive",2],{"navigation":3,"/integrations/laravel":144,"/integrations/laravel-surround":1328},[4,9,14,28,38,104,122,140],{"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},"SDKs","i-lucide-package","/sdk","06.sdk",[110,114,118],{"title":111,"path":112,"stem":113},"JavaScript","/sdk/javascript","06.sdk/01.javascript",{"title":115,"path":116,"stem":117},"PHP","/sdk/php","06.sdk/02.php",{"title":119,"path":120,"stem":121},"Python","/sdk/python","06.sdk/03.python",{"title":123,"icon":124,"path":125,"stem":126,"children":127,"page":27},"Integrations","i-lucide-blocks","/integrations","07.integrations",[128,132,136],{"title":129,"path":130,"stem":131},"Vercel AI SDK","/integrations/ai-sdk","07.integrations/01.ai-sdk",{"title":133,"path":134,"stem":135},"OpenAI Agents SDK","/integrations/openai-agents","07.integrations/02.openai-agents",{"title":137,"path":138,"stem":139},"Laravel","/integrations/laravel","07.integrations/03.laravel",{"title":141,"path":142,"stem":143},"Changelog","/changelog","08.changelog",{"id":145,"title":146,"body":147,"description":1321,"extension":1322,"links":1323,"meta":1324,"navigation":1325,"path":138,"seo":1326,"stem":139,"__hash__":1327},"docs/07.integrations/03.laravel.md","Laravel package",{"type":148,"value":149,"toc":1311},"minimark",[150,172,177,202,209,227,237,257,261,271,354,361,365,371,665,688,694,698,711,754,1111,1130,1139,1144,1147,1274,1282,1285,1295,1299,1307],[151,152,153,157,158,162,163,167,168,171],"p",{},[154,155,156],"code",{},"neurophic/laravel"," wraps the ",[159,160,161],"a",{"href":116},"PHP SDK"," for Laravel. It needs ",[164,165,166],"strong",{},"PHP 8.3 or later"," and ",[164,169,170],{},"Laravel 12 or later",".",[173,174,176],"h2",{"id":175},"install","Install",[178,179,185],"pre",{"className":180,"code":181,"filename":182,"language":183,"meta":184,"style":184},"language-bash shiki shiki-themes github-dark-default","composer require neurophic/laravel\n","composer","bash","",[154,186,187],{"__ignoreMap":184},[188,189,192,195,199],"span",{"class":190,"line":191},"line",1,[188,193,182],{"class":194},"sQhOw",[188,196,198],{"class":197},"s9uIt"," require",[188,200,201],{"class":197}," neurophic/laravel\n",[151,203,204,205,208],{},"Set your project key in ",[154,206,207],{},".env",":",[178,210,212],{"className":180,"code":211,"filename":207,"language":183,"meta":184,"style":184},"NEUROPHIC_API_KEY=nph_...\n",[154,213,214],{"__ignoreMap":184},[188,215,216,220,224],{"class":190,"line":191},[188,217,219],{"class":218},"sZEs4","NEUROPHIC_API_KEY",[188,221,223],{"class":222},"suJrU","=",[188,225,226],{"class":197},"nph_...\n",[151,228,229,230,167,233,236],{},"The service provider is discovered automatically. ",[154,231,232],{},"NEUROPHIC_BASE_URL",[154,234,235],{},"NEUROPHIC_TIMEOUT"," (seconds) are optional; to edit the config file, publish it:",[178,238,240],{"className":180,"code":239,"language":183,"meta":184,"style":184},"php artisan vendor:publish --tag=neurophic-config\n",[154,241,242],{"__ignoreMap":184},[188,243,244,247,250,253],{"class":190,"line":191},[188,245,246],{"class":194},"php",[188,248,249],{"class":197}," artisan",[188,251,252],{"class":197}," vendor:publish",[188,254,256],{"class":255},"sFSAA"," --tag=neurophic-config\n",[173,258,260],{"id":259},"facade","Facade",[151,262,263,264,267,268,270],{},"The ",[154,265,266],{},"Neurophic"," facade takes the same arguments as the ",[159,269,161],{"href":116}," client.",[178,272,275],{"className":273,"code":274,"language":246,"meta":184,"style":184},"language-php shiki shiki-themes github-dark-default","use Neurophic\\Laravel\\Facades\\Neurophic;\n\nNeurophic::ingest('user-123', 'Prefers window seats on long flights.');\n\n$markdown = Neurophic::retrieve('user-123', 'travel preferences');\n",[154,276,277,288,295,322,327],{"__ignoreMap":184},[188,278,279,282,285],{"class":190,"line":191},[188,280,281],{"class":222},"use",[188,283,284],{"class":255}," Neurophic\\Laravel\\Facades\\Neurophic",[188,286,287],{"class":218},";\n",[188,289,291],{"class":190,"line":290},2,[188,292,294],{"emptyLinePlaceholder":293},true,"\n",[188,296,298,300,303,307,310,313,316,319],{"class":190,"line":297},3,[188,299,266],{"class":255},[188,301,302],{"class":222},"::",[188,304,306],{"class":305},"sc3cj","ingest",[188,308,309],{"class":218},"(",[188,311,312],{"class":197},"'user-123'",[188,314,315],{"class":218},", ",[188,317,318],{"class":197},"'Prefers window seats on long flights.'",[188,320,321],{"class":218},");\n",[188,323,325],{"class":190,"line":324},4,[188,326,294],{"emptyLinePlaceholder":293},[188,328,330,333,335,338,340,343,345,347,349,352],{"class":190,"line":329},5,[188,331,332],{"class":218},"$markdown ",[188,334,223],{"class":222},[188,336,337],{"class":255}," Neurophic",[188,339,302],{"class":222},[188,341,342],{"class":305},"retrieve",[188,344,309],{"class":218},[188,346,312],{"class":197},[188,348,315],{"class":218},[188,350,351],{"class":197},"'travel preferences'",[188,353,321],{"class":218},[151,355,356,357,360],{},"The client is also bound in the container, so you can type-hint ",[154,358,359],{},"Neurophic\\Neurophic"," in a constructor.",[173,362,364],{"id":363},"per-user-scoping","Per-user scoping",[151,366,367,370],{},[154,368,369],{},"Neurophic::for()"," binds the client to one user, so you never pass an identifier.",[178,372,374],{"className":273,"code":373,"language":246,"meta":184,"style":184},"use Neurophic\\Enums\\MemoryRole;\nuse Neurophic\\Enums\\RerankMode;\nuse Neurophic\\Laravel\\Facades\\Neurophic;\n\n$memory = Neurophic::for($request->user());\n\n$memory->ingest('Prefers window seats on long flights.');\n$memory->ingest('Suggested the 09:40 from Heathrow.', role: MemoryRole::Assistant);\n\n$context = $memory->context('Booking a flight to Lisbon next month');\n$markdown = $memory->retrieve('travel preferences', rerank: RerankMode::Fast)->markdown();\n$result = $memory->retrieve('travel preferences', sources: true)->structured();\n\n$page = $memory->list(page: 1, perPage: 20);\n$one = $memory->get($id);\n$memory->delete($id);\n",[154,375,376,385,394,402,406,432,437,453,485,490,513,556,593,598,635,653],{"__ignoreMap":184},[188,377,378,380,383],{"class":190,"line":191},[188,379,281],{"class":222},[188,381,382],{"class":255}," Neurophic\\Enums\\MemoryRole",[188,384,287],{"class":218},[188,386,387,389,392],{"class":190,"line":290},[188,388,281],{"class":222},[188,390,391],{"class":255}," Neurophic\\Enums\\RerankMode",[188,393,287],{"class":218},[188,395,396,398,400],{"class":190,"line":297},[188,397,281],{"class":222},[188,399,284],{"class":255},[188,401,287],{"class":218},[188,403,404],{"class":190,"line":324},[188,405,294],{"emptyLinePlaceholder":293},[188,407,408,411,413,415,417,420,423,426,429],{"class":190,"line":329},[188,409,410],{"class":218},"$memory ",[188,412,223],{"class":222},[188,414,337],{"class":255},[188,416,302],{"class":222},[188,418,419],{"class":305},"for",[188,421,422],{"class":218},"($request",[188,424,425],{"class":222},"->",[188,427,428],{"class":305},"user",[188,430,431],{"class":218},"());\n",[188,433,435],{"class":190,"line":434},6,[188,436,294],{"emptyLinePlaceholder":293},[188,438,440,443,445,447,449,451],{"class":190,"line":439},7,[188,441,442],{"class":218},"$memory",[188,444,425],{"class":222},[188,446,306],{"class":305},[188,448,309],{"class":218},[188,450,318],{"class":197},[188,452,321],{"class":218},[188,454,456,458,460,462,464,467,469,472,475,478,480,483],{"class":190,"line":455},8,[188,457,442],{"class":218},[188,459,425],{"class":222},[188,461,306],{"class":305},[188,463,309],{"class":218},[188,465,466],{"class":197},"'Suggested the 09:40 from Heathrow.'",[188,468,315],{"class":218},[188,470,471],{"class":194},"role",[188,473,474],{"class":218},": ",[188,476,477],{"class":255},"MemoryRole",[188,479,302],{"class":222},[188,481,482],{"class":255},"Assistant",[188,484,321],{"class":218},[188,486,488],{"class":190,"line":487},9,[188,489,294],{"emptyLinePlaceholder":293},[188,491,493,496,498,501,503,506,508,511],{"class":190,"line":492},10,[188,494,495],{"class":218},"$context ",[188,497,223],{"class":222},[188,499,500],{"class":218}," $memory",[188,502,425],{"class":222},[188,504,505],{"class":305},"context",[188,507,309],{"class":218},[188,509,510],{"class":197},"'Booking a flight to Lisbon next month'",[188,512,321],{"class":218},[188,514,516,518,520,522,524,526,528,530,532,535,537,540,542,545,548,550,553],{"class":190,"line":515},11,[188,517,332],{"class":218},[188,519,223],{"class":222},[188,521,500],{"class":218},[188,523,425],{"class":222},[188,525,342],{"class":305},[188,527,309],{"class":218},[188,529,351],{"class":197},[188,531,315],{"class":218},[188,533,534],{"class":194},"rerank",[188,536,474],{"class":218},[188,538,539],{"class":255},"RerankMode",[188,541,302],{"class":222},[188,543,544],{"class":255},"Fast",[188,546,547],{"class":218},")",[188,549,425],{"class":222},[188,551,552],{"class":305},"markdown",[188,554,555],{"class":218},"();\n",[188,557,559,562,564,566,568,570,572,574,576,579,581,584,586,588,591],{"class":190,"line":558},12,[188,560,561],{"class":218},"$result ",[188,563,223],{"class":222},[188,565,500],{"class":218},[188,567,425],{"class":222},[188,569,342],{"class":305},[188,571,309],{"class":218},[188,573,351],{"class":197},[188,575,315],{"class":218},[188,577,578],{"class":194},"sources",[188,580,474],{"class":218},[188,582,583],{"class":255},"true",[188,585,547],{"class":218},[188,587,425],{"class":222},[188,589,590],{"class":305},"structured",[188,592,555],{"class":218},[188,594,596],{"class":190,"line":595},13,[188,597,294],{"emptyLinePlaceholder":293},[188,599,601,604,606,608,610,613,615,618,620,623,625,628,630,633],{"class":190,"line":600},14,[188,602,603],{"class":218},"$page ",[188,605,223],{"class":222},[188,607,500],{"class":218},[188,609,425],{"class":222},[188,611,612],{"class":305},"list",[188,614,309],{"class":218},[188,616,617],{"class":194},"page",[188,619,474],{"class":218},[188,621,622],{"class":255},"1",[188,624,315],{"class":218},[188,626,627],{"class":194},"perPage",[188,629,474],{"class":218},[188,631,632],{"class":255},"20",[188,634,321],{"class":218},[188,636,638,641,643,645,647,650],{"class":190,"line":637},15,[188,639,640],{"class":218},"$one ",[188,642,223],{"class":222},[188,644,500],{"class":218},[188,646,425],{"class":222},[188,648,649],{"class":305},"get",[188,651,652],{"class":218},"($id);\n",[188,654,656,658,660,663],{"class":190,"line":655},16,[188,657,442],{"class":218},[188,659,425],{"class":222},[188,661,662],{"class":305},"delete",[188,664,652],{"class":218},[666,667,668,679],"ul",{},[669,670,671,674,675,678],"li",{},[164,672,673],{},"An authenticated user."," The identifier is the user's auth identifier, and the display name is its ",[154,676,677],{},"name"," attribute when it has one.",[669,680,681,684,685,171],{},[164,682,683],{},"A string."," Used as the identifier as it is. Pass a display name as the second argument: ",[154,686,687],{},"Neurophic::for('user-123', 'Ada')",[151,689,690,691,171],{},"Learn more under ",[159,692,693],{"href":25},"Get started > Identifiers",[173,695,697],{"id":696},"laravel-ai-sdk-tools","Laravel AI SDK tools",[151,699,700,701,707,708,171],{},"Two tools give a ",[159,702,706],{"href":703,"rel":704},"https://laravel.com/docs/ai-sdk",[705],"nofollow","Laravel AI SDK"," agent memory for one user. The Laravel AI SDK is optional, so install it first with ",[154,709,710],{},"composer require laravel/ai",[666,712,713,728],{},[669,714,715,720,721,724,725,171],{},[164,716,717,171],{},[154,718,719],{},"RememberTool"," Takes ",[154,722,723],{},"content","; see ",[159,726,727],{"href":62},"API reference > Ingest",[669,729,730,720,735,738,739,315,742,315,745,167,748,724,751,171],{},[164,731,732,171],{},[154,733,734],{},"RecallTool",[154,736,737],{},"query"," and optional ",[154,740,741],{},"goal",[154,743,744],{},"since",[154,746,747],{},"until",[154,749,750],{},"limit",[159,752,753],{"href":76},"API reference > Retrieve",[178,755,757],{"className":273,"code":756,"language":246,"meta":184,"style":184},"namespace App\\Ai\\Agents;\n\nuse App\\Models\\User;\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Contracts\\HasTools;\nuse Laravel\\Ai\\Promptable;\nuse Neurophic\\Enums\\MemoryRole;\nuse Neurophic\\Enums\\RerankMode;\nuse Neurophic\\Laravel\\Ai\\RecallTool;\nuse Neurophic\\Laravel\\Ai\\RememberTool;\n\nclass TravelAssistant implements Agent, HasTools\n{\n    use Promptable;\n\n    public function __construct(public User $user) {}\n\n    public function instructions(): string\n    {\n        return 'You are a travel assistant. Use recall before answering and remember what the user shares.';\n    }\n\n    public function tools(): iterable\n    {\n        return [\n            RecallTool::for(\n                $this->user,\n                roles: [MemoryRole::User, MemoryRole::Assistant],\n                sources: true,\n                rerank: RerankMode::Fast,\n            ),\n            RememberTool::for($this->user),\n        ];\n    }\n}\n",[154,758,759,769,773,782,791,800,809,817,825,834,843,847,866,871,881,885,907,912,930,936,947,953,958,975,980,988,1001,1012,1039,1052,1068,1074,1094,1100,1105],{"__ignoreMap":184},[188,760,761,764,767],{"class":190,"line":191},[188,762,763],{"class":222},"namespace",[188,765,766],{"class":194}," App\\Ai\\Agents",[188,768,287],{"class":218},[188,770,771],{"class":190,"line":290},[188,772,294],{"emptyLinePlaceholder":293},[188,774,775,777,780],{"class":190,"line":297},[188,776,281],{"class":222},[188,778,779],{"class":255}," App\\Models\\User",[188,781,287],{"class":218},[188,783,784,786,789],{"class":190,"line":324},[188,785,281],{"class":222},[188,787,788],{"class":255}," Laravel\\Ai\\Contracts\\Agent",[188,790,287],{"class":218},[188,792,793,795,798],{"class":190,"line":329},[188,794,281],{"class":222},[188,796,797],{"class":255}," Laravel\\Ai\\Contracts\\HasTools",[188,799,287],{"class":218},[188,801,802,804,807],{"class":190,"line":434},[188,803,281],{"class":222},[188,805,806],{"class":255}," Laravel\\Ai\\Promptable",[188,808,287],{"class":218},[188,810,811,813,815],{"class":190,"line":439},[188,812,281],{"class":222},[188,814,382],{"class":255},[188,816,287],{"class":218},[188,818,819,821,823],{"class":190,"line":455},[188,820,281],{"class":222},[188,822,391],{"class":255},[188,824,287],{"class":218},[188,826,827,829,832],{"class":190,"line":487},[188,828,281],{"class":222},[188,830,831],{"class":255}," Neurophic\\Laravel\\Ai\\RecallTool",[188,833,287],{"class":218},[188,835,836,838,841],{"class":190,"line":492},[188,837,281],{"class":222},[188,839,840],{"class":255}," Neurophic\\Laravel\\Ai\\RememberTool",[188,842,287],{"class":218},[188,844,845],{"class":190,"line":515},[188,846,294],{"emptyLinePlaceholder":293},[188,848,849,852,855,858,861,863],{"class":190,"line":558},[188,850,851],{"class":222},"class",[188,853,854],{"class":194}," TravelAssistant",[188,856,857],{"class":222}," implements",[188,859,860],{"class":255}," Agent",[188,862,315],{"class":218},[188,864,865],{"class":255},"HasTools\n",[188,867,868],{"class":190,"line":595},[188,869,870],{"class":218},"{\n",[188,872,873,876,879],{"class":190,"line":600},[188,874,875],{"class":222},"    use",[188,877,878],{"class":255}," Promptable",[188,880,287],{"class":218},[188,882,883],{"class":190,"line":637},[188,884,294],{"emptyLinePlaceholder":293},[188,886,887,890,893,896,898,901,904],{"class":190,"line":655},[188,888,889],{"class":222},"    public",[188,891,892],{"class":222}," function",[188,894,895],{"class":255}," __construct",[188,897,309],{"class":218},[188,899,900],{"class":222},"public",[188,902,903],{"class":255}," User",[188,905,906],{"class":218}," $user) {}\n",[188,908,910],{"class":190,"line":909},17,[188,911,294],{"emptyLinePlaceholder":293},[188,913,915,917,919,922,925,927],{"class":190,"line":914},18,[188,916,889],{"class":222},[188,918,892],{"class":222},[188,920,921],{"class":305}," instructions",[188,923,924],{"class":218},"()",[188,926,208],{"class":222},[188,928,929],{"class":222}," string\n",[188,931,933],{"class":190,"line":932},19,[188,934,935],{"class":218},"    {\n",[188,937,939,942,945],{"class":190,"line":938},20,[188,940,941],{"class":222},"        return",[188,943,944],{"class":197}," 'You are a travel assistant. Use recall before answering and remember what the user shares.'",[188,946,287],{"class":218},[188,948,950],{"class":190,"line":949},21,[188,951,952],{"class":218},"    }\n",[188,954,956],{"class":190,"line":955},22,[188,957,294],{"emptyLinePlaceholder":293},[188,959,961,963,965,968,970,972],{"class":190,"line":960},23,[188,962,889],{"class":222},[188,964,892],{"class":222},[188,966,967],{"class":305}," tools",[188,969,924],{"class":218},[188,971,208],{"class":222},[188,973,974],{"class":222}," iterable\n",[188,976,978],{"class":190,"line":977},24,[188,979,935],{"class":218},[188,981,983,985],{"class":190,"line":982},25,[188,984,941],{"class":222},[188,986,987],{"class":218}," [\n",[188,989,991,994,996,998],{"class":190,"line":990},26,[188,992,993],{"class":255},"            RecallTool",[188,995,302],{"class":222},[188,997,419],{"class":305},[188,999,1000],{"class":218},"(\n",[188,1002,1004,1007,1009],{"class":190,"line":1003},27,[188,1005,1006],{"class":255},"                $this",[188,1008,425],{"class":222},[188,1010,1011],{"class":218},"user,\n",[188,1013,1015,1018,1021,1023,1025,1028,1030,1032,1034,1036],{"class":190,"line":1014},28,[188,1016,1017],{"class":194},"                roles",[188,1019,1020],{"class":218},": [",[188,1022,477],{"class":255},[188,1024,302],{"class":222},[188,1026,1027],{"class":255},"User",[188,1029,315],{"class":218},[188,1031,477],{"class":255},[188,1033,302],{"class":222},[188,1035,482],{"class":255},[188,1037,1038],{"class":218},"],\n",[188,1040,1042,1045,1047,1049],{"class":190,"line":1041},29,[188,1043,1044],{"class":194},"                sources",[188,1046,474],{"class":218},[188,1048,583],{"class":255},[188,1050,1051],{"class":218},",\n",[188,1053,1055,1058,1060,1062,1064,1066],{"class":190,"line":1054},30,[188,1056,1057],{"class":194},"                rerank",[188,1059,474],{"class":218},[188,1061,539],{"class":255},[188,1063,302],{"class":222},[188,1065,544],{"class":255},[188,1067,1051],{"class":218},[188,1069,1071],{"class":190,"line":1070},31,[188,1072,1073],{"class":218},"            ),\n",[188,1075,1077,1080,1082,1084,1086,1089,1091],{"class":190,"line":1076},32,[188,1078,1079],{"class":255},"            RememberTool",[188,1081,302],{"class":222},[188,1083,419],{"class":305},[188,1085,309],{"class":218},[188,1087,1088],{"class":255},"$this",[188,1090,425],{"class":222},[188,1092,1093],{"class":218},"user),\n",[188,1095,1097],{"class":190,"line":1096},33,[188,1098,1099],{"class":218},"        ];\n",[188,1101,1103],{"class":190,"line":1102},34,[188,1104,952],{"class":218},[188,1106,1108],{"class":190,"line":1107},35,[188,1109,1110],{"class":218},"}\n",[151,1112,1113,315,1116,167,1118,1120,1121,1123,1124,1126,1127,1129],{},[154,1114,1115],{},"roles",[154,1117,578],{},[154,1119,534],{}," are applied to every search and are set by you, never by the model: ",[154,1122,1115],{}," for whose words to return, ",[154,1125,578],{}," to also return the original turns, and ",[154,1128,534],{}," for a second ranking stage before the cut. All three are optional.",[1131,1132,1133],"warning",{},[151,1134,1135,1136,171],{},"If a call fails, the tool throws a ",[154,1137,1138],{},"NeurophicException",[1140,1141,1143],"h3",{"id":1142},"context-in-the-system-prompt","Context in the system prompt",[151,1145,1146],{},"To put memory in front of the model on every turn without giving it a tool, add the context block to the agent's instructions:",[178,1148,1150],{"className":273,"code":1149,"language":246,"meta":184,"style":184},"public function instructions(): string\n{\n    $base = 'You are a travel assistant.';\n    $context = Neurophic::for($this->user)->context('travel preferences and upcoming trips');\n\n    return $context === '' ? $base : \"{$base}\\n\\n## Context from memory\\n{$context}\";\n}\n",[154,1151,1152,1166,1170,1182,1215,1219,1270],{"__ignoreMap":184},[188,1153,1154,1156,1158,1160,1162,1164],{"class":190,"line":191},[188,1155,900],{"class":222},[188,1157,892],{"class":222},[188,1159,921],{"class":305},[188,1161,924],{"class":218},[188,1163,208],{"class":222},[188,1165,929],{"class":222},[188,1167,1168],{"class":190,"line":290},[188,1169,870],{"class":218},[188,1171,1172,1175,1177,1180],{"class":190,"line":297},[188,1173,1174],{"class":218},"    $base ",[188,1176,223],{"class":222},[188,1178,1179],{"class":197}," 'You are a travel assistant.'",[188,1181,287],{"class":218},[188,1183,1184,1187,1189,1191,1193,1195,1197,1199,1201,1204,1206,1208,1210,1213],{"class":190,"line":324},[188,1185,1186],{"class":218},"    $context ",[188,1188,223],{"class":222},[188,1190,337],{"class":255},[188,1192,302],{"class":222},[188,1194,419],{"class":305},[188,1196,309],{"class":218},[188,1198,1088],{"class":255},[188,1200,425],{"class":222},[188,1202,1203],{"class":218},"user)",[188,1205,425],{"class":222},[188,1207,505],{"class":305},[188,1209,309],{"class":218},[188,1211,1212],{"class":197},"'travel preferences and upcoming trips'",[188,1214,321],{"class":218},[188,1216,1217],{"class":190,"line":329},[188,1218,294],{"emptyLinePlaceholder":293},[188,1220,1221,1224,1227,1230,1233,1236,1239,1241,1244,1247,1250,1253,1256,1259,1262,1265,1268],{"class":190,"line":434},[188,1222,1223],{"class":222},"    return",[188,1225,1226],{"class":218}," $context ",[188,1228,1229],{"class":222},"===",[188,1231,1232],{"class":197}," ''",[188,1234,1235],{"class":222}," ?",[188,1237,1238],{"class":218}," $base ",[188,1240,208],{"class":222},[188,1242,1243],{"class":197}," \"{",[188,1245,1246],{"class":218},"$base",[188,1248,1249],{"class":197},"}",[188,1251,1252],{"class":222},"\\n\\n",[188,1254,1255],{"class":197},"## Context from memory",[188,1257,1258],{"class":222},"\\n",[188,1260,1261],{"class":197},"{",[188,1263,1264],{"class":218},"$context",[188,1266,1267],{"class":197},"}\"",[188,1269,287],{"class":218},[188,1271,1272],{"class":190,"line":439},[188,1273,1110],{"class":218},[151,1275,1276,1278,1279,171],{},[154,1277,505],{}," returns an empty string when nothing is relevant. Learn more under ",[159,1280,1281],{"href":71},"API reference > Context",[173,1283,50],{"id":1284},"errors",[151,1286,1287,1288,724,1291,171],{},"Every failed call throws a ",[154,1289,1290],{},"Neurophic\\Exceptions\\NeurophicException",[159,1292,1294],{"href":1293},"/sdk/php#errors","PHP SDK > Errors",[173,1296,1298],{"id":1297},"licence","Licence",[151,1300,1301,1302,171],{},"The package is MIT-licensed; use of the API it calls is governed by the ",[159,1303,1306],{"href":1304,"rel":1305},"https://neurophic.ai/policies/terms-of-use",[705],"Terms of Use",[1308,1309,1310],"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 .sZEs4, html code.shiki .sZEs4{--shiki-default:#E6EDF3}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 .sc3cj, html code.shiki .sc3cj{--shiki-default:#D2A8FF}",{"title":184,"searchDepth":191,"depth":290,"links":1312},[1313,1314,1315,1316,1319,1320],{"id":175,"depth":290,"text":176},{"id":259,"depth":290,"text":260},{"id":363,"depth":290,"text":364},{"id":696,"depth":290,"text":697,"children":1317},[1318],{"id":1142,"depth":297,"text":1143},{"id":1284,"depth":290,"text":50},{"id":1297,"depth":290,"text":1298},"Add memory to a Laravel app with a facade, per-user scoping and Laravel AI SDK tools","md",null,{},{"title":137},{"title":146,"description":1321},"tlZ_DDsfHhzikJkS3dwFXikfC2Tc5XZ8T2TDk1oEbhs",[1329,1331],{"title":133,"path":134,"stem":135,"description":1330,"children":-1},"Give an OpenAI Agents SDK agent memory with ready-made tools and per-turn context",{"title":141,"path":142,"stem":143,"description":1332,"children":-1},"What changed in the API, the SDKs and these docs",1796467715068]