Eder Labs Ingestion API

Getting content into a user's memory

OpenAPI Specification

eder-labs-ingestion-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Persona Ingestion API
  version: 1.0.0
  description: 'Persona is an open-source (MIT) user-memory system for AI agents, built by Eder Labs. It ingests raw content (conversations, notes) for a user, extracts a Graph-Vector hybrid memory (Neo4j graph + vector embeddings), and answers natural-language RAG queries or returns structured insights over that memory. This specification is transcribed faithfully from the published FastAPI router source (server/routers/graph_api.py) and the docs/API.md reference of github.com/saxenauts/persona. Persona is self-hosted: the base URL below is the documented local default; deploy behind your own host and auth layer.'
  license:
    name: MIT
    url: https://github.com/saxenauts/persona/blob/main/LICENSE
  contact:
    name: Persona (Eder Labs)
    url: https://docs.buildpersona.ai/
    email: utkarsh@buildpersona.ai
  x-apievangelist:
    source: https://github.com/saxenauts/persona/blob/main/server/routers/graph_api.py
    docs: https://docs.buildpersona.ai/
    method: searched
servers:
- url: http://localhost:8000/api/v1
  description: Documented self-hosted local default (uvicorn / docker compose)
tags:
- name: Ingestion
  description: Getting content into a user's memory
paths:
  /users/{user_id}/ingest:
    post:
      operationId: ingest_data
      summary: Ingest content
      description: Ingests a single piece of raw content into the user's memory. The content is extracted into episodes/nodes/relationships and persisted to the graph.
      tags:
      - Ingestion
      parameters:
      - $ref: '#/components/parameters/UserId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestRequest'
      responses:
        '201':
          description: Content ingested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestResult'
        '400':
          description: Empty or invalid content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Database (Neo4j) connection error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /users/{user_id}/ingest/batch:
    post:
      operationId: ingest_batch_data
      summary: Batch ingest content
      description: Ingests a list of content items into the user's memory in one call.
      tags:
      - Ingestion
      parameters:
      - $ref: '#/components/parameters/UserId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestBatchRequest'
      responses:
        '201':
          description: Batch ingested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestResult'
        '400':
          description: Empty batch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Database (Neo4j) connection error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    IngestResult:
      type: object
      properties:
        message:
          type: string
          example: Data ingested successfully
        memories_created:
          type: integer
          example: 3
    IngestBatchRequest:
      type: object
      required:
      - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/IngestRequest'
    IngestRequest:
      type: object
      required:
      - content
      properties:
        content:
          type: string
          description: Raw text content to ingest.
          example: Had a great meeting with Sarah about the Q4 roadmap...
        source_type:
          type: string
          default: conversation
          description: Type of content (conversation, notes, etc.)
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Optional metadata.
    Error:
      type: object
      description: FastAPI default error envelope.
      properties:
        detail:
          type: string
          example: User alice not found
  parameters:
    UserId:
      name: user_id
      in: path
      required: true
      description: The unique identifier for the user. Pattern ^[a-zA-Z0-9_-]+$.
      schema:
        type: string
        pattern: ^[a-zA-Z0-9_-]+$