Skip to content

chunking

Package github.com/emergent-company/emergent.memory/apps/server/pkg/sdk/chunking

The chunking client re-runs the chunking pipeline on an already-ingested document, using the project’s current chunking strategy.

func (c *Client) RecreateChunks(ctx context.Context, documentID string) (*RecreateChunksResponse, error)
type RecreateChunksResponse struct {
Status string
Summary RecreateChunksSummary
}
type RecreateChunksSummary struct {
OldChunks int
NewChunks int
Strategy string
ParentChild bool
AutoProfile bool
Shape string
Config map[string]any
}
resp, err := client.Chunking.RecreateChunks(ctx, "doc_abc123")
if err != nil {
return err
}
fmt.Printf("re-chunked with %s: %d → %d chunks\n",
resp.Summary.Strategy,
resp.Summary.OldChunks,
resp.Summary.NewChunks,
)
if resp.Summary.AutoProfile {
fmt.Printf("shape detected: %s\n", resp.Summary.Shape)
}