> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memloom.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Walk the graph from one entity

> Everything connected to one entity. The target may be an id, a name, or a spelling
that was folded away; an alias resolves to its canonical entity and `matchedAlias`
reports which spelling was asked for.

Two kinds of connection come back separately and are never blended into one score.
Stated links are typed predicate edges extraction asserted, with their direction from
the asked-about end. Co-mention is entities named by the same sources, which is weaker
evidence and never outranks a stated link.

The target is matched exactly, not by meaning. This is a graph lookup, not a search.




## OpenAPI

````yaml /openapi.yaml get /memory/entities/related
openapi: 3.1.0
info:
  title: memloom local API
  version: 0.1.0
  description: >
    The HTTP API served by the `memloom serve` daemon on your machine. The CLI,
    the MCP server,

    and the viewer all route through this API. The daemon is the single owner of
    the store, so

    every client shares one consistent view of your memories.


    No authentication: the daemon binds to `127.0.0.1` only and is reachable
    solely from your

    own machine. Browser clients on other localhost ports are allowed via CORS.
servers:
  - url: http://127.0.0.1:4319
    description: Local memloom daemon
security: []
paths:
  /memory/entities/related:
    get:
      summary: Walk the graph from one entity
      description: >
        Everything connected to one entity. The target may be an id, a name, or
        a spelling

        that was folded away; an alias resolves to its canonical entity and
        `matchedAlias`

        reports which spelling was asked for.


        Two kinds of connection come back separately and are never blended into
        one score.

        Stated links are typed predicate edges extraction asserted, with their
        direction from

        the asked-about end. Co-mention is entities named by the same sources,
        which is weaker

        evidence and never outranks a stated link.


        The target is matched exactly, not by meaning. This is a graph lookup,
        not a search.
      operationId: relatedEntities
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
          description: An entity id, name, or known alias.
          example: Bob
        - name: type
          in: query
          schema:
            type: string
          description: Only return neighbours of this entity type.
          example: person
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
      responses:
        '200':
          description: The entity and its neighbourhood.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelatedEntities'
        '400':
          description: q is missing.
        '404':
          description: No entity matches the target.
components:
  schemas:
    RelatedEntities:
      type: object
      properties:
        entity:
          $ref: '#/components/schemas/EntityDetail'
        matchedAlias:
          type: string
          nullable: true
          description: >-
            The spelling asked for, when it was an alias rather than the
            entity's name.
          example: Bob
        related:
          type: array
          items:
            $ref: '#/components/schemas/RelatedEntity'
        truncated:
          type: integer
          description: >-
            Neighbours beyond limit, so a cut answer never reads as a complete
            one.
    EntityDetail:
      type: object
      description: An entity with its usage counts.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: PostgreSQL
        entityType:
          type: string
          example: technology
        mentions:
          type: integer
          description: Active mention edges pointing at this entity.
        memories:
          type: integer
          description: Distinct active memories that mention it.
        documents:
          type: integer
          description: Distinct context documents whose chunks mention it.
        aliases:
          type: array
          description: Spellings folded into this entity. Empty when nothing was merged in.
          items:
            type: string
          example:
            - Opus 4.8
    RelatedEntity:
      type: object
      description: One entity connected to the entity being asked about, and how.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: memloom
        entityType:
          type: string
          example: project
        mentions:
          type: integer
          description: Active mention edges pointing at this entity, so you can weigh it.
        aliases:
          type: array
          items:
            type: string
        links:
          type: array
          description: >-
            Stated relationships between the two. Empty means the connection is
            co-mention only: they turn up in the same memories without the graph
            asserting how they relate.
          items:
            type: object
            properties:
              relation:
                type: string
                example: works_on
              direction:
                type: string
                enum:
                  - out
                  - in
                description: >-
                  out when the asked-about entity is the subject, in when it is
                  the object.
              confidence:
                type: number
                nullable: true
        sharedSources:
          type: integer
          description: Distinct memories and chunks that mention both.

````