apidocs
Package apidocs provides a client for the Memory built-in API documentation endpoints.
The apidocs client is a non-context client — it requires no org or project context. It provides access to the server’s internal documentation registry: a curated index of documentation articles that can be listed, searched, and browsed by category.
Not the OpenAPI/Swagger spec. This client accesses the built-in documentation articles at
/api/docs. For the OpenAPI specification, fetch/openapi.jsondirectly.
Import
Section titled “Import”import "github.com/emergent-company/emergent.memory/apps/server/pkg/sdk/apidocs"Client
Section titled “Client”type Client struct { /* unexported */ }Obtained via sdk.Client.APIDocs. No SetContext call is needed or available.
Methods
Section titled “Methods”ListDocuments
Section titled “ListDocuments”func (c *Client) ListDocuments(ctx context.Context) (*ListDocumentsResponse, error)Returns metadata for all available documentation articles.
Endpoint: GET /api/docs
GetDocument
Section titled “GetDocument”func (c *Client) GetDocument(ctx context.Context, slug string) (*Document, error)Returns the full content of a documentation article by its slug.
Endpoint: GET /api/docs/{slug}
GetCategories
Section titled “GetCategories”func (c *Client) GetCategories(ctx context.Context) (*CategoriesResponse, error)Returns the list of documentation categories with descriptions.
Endpoint: GET /api/docs/categories
DocumentMeta
Section titled “DocumentMeta”type DocumentMeta struct { ID string `json:"id"` Slug string `json:"slug"` Title string `json:"title"` Category string `json:"category"` Path string `json:"path"` Description string `json:"description"` Tags []string `json:"tags"` LastUpdated string `json:"lastUpdated"` ReadTime int `json:"readTime"` // estimated minutes Related []string `json:"related"` // related article slugs}Returned in list views (no Content field).
Document
Section titled “Document”type Document struct { ID string `json:"id"` Slug string `json:"slug"` Title string `json:"title"` Category string `json:"category"` Path string `json:"path"` Description string `json:"description"` Tags []string `json:"tags"` LastUpdated string `json:"lastUpdated"` ReadTime int `json:"readTime"` Related []string `json:"related"` Content string `json:"content"` // full markdown/HTML body ParsedAt time.Time `json:"parsedAt"`}ListDocumentsResponse
Section titled “ListDocumentsResponse”type ListDocumentsResponse struct { Documents []DocumentMeta `json:"documents"` Total int `json:"total"`}CategoryInfo
Section titled “CategoryInfo”type CategoryInfo struct { Name string `json:"name"` Description string `json:"description"` Icon string `json:"icon"`}CategoriesResponse
Section titled “CategoriesResponse”type CategoriesResponse struct { Categories []CategoryInfo `json:"categories"` Total int `json:"total"`}Example
Section titled “Example”// List all doc articlesdocs, err := client.APIDocs.ListDocuments(ctx)if err != nil { log.Fatal(err)}fmt.Printf("%d documentation articles available\n", docs.Total)for _, d := range docs.Documents { fmt.Printf(" [%s] %s (%d min read)\n", d.Category, d.Title, d.ReadTime)}
// Fetch a specific article by slugarticle, err := client.APIDocs.GetDocument(ctx, "graph-id-model")if err != nil { log.Fatal(err)}fmt.Println(article.Content)
// List categoriescats, err := client.APIDocs.GetCategories(ctx)if err != nil { log.Fatal(err)}for _, c := range cats.Categories { fmt.Printf("%s: %s\n", c.Name, c.Description)}