Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

2257 rindas
59KB

  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. Retrieval is hybrid (lexical + embeddings via a local Ollama model and a Qdrant index) and degrades to lexical with a warning. Relevance scores are ranking signals: negated bm25 when lexical, reciprocal-rank-fusion values when hybrid."
  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. "enum": [
  521. "hybrid",
  522. "lexical"
  523. ],
  524. "description": "hybrid when semantic retrieval ran for every section; lexical (with a warning) when it is not configured or unavailable"
  525. },
  526. "budget": {
  527. "type": "object",
  528. "properties": {
  529. "max_context_tokens": {
  530. "type": "integer"
  531. },
  532. "used_tokens": {
  533. "type": "integer"
  534. },
  535. "counting_method": {
  536. "type": "string",
  537. "example": "estimate_chars_div_4"
  538. },
  539. "complete": {
  540. "type": "boolean",
  541. "description": "False when not every applicable constraint/preference could be considered; do not treat the briefing as complete."
  542. },
  543. "truncated": {
  544. "type": "boolean",
  545. "description": "True when items were left out to fit the budget."
  546. }
  547. }
  548. },
  549. "omitted": {
  550. "type": "object",
  551. "properties": {
  552. "over_budget": {
  553. "type": "integer"
  554. },
  555. "over_limit": {
  556. "type": "integer"
  557. },
  558. "duplicates": {
  559. "type": "integer"
  560. },
  561. "unverified_excluded": {
  562. "type": "integer"
  563. }
  564. }
  565. },
  566. "constraints": {
  567. "type": "array",
  568. "items": {
  569. "type": "object"
  570. }
  571. },
  572. "working_state": {
  573. "type": "object",
  574. "nullable": true
  575. },
  576. "preferences": {
  577. "type": "array",
  578. "items": {
  579. "type": "object"
  580. }
  581. },
  582. "conflicts": {
  583. "type": "array",
  584. "items": {
  585. "type": "object"
  586. }
  587. },
  588. "decisions": {
  589. "type": "array",
  590. "items": {
  591. "type": "object"
  592. }
  593. },
  594. "lessons": {
  595. "type": "array",
  596. "items": {
  597. "type": "object"
  598. }
  599. },
  600. "knowledge": {
  601. "type": "array",
  602. "items": {
  603. "type": "object"
  604. }
  605. },
  606. "references": {
  607. "type": "array",
  608. "items": {
  609. "type": "object"
  610. }
  611. },
  612. "unverified": {
  613. "type": "array",
  614. "items": {
  615. "type": "object"
  616. },
  617. "description": "Only with verification_filter include_unverified."
  618. },
  619. "warnings": {
  620. "type": "array",
  621. "items": {
  622. "type": "string"
  623. }
  624. }
  625. }
  626. }
  627. }
  628. },
  629. "paths": {
  630. "/remember": {
  631. "post": {
  632. "summary": "Create a memory",
  633. "security": [
  634. {
  635. "bearerAuth": []
  636. }
  637. ],
  638. "parameters": [
  639. {
  640. "name": "Idempotency-Key",
  641. "in": "header",
  642. "required": false,
  643. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  644. "schema": {
  645. "type": "string",
  646. "maxLength": 200
  647. }
  648. }
  649. ],
  650. "requestBody": {
  651. "required": true,
  652. "content": {
  653. "application/json": {
  654. "schema": {
  655. "$ref": "#/components/schemas/RememberRequest"
  656. }
  657. }
  658. }
  659. },
  660. "responses": {
  661. "201": {
  662. "description": "Created",
  663. "content": {
  664. "application/json": {
  665. "schema": {
  666. "$ref": "#/components/schemas/RememberResponse"
  667. }
  668. }
  669. }
  670. },
  671. "200": {
  672. "description": "Exact duplicate (or idempotent replay of a 200)",
  673. "content": {
  674. "application/json": {
  675. "schema": {
  676. "$ref": "#/components/schemas/RememberResponse"
  677. }
  678. }
  679. }
  680. },
  681. "400": {
  682. "description": "Invalid JSON / body",
  683. "content": {
  684. "application/json": {
  685. "schema": {
  686. "$ref": "#/components/schemas/Error"
  687. }
  688. }
  689. }
  690. },
  691. "409": {
  692. "description": "Idempotency-Key reused with a different body",
  693. "content": {
  694. "application/json": {
  695. "schema": {
  696. "$ref": "#/components/schemas/Error"
  697. }
  698. }
  699. }
  700. },
  701. "422": {
  702. "description": "Validation failed",
  703. "content": {
  704. "application/json": {
  705. "schema": {
  706. "$ref": "#/components/schemas/Error"
  707. }
  708. }
  709. }
  710. },
  711. "401": {
  712. "description": "Missing, invalid, revoked or expired API key",
  713. "content": {
  714. "application/json": {
  715. "schema": {
  716. "$ref": "#/components/schemas/Error"
  717. }
  718. }
  719. }
  720. },
  721. "404": {
  722. "description": "Not found or not visible to the caller",
  723. "content": {
  724. "application/json": {
  725. "schema": {
  726. "$ref": "#/components/schemas/Error"
  727. }
  728. }
  729. }
  730. },
  731. "500": {
  732. "description": "Internal error",
  733. "content": {
  734. "application/json": {
  735. "schema": {
  736. "$ref": "#/components/schemas/Error"
  737. }
  738. }
  739. }
  740. }
  741. }
  742. }
  743. },
  744. "/memories": {
  745. "get": {
  746. "summary": "List memories (newest first)",
  747. "security": [
  748. {
  749. "bearerAuth": []
  750. }
  751. ],
  752. "parameters": [
  753. {
  754. "name": "namespace_id",
  755. "in": "query",
  756. "schema": {
  757. "type": "string",
  758. "format": "uuid"
  759. }
  760. },
  761. {
  762. "name": "type",
  763. "in": "query",
  764. "schema": {
  765. "type": "string"
  766. }
  767. },
  768. {
  769. "name": "status",
  770. "in": "query",
  771. "schema": {
  772. "type": "string",
  773. "enum": [
  774. "active",
  775. "retired",
  776. "superseded",
  777. "all"
  778. ],
  779. "default": "active"
  780. }
  781. },
  782. {
  783. "name": "verification_status",
  784. "in": "query",
  785. "schema": {
  786. "type": "string",
  787. "enum": [
  788. "unverified",
  789. "verified",
  790. "disputed",
  791. "rejected"
  792. ]
  793. }
  794. },
  795. {
  796. "name": "limit",
  797. "in": "query",
  798. "schema": {
  799. "type": "integer",
  800. "minimum": 1,
  801. "maximum": 100,
  802. "default": 20
  803. }
  804. },
  805. {
  806. "name": "cursor",
  807. "in": "query",
  808. "description": "next_cursor from the previous page",
  809. "schema": {
  810. "type": "string"
  811. }
  812. }
  813. ],
  814. "responses": {
  815. "200": {
  816. "description": "Page of memories",
  817. "content": {
  818. "application/json": {
  819. "schema": {
  820. "type": "object",
  821. "properties": {
  822. "data": {
  823. "type": "array",
  824. "items": {
  825. "$ref": "#/components/schemas/Memory"
  826. }
  827. },
  828. "next_cursor": {
  829. "type": "string",
  830. "nullable": true
  831. }
  832. }
  833. }
  834. }
  835. }
  836. },
  837. "400": {
  838. "description": "Invalid cursor",
  839. "content": {
  840. "application/json": {
  841. "schema": {
  842. "$ref": "#/components/schemas/Error"
  843. }
  844. }
  845. }
  846. },
  847. "422": {
  848. "description": "Invalid filter",
  849. "content": {
  850. "application/json": {
  851. "schema": {
  852. "$ref": "#/components/schemas/Error"
  853. }
  854. }
  855. }
  856. },
  857. "401": {
  858. "description": "Missing, invalid, revoked or expired API key",
  859. "content": {
  860. "application/json": {
  861. "schema": {
  862. "$ref": "#/components/schemas/Error"
  863. }
  864. }
  865. }
  866. },
  867. "404": {
  868. "description": "Not found or not visible to the caller",
  869. "content": {
  870. "application/json": {
  871. "schema": {
  872. "$ref": "#/components/schemas/Error"
  873. }
  874. }
  875. }
  876. },
  877. "500": {
  878. "description": "Internal error",
  879. "content": {
  880. "application/json": {
  881. "schema": {
  882. "$ref": "#/components/schemas/Error"
  883. }
  884. }
  885. }
  886. }
  887. }
  888. }
  889. },
  890. "/memories/{id}": {
  891. "get": {
  892. "summary": "Get a memory (optionally an older revision)",
  893. "security": [
  894. {
  895. "bearerAuth": []
  896. }
  897. ],
  898. "parameters": [
  899. {
  900. "name": "id",
  901. "in": "path",
  902. "required": true,
  903. "schema": {
  904. "type": "string",
  905. "format": "uuid"
  906. }
  907. },
  908. {
  909. "name": "revision",
  910. "in": "query",
  911. "schema": {
  912. "type": "integer"
  913. }
  914. }
  915. ],
  916. "responses": {
  917. "200": {
  918. "description": "The memory",
  919. "content": {
  920. "application/json": {
  921. "schema": {
  922. "type": "object",
  923. "properties": {
  924. "data": {
  925. "$ref": "#/components/schemas/Memory"
  926. }
  927. }
  928. }
  929. }
  930. }
  931. },
  932. "401": {
  933. "description": "Missing, invalid, revoked or expired API key",
  934. "content": {
  935. "application/json": {
  936. "schema": {
  937. "$ref": "#/components/schemas/Error"
  938. }
  939. }
  940. }
  941. },
  942. "404": {
  943. "description": "Not found or not visible to the caller",
  944. "content": {
  945. "application/json": {
  946. "schema": {
  947. "$ref": "#/components/schemas/Error"
  948. }
  949. }
  950. }
  951. },
  952. "500": {
  953. "description": "Internal error",
  954. "content": {
  955. "application/json": {
  956. "schema": {
  957. "$ref": "#/components/schemas/Error"
  958. }
  959. }
  960. }
  961. }
  962. }
  963. },
  964. "patch": {
  965. "summary": "Correct a memory: creates the next revision, unverified",
  966. "security": [
  967. {
  968. "bearerAuth": []
  969. }
  970. ],
  971. "parameters": [
  972. {
  973. "name": "id",
  974. "in": "path",
  975. "required": true,
  976. "schema": {
  977. "type": "string",
  978. "format": "uuid"
  979. }
  980. },
  981. {
  982. "name": "If-Match",
  983. "in": "header",
  984. "required": false,
  985. "description": "Current revision number (quoted ETag form accepted). Required unless expected_revision is in the body.",
  986. "schema": {
  987. "type": "string"
  988. }
  989. }
  990. ],
  991. "requestBody": {
  992. "required": true,
  993. "content": {
  994. "application/json": {
  995. "schema": {
  996. "type": "object",
  997. "properties": {
  998. "title": {
  999. "type": "string"
  1000. },
  1001. "summary": {
  1002. "type": "string"
  1003. },
  1004. "content": {
  1005. "type": "string"
  1006. },
  1007. "tags": {
  1008. "type": "array",
  1009. "items": {
  1010. "type": "string"
  1011. }
  1012. },
  1013. "attributes": {
  1014. "type": "object"
  1015. },
  1016. "confidence": {
  1017. "type": "number"
  1018. },
  1019. "importance": {
  1020. "type": "number"
  1021. },
  1022. "change_reason": {
  1023. "type": "string"
  1024. },
  1025. "expected_revision": {
  1026. "type": "integer"
  1027. }
  1028. }
  1029. }
  1030. }
  1031. }
  1032. },
  1033. "responses": {
  1034. "200": {
  1035. "description": "New revision",
  1036. "content": {
  1037. "application/json": {
  1038. "schema": {
  1039. "$ref": "#/components/schemas/RememberResponse"
  1040. }
  1041. }
  1042. }
  1043. },
  1044. "400": {
  1045. "description": "Bad body / revision",
  1046. "content": {
  1047. "application/json": {
  1048. "schema": {
  1049. "$ref": "#/components/schemas/Error"
  1050. }
  1051. }
  1052. }
  1053. },
  1054. "409": {
  1055. "description": "Memory is not active",
  1056. "content": {
  1057. "application/json": {
  1058. "schema": {
  1059. "$ref": "#/components/schemas/Error"
  1060. }
  1061. }
  1062. }
  1063. },
  1064. "412": {
  1065. "description": "Stale revision (ETag header carries the current one)",
  1066. "content": {
  1067. "application/json": {
  1068. "schema": {
  1069. "$ref": "#/components/schemas/Error"
  1070. }
  1071. }
  1072. }
  1073. },
  1074. "422": {
  1075. "description": "Validation failed",
  1076. "content": {
  1077. "application/json": {
  1078. "schema": {
  1079. "$ref": "#/components/schemas/Error"
  1080. }
  1081. }
  1082. }
  1083. },
  1084. "428": {
  1085. "description": "If-Match missing",
  1086. "content": {
  1087. "application/json": {
  1088. "schema": {
  1089. "$ref": "#/components/schemas/Error"
  1090. }
  1091. }
  1092. }
  1093. },
  1094. "401": {
  1095. "description": "Missing, invalid, revoked or expired API key",
  1096. "content": {
  1097. "application/json": {
  1098. "schema": {
  1099. "$ref": "#/components/schemas/Error"
  1100. }
  1101. }
  1102. }
  1103. },
  1104. "404": {
  1105. "description": "Not found or not visible to the caller",
  1106. "content": {
  1107. "application/json": {
  1108. "schema": {
  1109. "$ref": "#/components/schemas/Error"
  1110. }
  1111. }
  1112. }
  1113. },
  1114. "500": {
  1115. "description": "Internal error",
  1116. "content": {
  1117. "application/json": {
  1118. "schema": {
  1119. "$ref": "#/components/schemas/Error"
  1120. }
  1121. }
  1122. }
  1123. }
  1124. }
  1125. },
  1126. "delete": {
  1127. "summary": "Forget: permanently delete the memory and its revisions (needs delete permission)",
  1128. "security": [
  1129. {
  1130. "bearerAuth": []
  1131. }
  1132. ],
  1133. "parameters": [
  1134. {
  1135. "name": "id",
  1136. "in": "path",
  1137. "required": true,
  1138. "schema": {
  1139. "type": "string",
  1140. "format": "uuid"
  1141. }
  1142. }
  1143. ],
  1144. "responses": {
  1145. "200": {
  1146. "description": "Deleted"
  1147. },
  1148. "401": {
  1149. "description": "Missing, invalid, revoked or expired API key",
  1150. "content": {
  1151. "application/json": {
  1152. "schema": {
  1153. "$ref": "#/components/schemas/Error"
  1154. }
  1155. }
  1156. }
  1157. },
  1158. "404": {
  1159. "description": "Not found or not visible to the caller",
  1160. "content": {
  1161. "application/json": {
  1162. "schema": {
  1163. "$ref": "#/components/schemas/Error"
  1164. }
  1165. }
  1166. }
  1167. },
  1168. "500": {
  1169. "description": "Internal error",
  1170. "content": {
  1171. "application/json": {
  1172. "schema": {
  1173. "$ref": "#/components/schemas/Error"
  1174. }
  1175. }
  1176. }
  1177. }
  1178. }
  1179. }
  1180. },
  1181. "/memories/{id}/retire": {
  1182. "post": {
  1183. "summary": "Retire: exclude from ordinary listing",
  1184. "security": [
  1185. {
  1186. "bearerAuth": []
  1187. }
  1188. ],
  1189. "parameters": [
  1190. {
  1191. "name": "id",
  1192. "in": "path",
  1193. "required": true,
  1194. "schema": {
  1195. "type": "string",
  1196. "format": "uuid"
  1197. }
  1198. }
  1199. ],
  1200. "responses": {
  1201. "200": {
  1202. "description": "Retired"
  1203. },
  1204. "401": {
  1205. "description": "Missing, invalid, revoked or expired API key",
  1206. "content": {
  1207. "application/json": {
  1208. "schema": {
  1209. "$ref": "#/components/schemas/Error"
  1210. }
  1211. }
  1212. }
  1213. },
  1214. "404": {
  1215. "description": "Not found or not visible to the caller",
  1216. "content": {
  1217. "application/json": {
  1218. "schema": {
  1219. "$ref": "#/components/schemas/Error"
  1220. }
  1221. }
  1222. }
  1223. },
  1224. "500": {
  1225. "description": "Internal error",
  1226. "content": {
  1227. "application/json": {
  1228. "schema": {
  1229. "$ref": "#/components/schemas/Error"
  1230. }
  1231. }
  1232. }
  1233. }
  1234. }
  1235. }
  1236. },
  1237. "/memories/{id}/versions": {
  1238. "get": {
  1239. "summary": "Revision history, newest first",
  1240. "security": [
  1241. {
  1242. "bearerAuth": []
  1243. }
  1244. ],
  1245. "parameters": [
  1246. {
  1247. "name": "id",
  1248. "in": "path",
  1249. "required": true,
  1250. "schema": {
  1251. "type": "string",
  1252. "format": "uuid"
  1253. }
  1254. }
  1255. ],
  1256. "responses": {
  1257. "200": {
  1258. "description": "Revisions"
  1259. },
  1260. "401": {
  1261. "description": "Missing, invalid, revoked or expired API key",
  1262. "content": {
  1263. "application/json": {
  1264. "schema": {
  1265. "$ref": "#/components/schemas/Error"
  1266. }
  1267. }
  1268. }
  1269. },
  1270. "404": {
  1271. "description": "Not found or not visible to the caller",
  1272. "content": {
  1273. "application/json": {
  1274. "schema": {
  1275. "$ref": "#/components/schemas/Error"
  1276. }
  1277. }
  1278. }
  1279. },
  1280. "500": {
  1281. "description": "Internal error",
  1282. "content": {
  1283. "application/json": {
  1284. "schema": {
  1285. "$ref": "#/components/schemas/Error"
  1286. }
  1287. }
  1288. }
  1289. }
  1290. }
  1291. }
  1292. },
  1293. "/sessions": {
  1294. "post": {
  1295. "summary": "Start a session",
  1296. "security": [
  1297. {
  1298. "bearerAuth": []
  1299. }
  1300. ],
  1301. "parameters": [
  1302. {
  1303. "name": "Idempotency-Key",
  1304. "in": "header",
  1305. "required": false,
  1306. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  1307. "schema": {
  1308. "type": "string",
  1309. "maxLength": 200
  1310. }
  1311. }
  1312. ],
  1313. "requestBody": {
  1314. "required": true,
  1315. "content": {
  1316. "application/json": {
  1317. "schema": {
  1318. "type": "object",
  1319. "required": [
  1320. "namespace_id",
  1321. "objective"
  1322. ],
  1323. "properties": {
  1324. "namespace_id": {
  1325. "type": "string",
  1326. "format": "uuid"
  1327. },
  1328. "objective": {
  1329. "type": "string",
  1330. "maxLength": 2000
  1331. }
  1332. }
  1333. }
  1334. }
  1335. }
  1336. },
  1337. "responses": {
  1338. "201": {
  1339. "description": "Started"
  1340. },
  1341. "422": {
  1342. "description": "Validation failed",
  1343. "content": {
  1344. "application/json": {
  1345. "schema": {
  1346. "$ref": "#/components/schemas/Error"
  1347. }
  1348. }
  1349. }
  1350. },
  1351. "409": {
  1352. "description": "Idempotency conflict",
  1353. "content": {
  1354. "application/json": {
  1355. "schema": {
  1356. "$ref": "#/components/schemas/Error"
  1357. }
  1358. }
  1359. }
  1360. },
  1361. "401": {
  1362. "description": "Missing, invalid, revoked or expired API key",
  1363. "content": {
  1364. "application/json": {
  1365. "schema": {
  1366. "$ref": "#/components/schemas/Error"
  1367. }
  1368. }
  1369. }
  1370. },
  1371. "404": {
  1372. "description": "Not found or not visible to the caller",
  1373. "content": {
  1374. "application/json": {
  1375. "schema": {
  1376. "$ref": "#/components/schemas/Error"
  1377. }
  1378. }
  1379. }
  1380. },
  1381. "500": {
  1382. "description": "Internal error",
  1383. "content": {
  1384. "application/json": {
  1385. "schema": {
  1386. "$ref": "#/components/schemas/Error"
  1387. }
  1388. }
  1389. }
  1390. }
  1391. }
  1392. }
  1393. },
  1394. "/sessions/{id}/state": {
  1395. "get": {
  1396. "summary": "Restore the latest checkpoint (revision 0 / state null when none)",
  1397. "security": [
  1398. {
  1399. "bearerAuth": []
  1400. }
  1401. ],
  1402. "parameters": [
  1403. {
  1404. "name": "id",
  1405. "in": "path",
  1406. "required": true,
  1407. "schema": {
  1408. "type": "string",
  1409. "format": "uuid"
  1410. }
  1411. }
  1412. ],
  1413. "responses": {
  1414. "200": {
  1415. "description": "Checkpoint; ETag = revision"
  1416. },
  1417. "401": {
  1418. "description": "Missing, invalid, revoked or expired API key",
  1419. "content": {
  1420. "application/json": {
  1421. "schema": {
  1422. "$ref": "#/components/schemas/Error"
  1423. }
  1424. }
  1425. }
  1426. },
  1427. "404": {
  1428. "description": "Not found or not visible to the caller",
  1429. "content": {
  1430. "application/json": {
  1431. "schema": {
  1432. "$ref": "#/components/schemas/Error"
  1433. }
  1434. }
  1435. }
  1436. },
  1437. "500": {
  1438. "description": "Internal error",
  1439. "content": {
  1440. "application/json": {
  1441. "schema": {
  1442. "$ref": "#/components/schemas/Error"
  1443. }
  1444. }
  1445. }
  1446. }
  1447. }
  1448. },
  1449. "put": {
  1450. "summary": "Save a checkpoint (If-Match = current checkpoint revision, 0 for the first)",
  1451. "security": [
  1452. {
  1453. "bearerAuth": []
  1454. }
  1455. ],
  1456. "parameters": [
  1457. {
  1458. "name": "id",
  1459. "in": "path",
  1460. "required": true,
  1461. "schema": {
  1462. "type": "string",
  1463. "format": "uuid"
  1464. }
  1465. },
  1466. {
  1467. "name": "If-Match",
  1468. "in": "header",
  1469. "required": false,
  1470. "description": "Current revision number (quoted ETag form accepted). Required unless expected_revision is in the body.",
  1471. "schema": {
  1472. "type": "string"
  1473. }
  1474. }
  1475. ],
  1476. "requestBody": {
  1477. "required": true,
  1478. "content": {
  1479. "application/json": {
  1480. "schema": {
  1481. "$ref": "#/components/schemas/SaveStateRequest"
  1482. }
  1483. }
  1484. }
  1485. },
  1486. "responses": {
  1487. "200": {
  1488. "description": "Saved; ETag = new revision"
  1489. },
  1490. "409": {
  1491. "description": "Session closed",
  1492. "content": {
  1493. "application/json": {
  1494. "schema": {
  1495. "$ref": "#/components/schemas/Error"
  1496. }
  1497. }
  1498. }
  1499. },
  1500. "412": {
  1501. "description": "Stale revision",
  1502. "content": {
  1503. "application/json": {
  1504. "schema": {
  1505. "$ref": "#/components/schemas/Error"
  1506. }
  1507. }
  1508. }
  1509. },
  1510. "422": {
  1511. "description": "Validation failed",
  1512. "content": {
  1513. "application/json": {
  1514. "schema": {
  1515. "$ref": "#/components/schemas/Error"
  1516. }
  1517. }
  1518. }
  1519. },
  1520. "428": {
  1521. "description": "If-Match missing",
  1522. "content": {
  1523. "application/json": {
  1524. "schema": {
  1525. "$ref": "#/components/schemas/Error"
  1526. }
  1527. }
  1528. }
  1529. },
  1530. "401": {
  1531. "description": "Missing, invalid, revoked or expired API key",
  1532. "content": {
  1533. "application/json": {
  1534. "schema": {
  1535. "$ref": "#/components/schemas/Error"
  1536. }
  1537. }
  1538. }
  1539. },
  1540. "404": {
  1541. "description": "Not found or not visible to the caller",
  1542. "content": {
  1543. "application/json": {
  1544. "schema": {
  1545. "$ref": "#/components/schemas/Error"
  1546. }
  1547. }
  1548. }
  1549. },
  1550. "500": {
  1551. "description": "Internal error",
  1552. "content": {
  1553. "application/json": {
  1554. "schema": {
  1555. "$ref": "#/components/schemas/Error"
  1556. }
  1557. }
  1558. }
  1559. }
  1560. }
  1561. }
  1562. },
  1563. "/sessions/{id}/complete": {
  1564. "post": {
  1565. "summary": "Complete a session",
  1566. "security": [
  1567. {
  1568. "bearerAuth": []
  1569. }
  1570. ],
  1571. "parameters": [
  1572. {
  1573. "name": "id",
  1574. "in": "path",
  1575. "required": true,
  1576. "schema": {
  1577. "type": "string",
  1578. "format": "uuid"
  1579. }
  1580. }
  1581. ],
  1582. "requestBody": {
  1583. "required": false,
  1584. "content": {
  1585. "application/json": {
  1586. "schema": {
  1587. "type": "object",
  1588. "properties": {
  1589. "outcome": {
  1590. "type": "string",
  1591. "maxLength": 4000
  1592. }
  1593. }
  1594. }
  1595. }
  1596. }
  1597. },
  1598. "responses": {
  1599. "200": {
  1600. "description": "Completed"
  1601. },
  1602. "409": {
  1603. "description": "Already closed",
  1604. "content": {
  1605. "application/json": {
  1606. "schema": {
  1607. "$ref": "#/components/schemas/Error"
  1608. }
  1609. }
  1610. }
  1611. },
  1612. "401": {
  1613. "description": "Missing, invalid, revoked or expired API key",
  1614. "content": {
  1615. "application/json": {
  1616. "schema": {
  1617. "$ref": "#/components/schemas/Error"
  1618. }
  1619. }
  1620. }
  1621. },
  1622. "404": {
  1623. "description": "Not found or not visible to the caller",
  1624. "content": {
  1625. "application/json": {
  1626. "schema": {
  1627. "$ref": "#/components/schemas/Error"
  1628. }
  1629. }
  1630. }
  1631. },
  1632. "500": {
  1633. "description": "Internal error",
  1634. "content": {
  1635. "application/json": {
  1636. "schema": {
  1637. "$ref": "#/components/schemas/Error"
  1638. }
  1639. }
  1640. }
  1641. }
  1642. }
  1643. }
  1644. },
  1645. "/memories/{id}/verifications": {
  1646. "post": {
  1647. "summary": "Record a verification of the current revision (needs the verify permission)",
  1648. "security": [
  1649. {
  1650. "bearerAuth": []
  1651. }
  1652. ],
  1653. "parameters": [
  1654. {
  1655. "name": "id",
  1656. "in": "path",
  1657. "required": true,
  1658. "schema": {
  1659. "type": "string",
  1660. "format": "uuid"
  1661. }
  1662. }
  1663. ],
  1664. "requestBody": {
  1665. "required": true,
  1666. "content": {
  1667. "application/json": {
  1668. "schema": {
  1669. "$ref": "#/components/schemas/VerifyRequest"
  1670. }
  1671. }
  1672. }
  1673. },
  1674. "responses": {
  1675. "200": {
  1676. "description": "Recorded; returns the new verification_status"
  1677. },
  1678. "409": {
  1679. "description": "Not the current revision",
  1680. "content": {
  1681. "application/json": {
  1682. "schema": {
  1683. "$ref": "#/components/schemas/Error"
  1684. }
  1685. }
  1686. }
  1687. },
  1688. "422": {
  1689. "description": "Validation failed",
  1690. "content": {
  1691. "application/json": {
  1692. "schema": {
  1693. "$ref": "#/components/schemas/Error"
  1694. }
  1695. }
  1696. }
  1697. },
  1698. "401": {
  1699. "description": "Missing, invalid, revoked or expired API key",
  1700. "content": {
  1701. "application/json": {
  1702. "schema": {
  1703. "$ref": "#/components/schemas/Error"
  1704. }
  1705. }
  1706. }
  1707. },
  1708. "404": {
  1709. "description": "Not found or not visible to the caller",
  1710. "content": {
  1711. "application/json": {
  1712. "schema": {
  1713. "$ref": "#/components/schemas/Error"
  1714. }
  1715. }
  1716. }
  1717. },
  1718. "500": {
  1719. "description": "Internal error",
  1720. "content": {
  1721. "application/json": {
  1722. "schema": {
  1723. "$ref": "#/components/schemas/Error"
  1724. }
  1725. }
  1726. }
  1727. }
  1728. }
  1729. }
  1730. },
  1731. "/recall": {
  1732. "post": {
  1733. "summary": "Hybrid recall over active memories (FTS5/bm25 fused with vector similarity by reciprocal rank fusion; lexical only, with a warning, when the embedding provider is off or down). Unverified memories are hidden unless verification_filter=include_unverified",
  1734. "security": [
  1735. {
  1736. "bearerAuth": []
  1737. }
  1738. ],
  1739. "requestBody": {
  1740. "required": true,
  1741. "content": {
  1742. "application/json": {
  1743. "schema": {
  1744. "$ref": "#/components/schemas/RecallRequest"
  1745. }
  1746. }
  1747. }
  1748. },
  1749. "responses": {
  1750. "200": {
  1751. "description": "Ranked results with warnings"
  1752. },
  1753. "422": {
  1754. "description": "Validation failed",
  1755. "content": {
  1756. "application/json": {
  1757. "schema": {
  1758. "$ref": "#/components/schemas/Error"
  1759. }
  1760. }
  1761. }
  1762. },
  1763. "401": {
  1764. "description": "Missing, invalid, revoked or expired API key",
  1765. "content": {
  1766. "application/json": {
  1767. "schema": {
  1768. "$ref": "#/components/schemas/Error"
  1769. }
  1770. }
  1771. }
  1772. },
  1773. "404": {
  1774. "description": "Not found or not visible to the caller",
  1775. "content": {
  1776. "application/json": {
  1777. "schema": {
  1778. "$ref": "#/components/schemas/Error"
  1779. }
  1780. }
  1781. }
  1782. },
  1783. "500": {
  1784. "description": "Internal error",
  1785. "content": {
  1786. "application/json": {
  1787. "schema": {
  1788. "$ref": "#/components/schemas/Error"
  1789. }
  1790. }
  1791. }
  1792. }
  1793. }
  1794. }
  1795. },
  1796. "/ingestion/jobs": {
  1797. "post": {
  1798. "summary": "Ingest a Markdown/text document (chunked, indexed)",
  1799. "security": [
  1800. {
  1801. "bearerAuth": []
  1802. }
  1803. ],
  1804. "parameters": [
  1805. {
  1806. "name": "Idempotency-Key",
  1807. "in": "header",
  1808. "required": false,
  1809. "description": "Replays the stored response for an identical body; a different body with the same key is 409.",
  1810. "schema": {
  1811. "type": "string",
  1812. "maxLength": 200
  1813. }
  1814. }
  1815. ],
  1816. "requestBody": {
  1817. "required": true,
  1818. "content": {
  1819. "application/json": {
  1820. "schema": {
  1821. "$ref": "#/components/schemas/IngestRequest"
  1822. }
  1823. }
  1824. }
  1825. },
  1826. "responses": {
  1827. "201": {
  1828. "description": "Ingested (new document or new revision)",
  1829. "content": {
  1830. "application/json": {
  1831. "schema": {
  1832. "$ref": "#/components/schemas/IngestResponse"
  1833. }
  1834. }
  1835. }
  1836. },
  1837. "200": {
  1838. "description": "Unchanged or idempotent replay",
  1839. "content": {
  1840. "application/json": {
  1841. "schema": {
  1842. "$ref": "#/components/schemas/IngestResponse"
  1843. }
  1844. }
  1845. }
  1846. },
  1847. "400": {
  1848. "description": "Invalid JSON",
  1849. "content": {
  1850. "application/json": {
  1851. "schema": {
  1852. "$ref": "#/components/schemas/Error"
  1853. }
  1854. }
  1855. }
  1856. },
  1857. "409": {
  1858. "description": "Idempotency-Key reused with a different body",
  1859. "content": {
  1860. "application/json": {
  1861. "schema": {
  1862. "$ref": "#/components/schemas/Error"
  1863. }
  1864. }
  1865. }
  1866. },
  1867. "422": {
  1868. "description": "Validation failed",
  1869. "content": {
  1870. "application/json": {
  1871. "schema": {
  1872. "$ref": "#/components/schemas/Error"
  1873. }
  1874. }
  1875. }
  1876. },
  1877. "401": {
  1878. "description": "Missing, invalid, revoked or expired API key",
  1879. "content": {
  1880. "application/json": {
  1881. "schema": {
  1882. "$ref": "#/components/schemas/Error"
  1883. }
  1884. }
  1885. }
  1886. },
  1887. "404": {
  1888. "description": "Not found or not visible to the caller",
  1889. "content": {
  1890. "application/json": {
  1891. "schema": {
  1892. "$ref": "#/components/schemas/Error"
  1893. }
  1894. }
  1895. }
  1896. },
  1897. "500": {
  1898. "description": "Internal error",
  1899. "content": {
  1900. "application/json": {
  1901. "schema": {
  1902. "$ref": "#/components/schemas/Error"
  1903. }
  1904. }
  1905. }
  1906. }
  1907. }
  1908. }
  1909. },
  1910. "/jobs/{id}": {
  1911. "get": {
  1912. "summary": "Ingestion job state",
  1913. "security": [
  1914. {
  1915. "bearerAuth": []
  1916. }
  1917. ],
  1918. "parameters": [
  1919. {
  1920. "name": "id",
  1921. "in": "path",
  1922. "required": true,
  1923. "schema": {
  1924. "type": "string",
  1925. "format": "uuid"
  1926. }
  1927. }
  1928. ],
  1929. "responses": {
  1930. "200": {
  1931. "description": "Job"
  1932. },
  1933. "401": {
  1934. "description": "Missing, invalid, revoked or expired API key",
  1935. "content": {
  1936. "application/json": {
  1937. "schema": {
  1938. "$ref": "#/components/schemas/Error"
  1939. }
  1940. }
  1941. }
  1942. },
  1943. "404": {
  1944. "description": "Not found or not visible to the caller",
  1945. "content": {
  1946. "application/json": {
  1947. "schema": {
  1948. "$ref": "#/components/schemas/Error"
  1949. }
  1950. }
  1951. }
  1952. },
  1953. "500": {
  1954. "description": "Internal error",
  1955. "content": {
  1956. "application/json": {
  1957. "schema": {
  1958. "$ref": "#/components/schemas/Error"
  1959. }
  1960. }
  1961. }
  1962. }
  1963. }
  1964. }
  1965. },
  1966. "/documents/{id}": {
  1967. "get": {
  1968. "summary": "Document metadata (?include_content=true adds the normalized text)",
  1969. "security": [
  1970. {
  1971. "bearerAuth": []
  1972. }
  1973. ],
  1974. "parameters": [
  1975. {
  1976. "name": "id",
  1977. "in": "path",
  1978. "required": true,
  1979. "schema": {
  1980. "type": "string",
  1981. "format": "uuid"
  1982. }
  1983. },
  1984. {
  1985. "name": "include_content",
  1986. "in": "query",
  1987. "schema": {
  1988. "type": "boolean"
  1989. }
  1990. }
  1991. ],
  1992. "responses": {
  1993. "200": {
  1994. "description": "Document"
  1995. },
  1996. "401": {
  1997. "description": "Missing, invalid, revoked or expired API key",
  1998. "content": {
  1999. "application/json": {
  2000. "schema": {
  2001. "$ref": "#/components/schemas/Error"
  2002. }
  2003. }
  2004. }
  2005. },
  2006. "404": {
  2007. "description": "Not found or not visible to the caller",
  2008. "content": {
  2009. "application/json": {
  2010. "schema": {
  2011. "$ref": "#/components/schemas/Error"
  2012. }
  2013. }
  2014. }
  2015. },
  2016. "500": {
  2017. "description": "Internal error",
  2018. "content": {
  2019. "application/json": {
  2020. "schema": {
  2021. "$ref": "#/components/schemas/Error"
  2022. }
  2023. }
  2024. }
  2025. }
  2026. }
  2027. }
  2028. },
  2029. "/chunks/{id}": {
  2030. "get": {
  2031. "summary": "One chunk with heading path and source locator (character offsets into the normalized document text)",
  2032. "security": [
  2033. {
  2034. "bearerAuth": []
  2035. }
  2036. ],
  2037. "parameters": [
  2038. {
  2039. "name": "id",
  2040. "in": "path",
  2041. "required": true,
  2042. "schema": {
  2043. "type": "string",
  2044. "format": "uuid"
  2045. }
  2046. }
  2047. ],
  2048. "responses": {
  2049. "200": {
  2050. "description": "Chunk"
  2051. },
  2052. "401": {
  2053. "description": "Missing, invalid, revoked or expired API key",
  2054. "content": {
  2055. "application/json": {
  2056. "schema": {
  2057. "$ref": "#/components/schemas/Error"
  2058. }
  2059. }
  2060. }
  2061. },
  2062. "404": {
  2063. "description": "Not found or not visible to the caller",
  2064. "content": {
  2065. "application/json": {
  2066. "schema": {
  2067. "$ref": "#/components/schemas/Error"
  2068. }
  2069. }
  2070. }
  2071. },
  2072. "500": {
  2073. "description": "Internal error",
  2074. "content": {
  2075. "application/json": {
  2076. "schema": {
  2077. "$ref": "#/components/schemas/Error"
  2078. }
  2079. }
  2080. }
  2081. }
  2082. }
  2083. }
  2084. },
  2085. "/search": {
  2086. "post": {
  2087. "summary": "Hybrid search over current document chunks (lexical fused with vector similarity; lexical only, with a warning, when the embedding provider is off or down). Results are untrusted reference content",
  2088. "security": [
  2089. {
  2090. "bearerAuth": []
  2091. }
  2092. ],
  2093. "requestBody": {
  2094. "required": true,
  2095. "content": {
  2096. "application/json": {
  2097. "schema": {
  2098. "$ref": "#/components/schemas/SearchRequest"
  2099. }
  2100. }
  2101. }
  2102. },
  2103. "responses": {
  2104. "200": {
  2105. "description": "Ranked chunks with locators and content_trust"
  2106. },
  2107. "422": {
  2108. "description": "Validation failed",
  2109. "content": {
  2110. "application/json": {
  2111. "schema": {
  2112. "$ref": "#/components/schemas/Error"
  2113. }
  2114. }
  2115. }
  2116. },
  2117. "401": {
  2118. "description": "Missing, invalid, revoked or expired API key",
  2119. "content": {
  2120. "application/json": {
  2121. "schema": {
  2122. "$ref": "#/components/schemas/Error"
  2123. }
  2124. }
  2125. }
  2126. },
  2127. "404": {
  2128. "description": "Not found or not visible to the caller",
  2129. "content": {
  2130. "application/json": {
  2131. "schema": {
  2132. "$ref": "#/components/schemas/Error"
  2133. }
  2134. }
  2135. }
  2136. },
  2137. "500": {
  2138. "description": "Internal error",
  2139. "content": {
  2140. "application/json": {
  2141. "schema": {
  2142. "$ref": "#/components/schemas/Error"
  2143. }
  2144. }
  2145. }
  2146. }
  2147. }
  2148. }
  2149. },
  2150. "/health/live": {
  2151. "get": {
  2152. "summary": "Liveness",
  2153. "responses": {
  2154. "200": {
  2155. "description": "Live"
  2156. }
  2157. }
  2158. }
  2159. },
  2160. "/health/ready": {
  2161. "get": {
  2162. "summary": "Readiness (database reachable)",
  2163. "responses": {
  2164. "200": {
  2165. "description": "Ready"
  2166. },
  2167. "503": {
  2168. "description": "Unavailable"
  2169. }
  2170. }
  2171. }
  2172. },
  2173. "/context": {
  2174. "post": {
  2175. "summary": "Assemble a token-budgeted task briefing: constraints by scope, working state, preferences, conflicts, hybrid matches and reference passages",
  2176. "security": [
  2177. {
  2178. "bearerAuth": []
  2179. }
  2180. ],
  2181. "requestBody": {
  2182. "required": true,
  2183. "content": {
  2184. "application/json": {
  2185. "schema": {
  2186. "$ref": "#/components/schemas/ContextRequest"
  2187. }
  2188. }
  2189. }
  2190. },
  2191. "responses": {
  2192. "200": {
  2193. "description": "Briefing",
  2194. "content": {
  2195. "application/json": {
  2196. "schema": {
  2197. "$ref": "#/components/schemas/ContextResponse"
  2198. }
  2199. }
  2200. }
  2201. },
  2202. "400": {
  2203. "description": "Empty body or invalid JSON",
  2204. "content": {
  2205. "application/json": {
  2206. "schema": {
  2207. "$ref": "#/components/schemas/Error"
  2208. }
  2209. }
  2210. }
  2211. },
  2212. "401": {
  2213. "description": "Missing, invalid, revoked or expired API key",
  2214. "content": {
  2215. "application/json": {
  2216. "schema": {
  2217. "$ref": "#/components/schemas/Error"
  2218. }
  2219. }
  2220. }
  2221. },
  2222. "404": {
  2223. "description": "session_id not found or not visible to the caller",
  2224. "content": {
  2225. "application/json": {
  2226. "schema": {
  2227. "$ref": "#/components/schemas/Error"
  2228. }
  2229. }
  2230. }
  2231. },
  2232. "422": {
  2233. "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)",
  2234. "content": {
  2235. "application/json": {
  2236. "schema": {
  2237. "$ref": "#/components/schemas/Error"
  2238. }
  2239. }
  2240. }
  2241. },
  2242. "500": {
  2243. "description": "Internal error",
  2244. "content": {
  2245. "application/json": {
  2246. "schema": {
  2247. "$ref": "#/components/schemas/Error"
  2248. }
  2249. }
  2250. }
  2251. }
  2252. }
  2253. }
  2254. }
  2255. }
  2256. }

Powered by TurnKey Linux.