Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

2253 lignes
58KB

  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "Agent Memory API",
  5. "version": "1.0.0-phase3",
  6. "description": "Universal AI Agent Memory platform, phases 1-3: memories with revisions and verification, sessions with checkpoints, Markdown/text document ingestion with chunk locators, lexical search and recall, health. Authenticate with `Authorization: Bearer <api key>`; the tenant is derived from the key. Anything the caller cannot see is reported as 404. Phase 3: POST /context assembles a budgeted task briefing."
  7. },
  8. "servers": [
  9. {
  10. "url": "/api/v1"
  11. }
  12. ],
  13. "components": {
  14. "securitySchemes": {
  15. "bearerAuth": {
  16. "type": "http",
  17. "scheme": "bearer"
  18. }
  19. },
  20. "schemas": {
  21. "Error": {
  22. "type": "object",
  23. "properties": {
  24. "error": {
  25. "type": "object",
  26. "properties": {
  27. "code": {
  28. "type": "string"
  29. },
  30. "message": {
  31. "type": "string"
  32. },
  33. "details": {
  34. "type": "array",
  35. "items": {
  36. "type": "string"
  37. }
  38. },
  39. "request_id": {
  40. "type": "string"
  41. }
  42. }
  43. }
  44. }
  45. },
  46. "RememberRequest": {
  47. "type": "object",
  48. "required": [
  49. "namespace_id",
  50. "type",
  51. "title",
  52. "content"
  53. ],
  54. "properties": {
  55. "namespace_id": {
  56. "type": "string",
  57. "format": "uuid"
  58. },
  59. "type": {
  60. "type": "string",
  61. "enum": [
  62. "working",
  63. "episodic",
  64. "semantic",
  65. "procedural",
  66. "preference",
  67. "decision",
  68. "constraint",
  69. "lesson",
  70. "hypothesis",
  71. "goal",
  72. "solution"
  73. ]
  74. },
  75. "title": {
  76. "type": "string",
  77. "maxLength": 200
  78. },
  79. "content": {
  80. "type": "string",
  81. "maxLength": 100000
  82. },
  83. "summary": {
  84. "type": "string",
  85. "maxLength": 2000,
  86. "nullable": true
  87. },
  88. "tags": {
  89. "type": "array",
  90. "items": {
  91. "type": "string",
  92. "maxLength": 64
  93. },
  94. "maxItems": 32
  95. },
  96. "attributes": {
  97. "type": "object",
  98. "description": "Free-form JSON object, max 16 KB"
  99. },
  100. "confidence": {
  101. "type": "number",
  102. "minimum": 0,
  103. "maximum": 1
  104. },
  105. "importance": {
  106. "type": "number",
  107. "minimum": 0,
  108. "maximum": 1
  109. }
  110. }
  111. },
  112. "RememberResponse": {
  113. "type": "object",
  114. "properties": {
  115. "id": {
  116. "type": "string",
  117. "format": "uuid"
  118. },
  119. "revision": {
  120. "type": "integer"
  121. },
  122. "status": {
  123. "type": "string"
  124. },
  125. "verification_status": {
  126. "type": "string"
  127. },
  128. "indexing_status": {
  129. "type": "string",
  130. "example": "not_indexed"
  131. },
  132. "duplicate": {
  133. "type": "boolean",
  134. "description": "true when an identical active memory already existed (HTTP 200)"
  135. }
  136. }
  137. },
  138. "Memory": {
  139. "type": "object",
  140. "properties": {
  141. "id": {
  142. "type": "string"
  143. },
  144. "namespace_id": {
  145. "type": "string"
  146. },
  147. "type": {
  148. "type": "string"
  149. },
  150. "status": {
  151. "type": "string",
  152. "enum": [
  153. "active",
  154. "retired",
  155. "superseded"
  156. ]
  157. },
  158. "current_revision": {
  159. "type": "integer"
  160. },
  161. "revision": {
  162. "type": "integer"
  163. },
  164. "verification_status": {
  165. "type": "string",
  166. "enum": [
  167. "unverified",
  168. "verified",
  169. "disputed",
  170. "rejected"
  171. ]
  172. },
  173. "title": {
  174. "type": "string"
  175. },
  176. "summary": {
  177. "type": "string",
  178. "nullable": true
  179. },
  180. "content": {
  181. "type": "string"
  182. },
  183. "attributes": {
  184. "type": "object",
  185. "nullable": true
  186. },
  187. "tags": {
  188. "type": "array",
  189. "items": {
  190. "type": "string"
  191. }
  192. },
  193. "confidence": {
  194. "type": "number",
  195. "nullable": true
  196. },
  197. "importance": {
  198. "type": "number",
  199. "nullable": true
  200. },
  201. "change_reason": {
  202. "type": "string",
  203. "nullable": true
  204. },
  205. "created_by": {
  206. "type": "string"
  207. },
  208. "created_at": {
  209. "type": "string"
  210. },
  211. "updated_at": {
  212. "type": "string"
  213. }
  214. }
  215. },
  216. "IngestRequest": {
  217. "type": "object",
  218. "required": [
  219. "namespace_id",
  220. "title",
  221. "content"
  222. ],
  223. "properties": {
  224. "namespace_id": {
  225. "type": "string",
  226. "format": "uuid"
  227. },
  228. "title": {
  229. "type": "string",
  230. "maxLength": 200
  231. },
  232. "content": {
  233. "type": "string",
  234. "maxLength": 262144
  235. },
  236. "format": {
  237. "type": "string",
  238. "enum": [
  239. "markdown",
  240. "text"
  241. ],
  242. "default": "markdown"
  243. },
  244. "source_uri": {
  245. "type": "string",
  246. "maxLength": 500,
  247. "description": "Identifier only; never fetched. The same source_uri in a namespace is one document."
  248. }
  249. }
  250. },
  251. "IngestResponse": {
  252. "type": "object",
  253. "properties": {
  254. "job": {
  255. "type": "object",
  256. "properties": {
  257. "id": {
  258. "type": "string"
  259. },
  260. "type": {
  261. "type": "string"
  262. },
  263. "state": {
  264. "type": "string"
  265. }
  266. }
  267. },
  268. "document_id": {
  269. "type": "string"
  270. },
  271. "revision": {
  272. "type": "integer"
  273. },
  274. "chunk_count": {
  275. "type": "integer"
  276. },
  277. "unchanged": {
  278. "type": "boolean",
  279. "description": "true when identical text was already the current revision (no new chunks)"
  280. },
  281. "indexing_status": {
  282. "type": "string",
  283. "example": "lexical_indexed"
  284. }
  285. }
  286. },
  287. "SearchRequest": {
  288. "type": "object",
  289. "required": [
  290. "query"
  291. ],
  292. "properties": {
  293. "query": {
  294. "type": "string",
  295. "maxLength": 1000
  296. },
  297. "namespace_ids": {
  298. "type": "array",
  299. "items": {
  300. "type": "string",
  301. "format": "uuid"
  302. }
  303. },
  304. "max_results": {
  305. "type": "integer",
  306. "minimum": 1,
  307. "maximum": 50
  308. },
  309. "detail_level": {
  310. "type": "string",
  311. "enum": [
  312. "full",
  313. "snippet"
  314. ]
  315. }
  316. }
  317. },
  318. "RecallRequest": {
  319. "type": "object",
  320. "required": [
  321. "query"
  322. ],
  323. "properties": {
  324. "query": {
  325. "type": "string",
  326. "maxLength": 1000
  327. },
  328. "namespace_ids": {
  329. "type": "array",
  330. "items": {
  331. "type": "string",
  332. "format": "uuid"
  333. }
  334. },
  335. "types": {
  336. "type": "array",
  337. "items": {
  338. "type": "string"
  339. }
  340. },
  341. "tags": {
  342. "type": "array",
  343. "items": {
  344. "type": "string"
  345. }
  346. },
  347. "max_results": {
  348. "type": "integer"
  349. },
  350. "detail_level": {
  351. "type": "string",
  352. "enum": [
  353. "full",
  354. "summary"
  355. ]
  356. },
  357. "verification_filter": {
  358. "type": "string",
  359. "enum": [
  360. "verified_only",
  361. "include_unverified"
  362. ],
  363. "default": "verified_only"
  364. }
  365. }
  366. },
  367. "VerifyRequest": {
  368. "type": "object",
  369. "required": [
  370. "result",
  371. "method",
  372. "revision"
  373. ],
  374. "properties": {
  375. "result": {
  376. "type": "string",
  377. "enum": [
  378. "verified",
  379. "disputed",
  380. "rejected"
  381. ]
  382. },
  383. "method": {
  384. "type": "string",
  385. "maxLength": 200
  386. },
  387. "notes": {
  388. "type": "string",
  389. "maxLength": 2000
  390. },
  391. "revision": {
  392. "type": "integer",
  393. "description": "Must be the current revision"
  394. }
  395. }
  396. },
  397. "SaveStateRequest": {
  398. "type": "object",
  399. "required": [
  400. "state"
  401. ],
  402. "properties": {
  403. "state": {
  404. "type": "object",
  405. "description": "Structured working state, max 64 KB"
  406. },
  407. "expected_revision": {
  408. "type": "integer"
  409. }
  410. }
  411. },
  412. "ContextRequest": {
  413. "type": "object",
  414. "required": [
  415. "task"
  416. ],
  417. "properties": {
  418. "task": {
  419. "type": "string",
  420. "maxLength": 2000,
  421. "description": "What the agent is about to do; used as the lexical query for decisions, lessons, knowledge and references."
  422. },
  423. "namespace_ids": {
  424. "type": "array",
  425. "items": {
  426. "type": "string"
  427. },
  428. "description": "Restrict to these namespaces (intersected with what the caller can read)."
  429. },
  430. "session_id": {
  431. "type": "string",
  432. "description": "Include the session's latest checkpoint as working_state. 404 when the session is not visible."
  433. },
  434. "include": {
  435. "type": "array",
  436. "items": {
  437. "type": "string",
  438. "enum": [
  439. "constraints",
  440. "preferences",
  441. "decisions",
  442. "lessons",
  443. "knowledge",
  444. "references",
  445. "working_state"
  446. ]
  447. },
  448. "description": "Sections to assemble (default all). Constraints and conflicts are always included."
  449. },
  450. "verification_filter": {
  451. "type": "string",
  452. "enum": [
  453. "verified_only",
  454. "include_unverified"
  455. ],
  456. "default": "verified_only"
  457. },
  458. "detail_level": {
  459. "type": "string",
  460. "enum": [
  461. "full",
  462. "summary"
  463. ],
  464. "default": "full",
  465. "description": "summary returns the stored summary (or first 240 characters); constraints are always full."
  466. },
  467. "max_context_tokens": {
  468. "type": "integer",
  469. "minimum": 100,
  470. "maximum": 32000,
  471. "default": 4000
  472. },
  473. "max_items": {
  474. "type": "integer",
  475. "minimum": 1,
  476. "maximum": 50,
  477. "default": 10,
  478. "description": "Per-section cap for conflicts, decisions, lessons, knowledge and unverified (preferences: 50)."
  479. },
  480. "max_references": {
  481. "type": "integer",
  482. "minimum": 0,
  483. "maximum": 20,
  484. "default": 5
  485. },
  486. "format": {
  487. "type": "string",
  488. "enum": [
  489. "structured"
  490. ],
  491. "default": "structured"
  492. }
  493. },
  494. "example": {
  495. "task": "Implement a customer repository",
  496. "session_id": "<session id>",
  497. "include": [
  498. "constraints",
  499. "decisions",
  500. "preferences",
  501. "lessons",
  502. "references",
  503. "working_state"
  504. ],
  505. "max_context_tokens": 4000
  506. }
  507. },
  508. "ContextResponse": {
  509. "type": "object",
  510. "description": "Sections in budget priority order: constraints (required), working_state, preferences, conflicts, decisions, lessons, knowledge, references, unverified. Memory items carry id, revision, type, namespace_id, title, content|summary, verification_status, content_trust (verified_memory|unverified_memory|disputed_memory), authority (policy for verified constraints), tags, confidence, importance, relevance_score (lexical matches), valid_until, provenance {created_by, updated_at} and token_estimate. References carry chunk/document ids, locator, content and content_trust untrusted_reference.",
  511. "properties": {
  512. "context_id": {
  513. "type": "string"
  514. },
  515. "task": {
  516. "type": "string"
  517. },
  518. "strategy": {
  519. "type": "string",
  520. "example": "lexical"
  521. },
  522. "budget": {
  523. "type": "object",
  524. "properties": {
  525. "max_context_tokens": {
  526. "type": "integer"
  527. },
  528. "used_tokens": {
  529. "type": "integer"
  530. },
  531. "counting_method": {
  532. "type": "string",
  533. "example": "estimate_chars_div_4"
  534. },
  535. "complete": {
  536. "type": "boolean",
  537. "description": "False when not every applicable constraint/preference could be considered; do not treat the briefing as complete."
  538. },
  539. "truncated": {
  540. "type": "boolean",
  541. "description": "True when items were left out to fit the budget."
  542. }
  543. }
  544. },
  545. "omitted": {
  546. "type": "object",
  547. "properties": {
  548. "over_budget": {
  549. "type": "integer"
  550. },
  551. "over_limit": {
  552. "type": "integer"
  553. },
  554. "duplicates": {
  555. "type": "integer"
  556. },
  557. "unverified_excluded": {
  558. "type": "integer"
  559. }
  560. }
  561. },
  562. "constraints": {
  563. "type": "array",
  564. "items": {
  565. "type": "object"
  566. }
  567. },
  568. "working_state": {
  569. "type": "object",
  570. "nullable": true
  571. },
  572. "preferences": {
  573. "type": "array",
  574. "items": {
  575. "type": "object"
  576. }
  577. },
  578. "conflicts": {
  579. "type": "array",
  580. "items": {
  581. "type": "object"
  582. }
  583. },
  584. "decisions": {
  585. "type": "array",
  586. "items": {
  587. "type": "object"
  588. }
  589. },
  590. "lessons": {
  591. "type": "array",
  592. "items": {
  593. "type": "object"
  594. }
  595. },
  596. "knowledge": {
  597. "type": "array",
  598. "items": {
  599. "type": "object"
  600. }
  601. },
  602. "references": {
  603. "type": "array",
  604. "items": {
  605. "type": "object"
  606. }
  607. },
  608. "unverified": {
  609. "type": "array",
  610. "items": {
  611. "type": "object"
  612. },
  613. "description": "Only with verification_filter include_unverified."
  614. },
  615. "warnings": {
  616. "type": "array",
  617. "items": {
  618. "type": "string"
  619. }
  620. }
  621. }
  622. }
  623. }
  624. },
  625. "paths": {
  626. "/remember": {
  627. "post": {
  628. "summary": "Create a memory",
  629. "security": [
  630. {
  631. "bearerAuth": []
  632. }
  633. ],
  634. "parameters": [
  635. {
  636. "name": "Idempotency-Key",
  637. "in": "header",
  638. "required": false,
  639. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  640. "schema": {
  641. "type": "string",
  642. "maxLength": 200
  643. }
  644. }
  645. ],
  646. "requestBody": {
  647. "required": true,
  648. "content": {
  649. "application/json": {
  650. "schema": {
  651. "$ref": "#/components/schemas/RememberRequest"
  652. }
  653. }
  654. }
  655. },
  656. "responses": {
  657. "201": {
  658. "description": "Created",
  659. "content": {
  660. "application/json": {
  661. "schema": {
  662. "$ref": "#/components/schemas/RememberResponse"
  663. }
  664. }
  665. }
  666. },
  667. "200": {
  668. "description": "Exact duplicate (or idempotent replay of a 200)",
  669. "content": {
  670. "application/json": {
  671. "schema": {
  672. "$ref": "#/components/schemas/RememberResponse"
  673. }
  674. }
  675. }
  676. },
  677. "400": {
  678. "description": "Invalid JSON / body",
  679. "content": {
  680. "application/json": {
  681. "schema": {
  682. "$ref": "#/components/schemas/Error"
  683. }
  684. }
  685. }
  686. },
  687. "409": {
  688. "description": "Idempotency-Key reused with a different body",
  689. "content": {
  690. "application/json": {
  691. "schema": {
  692. "$ref": "#/components/schemas/Error"
  693. }
  694. }
  695. }
  696. },
  697. "422": {
  698. "description": "Validation failed",
  699. "content": {
  700. "application/json": {
  701. "schema": {
  702. "$ref": "#/components/schemas/Error"
  703. }
  704. }
  705. }
  706. },
  707. "401": {
  708. "description": "Missing, invalid, revoked or expired API key",
  709. "content": {
  710. "application/json": {
  711. "schema": {
  712. "$ref": "#/components/schemas/Error"
  713. }
  714. }
  715. }
  716. },
  717. "404": {
  718. "description": "Not found or not visible to the caller",
  719. "content": {
  720. "application/json": {
  721. "schema": {
  722. "$ref": "#/components/schemas/Error"
  723. }
  724. }
  725. }
  726. },
  727. "500": {
  728. "description": "Internal error",
  729. "content": {
  730. "application/json": {
  731. "schema": {
  732. "$ref": "#/components/schemas/Error"
  733. }
  734. }
  735. }
  736. }
  737. }
  738. }
  739. },
  740. "/memories": {
  741. "get": {
  742. "summary": "List memories (newest first)",
  743. "security": [
  744. {
  745. "bearerAuth": []
  746. }
  747. ],
  748. "parameters": [
  749. {
  750. "name": "namespace_id",
  751. "in": "query",
  752. "schema": {
  753. "type": "string",
  754. "format": "uuid"
  755. }
  756. },
  757. {
  758. "name": "type",
  759. "in": "query",
  760. "schema": {
  761. "type": "string"
  762. }
  763. },
  764. {
  765. "name": "status",
  766. "in": "query",
  767. "schema": {
  768. "type": "string",
  769. "enum": [
  770. "active",
  771. "retired",
  772. "superseded",
  773. "all"
  774. ],
  775. "default": "active"
  776. }
  777. },
  778. {
  779. "name": "verification_status",
  780. "in": "query",
  781. "schema": {
  782. "type": "string",
  783. "enum": [
  784. "unverified",
  785. "verified",
  786. "disputed",
  787. "rejected"
  788. ]
  789. }
  790. },
  791. {
  792. "name": "limit",
  793. "in": "query",
  794. "schema": {
  795. "type": "integer",
  796. "minimum": 1,
  797. "maximum": 100,
  798. "default": 20
  799. }
  800. },
  801. {
  802. "name": "cursor",
  803. "in": "query",
  804. "description": "next_cursor from the previous page",
  805. "schema": {
  806. "type": "string"
  807. }
  808. }
  809. ],
  810. "responses": {
  811. "200": {
  812. "description": "Page of memories",
  813. "content": {
  814. "application/json": {
  815. "schema": {
  816. "type": "object",
  817. "properties": {
  818. "data": {
  819. "type": "array",
  820. "items": {
  821. "$ref": "#/components/schemas/Memory"
  822. }
  823. },
  824. "next_cursor": {
  825. "type": "string",
  826. "nullable": true
  827. }
  828. }
  829. }
  830. }
  831. }
  832. },
  833. "400": {
  834. "description": "Invalid cursor",
  835. "content": {
  836. "application/json": {
  837. "schema": {
  838. "$ref": "#/components/schemas/Error"
  839. }
  840. }
  841. }
  842. },
  843. "422": {
  844. "description": "Invalid filter",
  845. "content": {
  846. "application/json": {
  847. "schema": {
  848. "$ref": "#/components/schemas/Error"
  849. }
  850. }
  851. }
  852. },
  853. "401": {
  854. "description": "Missing, invalid, revoked or expired API key",
  855. "content": {
  856. "application/json": {
  857. "schema": {
  858. "$ref": "#/components/schemas/Error"
  859. }
  860. }
  861. }
  862. },
  863. "404": {
  864. "description": "Not found or not visible to the caller",
  865. "content": {
  866. "application/json": {
  867. "schema": {
  868. "$ref": "#/components/schemas/Error"
  869. }
  870. }
  871. }
  872. },
  873. "500": {
  874. "description": "Internal error",
  875. "content": {
  876. "application/json": {
  877. "schema": {
  878. "$ref": "#/components/schemas/Error"
  879. }
  880. }
  881. }
  882. }
  883. }
  884. }
  885. },
  886. "/memories/{id}": {
  887. "get": {
  888. "summary": "Get a memory (optionally an older revision)",
  889. "security": [
  890. {
  891. "bearerAuth": []
  892. }
  893. ],
  894. "parameters": [
  895. {
  896. "name": "id",
  897. "in": "path",
  898. "required": true,
  899. "schema": {
  900. "type": "string",
  901. "format": "uuid"
  902. }
  903. },
  904. {
  905. "name": "revision",
  906. "in": "query",
  907. "schema": {
  908. "type": "integer"
  909. }
  910. }
  911. ],
  912. "responses": {
  913. "200": {
  914. "description": "The memory",
  915. "content": {
  916. "application/json": {
  917. "schema": {
  918. "type": "object",
  919. "properties": {
  920. "data": {
  921. "$ref": "#/components/schemas/Memory"
  922. }
  923. }
  924. }
  925. }
  926. }
  927. },
  928. "401": {
  929. "description": "Missing, invalid, revoked or expired API key",
  930. "content": {
  931. "application/json": {
  932. "schema": {
  933. "$ref": "#/components/schemas/Error"
  934. }
  935. }
  936. }
  937. },
  938. "404": {
  939. "description": "Not found or not visible to the caller",
  940. "content": {
  941. "application/json": {
  942. "schema": {
  943. "$ref": "#/components/schemas/Error"
  944. }
  945. }
  946. }
  947. },
  948. "500": {
  949. "description": "Internal error",
  950. "content": {
  951. "application/json": {
  952. "schema": {
  953. "$ref": "#/components/schemas/Error"
  954. }
  955. }
  956. }
  957. }
  958. }
  959. },
  960. "patch": {
  961. "summary": "Correct a memory: creates the next revision, unverified",
  962. "security": [
  963. {
  964. "bearerAuth": []
  965. }
  966. ],
  967. "parameters": [
  968. {
  969. "name": "id",
  970. "in": "path",
  971. "required": true,
  972. "schema": {
  973. "type": "string",
  974. "format": "uuid"
  975. }
  976. },
  977. {
  978. "name": "If-Match",
  979. "in": "header",
  980. "required": false,
  981. "description": "Current revision number (quoted ETag form accepted). Required unless expected_revision is in the body.",
  982. "schema": {
  983. "type": "string"
  984. }
  985. }
  986. ],
  987. "requestBody": {
  988. "required": true,
  989. "content": {
  990. "application/json": {
  991. "schema": {
  992. "type": "object",
  993. "properties": {
  994. "title": {
  995. "type": "string"
  996. },
  997. "summary": {
  998. "type": "string"
  999. },
  1000. "content": {
  1001. "type": "string"
  1002. },
  1003. "tags": {
  1004. "type": "array",
  1005. "items": {
  1006. "type": "string"
  1007. }
  1008. },
  1009. "attributes": {
  1010. "type": "object"
  1011. },
  1012. "confidence": {
  1013. "type": "number"
  1014. },
  1015. "importance": {
  1016. "type": "number"
  1017. },
  1018. "change_reason": {
  1019. "type": "string"
  1020. },
  1021. "expected_revision": {
  1022. "type": "integer"
  1023. }
  1024. }
  1025. }
  1026. }
  1027. }
  1028. },
  1029. "responses": {
  1030. "200": {
  1031. "description": "New revision",
  1032. "content": {
  1033. "application/json": {
  1034. "schema": {
  1035. "$ref": "#/components/schemas/RememberResponse"
  1036. }
  1037. }
  1038. }
  1039. },
  1040. "400": {
  1041. "description": "Bad body / revision",
  1042. "content": {
  1043. "application/json": {
  1044. "schema": {
  1045. "$ref": "#/components/schemas/Error"
  1046. }
  1047. }
  1048. }
  1049. },
  1050. "409": {
  1051. "description": "Memory is not active",
  1052. "content": {
  1053. "application/json": {
  1054. "schema": {
  1055. "$ref": "#/components/schemas/Error"
  1056. }
  1057. }
  1058. }
  1059. },
  1060. "412": {
  1061. "description": "Stale revision (ETag header carries the current one)",
  1062. "content": {
  1063. "application/json": {
  1064. "schema": {
  1065. "$ref": "#/components/schemas/Error"
  1066. }
  1067. }
  1068. }
  1069. },
  1070. "422": {
  1071. "description": "Validation failed",
  1072. "content": {
  1073. "application/json": {
  1074. "schema": {
  1075. "$ref": "#/components/schemas/Error"
  1076. }
  1077. }
  1078. }
  1079. },
  1080. "428": {
  1081. "description": "If-Match missing",
  1082. "content": {
  1083. "application/json": {
  1084. "schema": {
  1085. "$ref": "#/components/schemas/Error"
  1086. }
  1087. }
  1088. }
  1089. },
  1090. "401": {
  1091. "description": "Missing, invalid, revoked or expired API key",
  1092. "content": {
  1093. "application/json": {
  1094. "schema": {
  1095. "$ref": "#/components/schemas/Error"
  1096. }
  1097. }
  1098. }
  1099. },
  1100. "404": {
  1101. "description": "Not found or not visible to the caller",
  1102. "content": {
  1103. "application/json": {
  1104. "schema": {
  1105. "$ref": "#/components/schemas/Error"
  1106. }
  1107. }
  1108. }
  1109. },
  1110. "500": {
  1111. "description": "Internal error",
  1112. "content": {
  1113. "application/json": {
  1114. "schema": {
  1115. "$ref": "#/components/schemas/Error"
  1116. }
  1117. }
  1118. }
  1119. }
  1120. }
  1121. },
  1122. "delete": {
  1123. "summary": "Forget: permanently delete the memory and its revisions (needs delete permission)",
  1124. "security": [
  1125. {
  1126. "bearerAuth": []
  1127. }
  1128. ],
  1129. "parameters": [
  1130. {
  1131. "name": "id",
  1132. "in": "path",
  1133. "required": true,
  1134. "schema": {
  1135. "type": "string",
  1136. "format": "uuid"
  1137. }
  1138. }
  1139. ],
  1140. "responses": {
  1141. "200": {
  1142. "description": "Deleted"
  1143. },
  1144. "401": {
  1145. "description": "Missing, invalid, revoked or expired API key",
  1146. "content": {
  1147. "application/json": {
  1148. "schema": {
  1149. "$ref": "#/components/schemas/Error"
  1150. }
  1151. }
  1152. }
  1153. },
  1154. "404": {
  1155. "description": "Not found or not visible to the caller",
  1156. "content": {
  1157. "application/json": {
  1158. "schema": {
  1159. "$ref": "#/components/schemas/Error"
  1160. }
  1161. }
  1162. }
  1163. },
  1164. "500": {
  1165. "description": "Internal error",
  1166. "content": {
  1167. "application/json": {
  1168. "schema": {
  1169. "$ref": "#/components/schemas/Error"
  1170. }
  1171. }
  1172. }
  1173. }
  1174. }
  1175. }
  1176. },
  1177. "/memories/{id}/retire": {
  1178. "post": {
  1179. "summary": "Retire: exclude from ordinary listing",
  1180. "security": [
  1181. {
  1182. "bearerAuth": []
  1183. }
  1184. ],
  1185. "parameters": [
  1186. {
  1187. "name": "id",
  1188. "in": "path",
  1189. "required": true,
  1190. "schema": {
  1191. "type": "string",
  1192. "format": "uuid"
  1193. }
  1194. }
  1195. ],
  1196. "responses": {
  1197. "200": {
  1198. "description": "Retired"
  1199. },
  1200. "401": {
  1201. "description": "Missing, invalid, revoked or expired API key",
  1202. "content": {
  1203. "application/json": {
  1204. "schema": {
  1205. "$ref": "#/components/schemas/Error"
  1206. }
  1207. }
  1208. }
  1209. },
  1210. "404": {
  1211. "description": "Not found or not visible to the caller",
  1212. "content": {
  1213. "application/json": {
  1214. "schema": {
  1215. "$ref": "#/components/schemas/Error"
  1216. }
  1217. }
  1218. }
  1219. },
  1220. "500": {
  1221. "description": "Internal error",
  1222. "content": {
  1223. "application/json": {
  1224. "schema": {
  1225. "$ref": "#/components/schemas/Error"
  1226. }
  1227. }
  1228. }
  1229. }
  1230. }
  1231. }
  1232. },
  1233. "/memories/{id}/versions": {
  1234. "get": {
  1235. "summary": "Revision history, newest first",
  1236. "security": [
  1237. {
  1238. "bearerAuth": []
  1239. }
  1240. ],
  1241. "parameters": [
  1242. {
  1243. "name": "id",
  1244. "in": "path",
  1245. "required": true,
  1246. "schema": {
  1247. "type": "string",
  1248. "format": "uuid"
  1249. }
  1250. }
  1251. ],
  1252. "responses": {
  1253. "200": {
  1254. "description": "Revisions"
  1255. },
  1256. "401": {
  1257. "description": "Missing, invalid, revoked or expired API key",
  1258. "content": {
  1259. "application/json": {
  1260. "schema": {
  1261. "$ref": "#/components/schemas/Error"
  1262. }
  1263. }
  1264. }
  1265. },
  1266. "404": {
  1267. "description": "Not found or not visible to the caller",
  1268. "content": {
  1269. "application/json": {
  1270. "schema": {
  1271. "$ref": "#/components/schemas/Error"
  1272. }
  1273. }
  1274. }
  1275. },
  1276. "500": {
  1277. "description": "Internal error",
  1278. "content": {
  1279. "application/json": {
  1280. "schema": {
  1281. "$ref": "#/components/schemas/Error"
  1282. }
  1283. }
  1284. }
  1285. }
  1286. }
  1287. }
  1288. },
  1289. "/sessions": {
  1290. "post": {
  1291. "summary": "Start a session",
  1292. "security": [
  1293. {
  1294. "bearerAuth": []
  1295. }
  1296. ],
  1297. "parameters": [
  1298. {
  1299. "name": "Idempotency-Key",
  1300. "in": "header",
  1301. "required": false,
  1302. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  1303. "schema": {
  1304. "type": "string",
  1305. "maxLength": 200
  1306. }
  1307. }
  1308. ],
  1309. "requestBody": {
  1310. "required": true,
  1311. "content": {
  1312. "application/json": {
  1313. "schema": {
  1314. "type": "object",
  1315. "required": [
  1316. "namespace_id",
  1317. "objective"
  1318. ],
  1319. "properties": {
  1320. "namespace_id": {
  1321. "type": "string",
  1322. "format": "uuid"
  1323. },
  1324. "objective": {
  1325. "type": "string",
  1326. "maxLength": 2000
  1327. }
  1328. }
  1329. }
  1330. }
  1331. }
  1332. },
  1333. "responses": {
  1334. "201": {
  1335. "description": "Started"
  1336. },
  1337. "422": {
  1338. "description": "Validation failed",
  1339. "content": {
  1340. "application/json": {
  1341. "schema": {
  1342. "$ref": "#/components/schemas/Error"
  1343. }
  1344. }
  1345. }
  1346. },
  1347. "409": {
  1348. "description": "Idempotency conflict",
  1349. "content": {
  1350. "application/json": {
  1351. "schema": {
  1352. "$ref": "#/components/schemas/Error"
  1353. }
  1354. }
  1355. }
  1356. },
  1357. "401": {
  1358. "description": "Missing, invalid, revoked or expired API key",
  1359. "content": {
  1360. "application/json": {
  1361. "schema": {
  1362. "$ref": "#/components/schemas/Error"
  1363. }
  1364. }
  1365. }
  1366. },
  1367. "404": {
  1368. "description": "Not found or not visible to the caller",
  1369. "content": {
  1370. "application/json": {
  1371. "schema": {
  1372. "$ref": "#/components/schemas/Error"
  1373. }
  1374. }
  1375. }
  1376. },
  1377. "500": {
  1378. "description": "Internal error",
  1379. "content": {
  1380. "application/json": {
  1381. "schema": {
  1382. "$ref": "#/components/schemas/Error"
  1383. }
  1384. }
  1385. }
  1386. }
  1387. }
  1388. }
  1389. },
  1390. "/sessions/{id}/state": {
  1391. "get": {
  1392. "summary": "Restore the latest checkpoint (revision 0 / state null when none)",
  1393. "security": [
  1394. {
  1395. "bearerAuth": []
  1396. }
  1397. ],
  1398. "parameters": [
  1399. {
  1400. "name": "id",
  1401. "in": "path",
  1402. "required": true,
  1403. "schema": {
  1404. "type": "string",
  1405. "format": "uuid"
  1406. }
  1407. }
  1408. ],
  1409. "responses": {
  1410. "200": {
  1411. "description": "Checkpoint; ETag = revision"
  1412. },
  1413. "401": {
  1414. "description": "Missing, invalid, revoked or expired API key",
  1415. "content": {
  1416. "application/json": {
  1417. "schema": {
  1418. "$ref": "#/components/schemas/Error"
  1419. }
  1420. }
  1421. }
  1422. },
  1423. "404": {
  1424. "description": "Not found or not visible to the caller",
  1425. "content": {
  1426. "application/json": {
  1427. "schema": {
  1428. "$ref": "#/components/schemas/Error"
  1429. }
  1430. }
  1431. }
  1432. },
  1433. "500": {
  1434. "description": "Internal error",
  1435. "content": {
  1436. "application/json": {
  1437. "schema": {
  1438. "$ref": "#/components/schemas/Error"
  1439. }
  1440. }
  1441. }
  1442. }
  1443. }
  1444. },
  1445. "put": {
  1446. "summary": "Save a checkpoint (If-Match = current checkpoint revision, 0 for the first)",
  1447. "security": [
  1448. {
  1449. "bearerAuth": []
  1450. }
  1451. ],
  1452. "parameters": [
  1453. {
  1454. "name": "id",
  1455. "in": "path",
  1456. "required": true,
  1457. "schema": {
  1458. "type": "string",
  1459. "format": "uuid"
  1460. }
  1461. },
  1462. {
  1463. "name": "If-Match",
  1464. "in": "header",
  1465. "required": false,
  1466. "description": "Current revision number (quoted ETag form accepted). Required unless expected_revision is in the body.",
  1467. "schema": {
  1468. "type": "string"
  1469. }
  1470. }
  1471. ],
  1472. "requestBody": {
  1473. "required": true,
  1474. "content": {
  1475. "application/json": {
  1476. "schema": {
  1477. "$ref": "#/components/schemas/SaveStateRequest"
  1478. }
  1479. }
  1480. }
  1481. },
  1482. "responses": {
  1483. "200": {
  1484. "description": "Saved; ETag = new revision"
  1485. },
  1486. "409": {
  1487. "description": "Session closed",
  1488. "content": {
  1489. "application/json": {
  1490. "schema": {
  1491. "$ref": "#/components/schemas/Error"
  1492. }
  1493. }
  1494. }
  1495. },
  1496. "412": {
  1497. "description": "Stale revision",
  1498. "content": {
  1499. "application/json": {
  1500. "schema": {
  1501. "$ref": "#/components/schemas/Error"
  1502. }
  1503. }
  1504. }
  1505. },
  1506. "422": {
  1507. "description": "Validation failed",
  1508. "content": {
  1509. "application/json": {
  1510. "schema": {
  1511. "$ref": "#/components/schemas/Error"
  1512. }
  1513. }
  1514. }
  1515. },
  1516. "428": {
  1517. "description": "If-Match missing",
  1518. "content": {
  1519. "application/json": {
  1520. "schema": {
  1521. "$ref": "#/components/schemas/Error"
  1522. }
  1523. }
  1524. }
  1525. },
  1526. "401": {
  1527. "description": "Missing, invalid, revoked or expired API key",
  1528. "content": {
  1529. "application/json": {
  1530. "schema": {
  1531. "$ref": "#/components/schemas/Error"
  1532. }
  1533. }
  1534. }
  1535. },
  1536. "404": {
  1537. "description": "Not found or not visible to the caller",
  1538. "content": {
  1539. "application/json": {
  1540. "schema": {
  1541. "$ref": "#/components/schemas/Error"
  1542. }
  1543. }
  1544. }
  1545. },
  1546. "500": {
  1547. "description": "Internal error",
  1548. "content": {
  1549. "application/json": {
  1550. "schema": {
  1551. "$ref": "#/components/schemas/Error"
  1552. }
  1553. }
  1554. }
  1555. }
  1556. }
  1557. }
  1558. },
  1559. "/sessions/{id}/complete": {
  1560. "post": {
  1561. "summary": "Complete a session",
  1562. "security": [
  1563. {
  1564. "bearerAuth": []
  1565. }
  1566. ],
  1567. "parameters": [
  1568. {
  1569. "name": "id",
  1570. "in": "path",
  1571. "required": true,
  1572. "schema": {
  1573. "type": "string",
  1574. "format": "uuid"
  1575. }
  1576. }
  1577. ],
  1578. "requestBody": {
  1579. "required": false,
  1580. "content": {
  1581. "application/json": {
  1582. "schema": {
  1583. "type": "object",
  1584. "properties": {
  1585. "outcome": {
  1586. "type": "string",
  1587. "maxLength": 4000
  1588. }
  1589. }
  1590. }
  1591. }
  1592. }
  1593. },
  1594. "responses": {
  1595. "200": {
  1596. "description": "Completed"
  1597. },
  1598. "409": {
  1599. "description": "Already closed",
  1600. "content": {
  1601. "application/json": {
  1602. "schema": {
  1603. "$ref": "#/components/schemas/Error"
  1604. }
  1605. }
  1606. }
  1607. },
  1608. "401": {
  1609. "description": "Missing, invalid, revoked or expired API key",
  1610. "content": {
  1611. "application/json": {
  1612. "schema": {
  1613. "$ref": "#/components/schemas/Error"
  1614. }
  1615. }
  1616. }
  1617. },
  1618. "404": {
  1619. "description": "Not found or not visible to the caller",
  1620. "content": {
  1621. "application/json": {
  1622. "schema": {
  1623. "$ref": "#/components/schemas/Error"
  1624. }
  1625. }
  1626. }
  1627. },
  1628. "500": {
  1629. "description": "Internal error",
  1630. "content": {
  1631. "application/json": {
  1632. "schema": {
  1633. "$ref": "#/components/schemas/Error"
  1634. }
  1635. }
  1636. }
  1637. }
  1638. }
  1639. }
  1640. },
  1641. "/memories/{id}/verifications": {
  1642. "post": {
  1643. "summary": "Record a verification of the current revision (needs the verify permission)",
  1644. "security": [
  1645. {
  1646. "bearerAuth": []
  1647. }
  1648. ],
  1649. "parameters": [
  1650. {
  1651. "name": "id",
  1652. "in": "path",
  1653. "required": true,
  1654. "schema": {
  1655. "type": "string",
  1656. "format": "uuid"
  1657. }
  1658. }
  1659. ],
  1660. "requestBody": {
  1661. "required": true,
  1662. "content": {
  1663. "application/json": {
  1664. "schema": {
  1665. "$ref": "#/components/schemas/VerifyRequest"
  1666. }
  1667. }
  1668. }
  1669. },
  1670. "responses": {
  1671. "200": {
  1672. "description": "Recorded; returns the new verification_status"
  1673. },
  1674. "409": {
  1675. "description": "Not the current revision",
  1676. "content": {
  1677. "application/json": {
  1678. "schema": {
  1679. "$ref": "#/components/schemas/Error"
  1680. }
  1681. }
  1682. }
  1683. },
  1684. "422": {
  1685. "description": "Validation failed",
  1686. "content": {
  1687. "application/json": {
  1688. "schema": {
  1689. "$ref": "#/components/schemas/Error"
  1690. }
  1691. }
  1692. }
  1693. },
  1694. "401": {
  1695. "description": "Missing, invalid, revoked or expired API key",
  1696. "content": {
  1697. "application/json": {
  1698. "schema": {
  1699. "$ref": "#/components/schemas/Error"
  1700. }
  1701. }
  1702. }
  1703. },
  1704. "404": {
  1705. "description": "Not found or not visible to the caller",
  1706. "content": {
  1707. "application/json": {
  1708. "schema": {
  1709. "$ref": "#/components/schemas/Error"
  1710. }
  1711. }
  1712. }
  1713. },
  1714. "500": {
  1715. "description": "Internal error",
  1716. "content": {
  1717. "application/json": {
  1718. "schema": {
  1719. "$ref": "#/components/schemas/Error"
  1720. }
  1721. }
  1722. }
  1723. }
  1724. }
  1725. }
  1726. },
  1727. "/recall": {
  1728. "post": {
  1729. "summary": "Lexical recall over active memories; unverified memories are hidden unless verification_filter=include_unverified",
  1730. "security": [
  1731. {
  1732. "bearerAuth": []
  1733. }
  1734. ],
  1735. "requestBody": {
  1736. "required": true,
  1737. "content": {
  1738. "application/json": {
  1739. "schema": {
  1740. "$ref": "#/components/schemas/RecallRequest"
  1741. }
  1742. }
  1743. }
  1744. },
  1745. "responses": {
  1746. "200": {
  1747. "description": "Ranked results with warnings"
  1748. },
  1749. "422": {
  1750. "description": "Validation failed",
  1751. "content": {
  1752. "application/json": {
  1753. "schema": {
  1754. "$ref": "#/components/schemas/Error"
  1755. }
  1756. }
  1757. }
  1758. },
  1759. "401": {
  1760. "description": "Missing, invalid, revoked or expired API key",
  1761. "content": {
  1762. "application/json": {
  1763. "schema": {
  1764. "$ref": "#/components/schemas/Error"
  1765. }
  1766. }
  1767. }
  1768. },
  1769. "404": {
  1770. "description": "Not found or not visible to the caller",
  1771. "content": {
  1772. "application/json": {
  1773. "schema": {
  1774. "$ref": "#/components/schemas/Error"
  1775. }
  1776. }
  1777. }
  1778. },
  1779. "500": {
  1780. "description": "Internal error",
  1781. "content": {
  1782. "application/json": {
  1783. "schema": {
  1784. "$ref": "#/components/schemas/Error"
  1785. }
  1786. }
  1787. }
  1788. }
  1789. }
  1790. }
  1791. },
  1792. "/ingestion/jobs": {
  1793. "post": {
  1794. "summary": "Ingest a Markdown/text document (chunked, indexed)",
  1795. "security": [
  1796. {
  1797. "bearerAuth": []
  1798. }
  1799. ],
  1800. "parameters": [
  1801. {
  1802. "name": "Idempotency-Key",
  1803. "in": "header",
  1804. "required": false,
  1805. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  1806. "schema": {
  1807. "type": "string",
  1808. "maxLength": 200
  1809. }
  1810. }
  1811. ],
  1812. "requestBody": {
  1813. "required": true,
  1814. "content": {
  1815. "application/json": {
  1816. "schema": {
  1817. "$ref": "#/components/schemas/IngestRequest"
  1818. }
  1819. }
  1820. }
  1821. },
  1822. "responses": {
  1823. "201": {
  1824. "description": "Ingested (new document or new revision)",
  1825. "content": {
  1826. "application/json": {
  1827. "schema": {
  1828. "$ref": "#/components/schemas/IngestResponse"
  1829. }
  1830. }
  1831. }
  1832. },
  1833. "200": {
  1834. "description": "Unchanged or idempotent replay",
  1835. "content": {
  1836. "application/json": {
  1837. "schema": {
  1838. "$ref": "#/components/schemas/IngestResponse"
  1839. }
  1840. }
  1841. }
  1842. },
  1843. "400": {
  1844. "description": "Invalid JSON",
  1845. "content": {
  1846. "application/json": {
  1847. "schema": {
  1848. "$ref": "#/components/schemas/Error"
  1849. }
  1850. }
  1851. }
  1852. },
  1853. "409": {
  1854. "description": "Idempotency-Key reused with a different body",
  1855. "content": {
  1856. "application/json": {
  1857. "schema": {
  1858. "$ref": "#/components/schemas/Error"
  1859. }
  1860. }
  1861. }
  1862. },
  1863. "422": {
  1864. "description": "Validation failed",
  1865. "content": {
  1866. "application/json": {
  1867. "schema": {
  1868. "$ref": "#/components/schemas/Error"
  1869. }
  1870. }
  1871. }
  1872. },
  1873. "401": {
  1874. "description": "Missing, invalid, revoked or expired API key",
  1875. "content": {
  1876. "application/json": {
  1877. "schema": {
  1878. "$ref": "#/components/schemas/Error"
  1879. }
  1880. }
  1881. }
  1882. },
  1883. "404": {
  1884. "description": "Not found or not visible to the caller",
  1885. "content": {
  1886. "application/json": {
  1887. "schema": {
  1888. "$ref": "#/components/schemas/Error"
  1889. }
  1890. }
  1891. }
  1892. },
  1893. "500": {
  1894. "description": "Internal error",
  1895. "content": {
  1896. "application/json": {
  1897. "schema": {
  1898. "$ref": "#/components/schemas/Error"
  1899. }
  1900. }
  1901. }
  1902. }
  1903. }
  1904. }
  1905. },
  1906. "/jobs/{id}": {
  1907. "get": {
  1908. "summary": "Ingestion job state",
  1909. "security": [
  1910. {
  1911. "bearerAuth": []
  1912. }
  1913. ],
  1914. "parameters": [
  1915. {
  1916. "name": "id",
  1917. "in": "path",
  1918. "required": true,
  1919. "schema": {
  1920. "type": "string",
  1921. "format": "uuid"
  1922. }
  1923. }
  1924. ],
  1925. "responses": {
  1926. "200": {
  1927. "description": "Job"
  1928. },
  1929. "401": {
  1930. "description": "Missing, invalid, revoked or expired API key",
  1931. "content": {
  1932. "application/json": {
  1933. "schema": {
  1934. "$ref": "#/components/schemas/Error"
  1935. }
  1936. }
  1937. }
  1938. },
  1939. "404": {
  1940. "description": "Not found or not visible to the caller",
  1941. "content": {
  1942. "application/json": {
  1943. "schema": {
  1944. "$ref": "#/components/schemas/Error"
  1945. }
  1946. }
  1947. }
  1948. },
  1949. "500": {
  1950. "description": "Internal error",
  1951. "content": {
  1952. "application/json": {
  1953. "schema": {
  1954. "$ref": "#/components/schemas/Error"
  1955. }
  1956. }
  1957. }
  1958. }
  1959. }
  1960. }
  1961. },
  1962. "/documents/{id}": {
  1963. "get": {
  1964. "summary": "Document metadata (?include_content=true adds the normalized text)",
  1965. "security": [
  1966. {
  1967. "bearerAuth": []
  1968. }
  1969. ],
  1970. "parameters": [
  1971. {
  1972. "name": "id",
  1973. "in": "path",
  1974. "required": true,
  1975. "schema": {
  1976. "type": "string",
  1977. "format": "uuid"
  1978. }
  1979. },
  1980. {
  1981. "name": "include_content",
  1982. "in": "query",
  1983. "schema": {
  1984. "type": "boolean"
  1985. }
  1986. }
  1987. ],
  1988. "responses": {
  1989. "200": {
  1990. "description": "Document"
  1991. },
  1992. "401": {
  1993. "description": "Missing, invalid, revoked or expired API key",
  1994. "content": {
  1995. "application/json": {
  1996. "schema": {
  1997. "$ref": "#/components/schemas/Error"
  1998. }
  1999. }
  2000. }
  2001. },
  2002. "404": {
  2003. "description": "Not found or not visible to the caller",
  2004. "content": {
  2005. "application/json": {
  2006. "schema": {
  2007. "$ref": "#/components/schemas/Error"
  2008. }
  2009. }
  2010. }
  2011. },
  2012. "500": {
  2013. "description": "Internal error",
  2014. "content": {
  2015. "application/json": {
  2016. "schema": {
  2017. "$ref": "#/components/schemas/Error"
  2018. }
  2019. }
  2020. }
  2021. }
  2022. }
  2023. }
  2024. },
  2025. "/chunks/{id}": {
  2026. "get": {
  2027. "summary": "One chunk with heading path and source locator (character offsets into the normalized document text)",
  2028. "security": [
  2029. {
  2030. "bearerAuth": []
  2031. }
  2032. ],
  2033. "parameters": [
  2034. {
  2035. "name": "id",
  2036. "in": "path",
  2037. "required": true,
  2038. "schema": {
  2039. "type": "string",
  2040. "format": "uuid"
  2041. }
  2042. }
  2043. ],
  2044. "responses": {
  2045. "200": {
  2046. "description": "Chunk"
  2047. },
  2048. "401": {
  2049. "description": "Missing, invalid, revoked or expired API key",
  2050. "content": {
  2051. "application/json": {
  2052. "schema": {
  2053. "$ref": "#/components/schemas/Error"
  2054. }
  2055. }
  2056. }
  2057. },
  2058. "404": {
  2059. "description": "Not found or not visible to the caller",
  2060. "content": {
  2061. "application/json": {
  2062. "schema": {
  2063. "$ref": "#/components/schemas/Error"
  2064. }
  2065. }
  2066. }
  2067. },
  2068. "500": {
  2069. "description": "Internal error",
  2070. "content": {
  2071. "application/json": {
  2072. "schema": {
  2073. "$ref": "#/components/schemas/Error"
  2074. }
  2075. }
  2076. }
  2077. }
  2078. }
  2079. }
  2080. },
  2081. "/search": {
  2082. "post": {
  2083. "summary": "Lexical (FTS5/bm25) search over current document chunks; results are untrusted reference data",
  2084. "security": [
  2085. {
  2086. "bearerAuth": []
  2087. }
  2088. ],
  2089. "requestBody": {
  2090. "required": true,
  2091. "content": {
  2092. "application/json": {
  2093. "schema": {
  2094. "$ref": "#/components/schemas/SearchRequest"
  2095. }
  2096. }
  2097. }
  2098. },
  2099. "responses": {
  2100. "200": {
  2101. "description": "Ranked chunks with locators and content_trust"
  2102. },
  2103. "422": {
  2104. "description": "Validation failed",
  2105. "content": {
  2106. "application/json": {
  2107. "schema": {
  2108. "$ref": "#/components/schemas/Error"
  2109. }
  2110. }
  2111. }
  2112. },
  2113. "401": {
  2114. "description": "Missing, invalid, revoked or expired API key",
  2115. "content": {
  2116. "application/json": {
  2117. "schema": {
  2118. "$ref": "#/components/schemas/Error"
  2119. }
  2120. }
  2121. }
  2122. },
  2123. "404": {
  2124. "description": "Not found or not visible to the caller",
  2125. "content": {
  2126. "application/json": {
  2127. "schema": {
  2128. "$ref": "#/components/schemas/Error"
  2129. }
  2130. }
  2131. }
  2132. },
  2133. "500": {
  2134. "description": "Internal error",
  2135. "content": {
  2136. "application/json": {
  2137. "schema": {
  2138. "$ref": "#/components/schemas/Error"
  2139. }
  2140. }
  2141. }
  2142. }
  2143. }
  2144. }
  2145. },
  2146. "/health/live": {
  2147. "get": {
  2148. "summary": "Liveness",
  2149. "responses": {
  2150. "200": {
  2151. "description": "Live"
  2152. }
  2153. }
  2154. }
  2155. },
  2156. "/health/ready": {
  2157. "get": {
  2158. "summary": "Readiness (database reachable)",
  2159. "responses": {
  2160. "200": {
  2161. "description": "Ready"
  2162. },
  2163. "503": {
  2164. "description": "Unavailable"
  2165. }
  2166. }
  2167. }
  2168. },
  2169. "/context": {
  2170. "post": {
  2171. "summary": "Assemble a token-budgeted task briefing: constraints by scope, working state, preferences, conflicts, lexical matches and reference passages",
  2172. "security": [
  2173. {
  2174. "bearerAuth": []
  2175. }
  2176. ],
  2177. "requestBody": {
  2178. "required": true,
  2179. "content": {
  2180. "application/json": {
  2181. "schema": {
  2182. "$ref": "#/components/schemas/ContextRequest"
  2183. }
  2184. }
  2185. }
  2186. },
  2187. "responses": {
  2188. "200": {
  2189. "description": "Briefing",
  2190. "content": {
  2191. "application/json": {
  2192. "schema": {
  2193. "$ref": "#/components/schemas/ContextResponse"
  2194. }
  2195. }
  2196. }
  2197. },
  2198. "400": {
  2199. "description": "Empty body or invalid JSON",
  2200. "content": {
  2201. "application/json": {
  2202. "schema": {
  2203. "$ref": "#/components/schemas/Error"
  2204. }
  2205. }
  2206. }
  2207. },
  2208. "401": {
  2209. "description": "Missing, invalid, revoked or expired API key",
  2210. "content": {
  2211. "application/json": {
  2212. "schema": {
  2213. "$ref": "#/components/schemas/Error"
  2214. }
  2215. }
  2216. }
  2217. },
  2218. "404": {
  2219. "description": "session_id not found or not visible to the caller",
  2220. "content": {
  2221. "application/json": {
  2222. "schema": {
  2223. "$ref": "#/components/schemas/Error"
  2224. }
  2225. }
  2226. }
  2227. },
  2228. "422": {
  2229. "description": "Validation failed, unsupported_character (code points above U+FFFF), or context_budget_exceeded (the applicable constraints do not fit max_context_tokens; the error also carries required_tokens)",
  2230. "content": {
  2231. "application/json": {
  2232. "schema": {
  2233. "$ref": "#/components/schemas/Error"
  2234. }
  2235. }
  2236. }
  2237. },
  2238. "500": {
  2239. "description": "Internal error",
  2240. "content": {
  2241. "application/json": {
  2242. "schema": {
  2243. "$ref": "#/components/schemas/Error"
  2244. }
  2245. }
  2246. }
  2247. }
  2248. }
  2249. }
  2250. }
  2251. }
  2252. }

Powered by TurnKey Linux.