feat: implement preview of user level memory graph

Signed-off-by: joeyczheng <joeyczheng@tencent.com>
This commit is contained in:
joeyczheng
2026-02-12 16:02:09 +08:00
committed by lyingbug
parent 6adecdb30e
commit 12baa885d2
18 changed files with 624 additions and 18 deletions
+3
View File
@@ -30,6 +30,7 @@ type qaRequestContext struct {
knowledgeIDs []string
summaryModelID string
webSearchEnabled bool
enableMemory bool // Whether memory feature is enabled
mentionedItems types.MentionedItems
effectiveTenantID uint64 // when using shared agent, tenant ID for model/KB/MCP resolution; 0 = use context tenant
}
@@ -166,6 +167,7 @@ func (h *Handler) parseQARequest(c *gin.Context, logPrefix string) (*qaRequestCo
knowledgeIDs: secutils.SanitizeForLogArray(knowledgeIDs),
summaryModelID: secutils.SanitizeForLog(request.SummaryModelID),
webSearchEnabled: request.WebSearchEnabled,
enableMemory: request.EnableMemory,
mentionedItems: convertMentionedItems(request.MentionedItems),
effectiveTenantID: effectiveTenantID,
}
@@ -449,6 +451,7 @@ func (h *Handler) executeNormalModeQA(reqCtx *qaRequestContext, generateTitle bo
reqCtx.webSearchEnabled,
streamCtx.eventBus,
reqCtx.customAgent,
reqCtx.enableMemory,
)
if err != nil {
logger.ErrorWithFields(streamCtx.asyncCtx, err, nil)
+1
View File
@@ -38,6 +38,7 @@ type CreateKnowledgeQARequest struct {
SummaryModelID string `json:"summary_model_id"` // Optional summary model ID for this request (overrides session default)
MentionedItems []MentionedItemRequest `json:"mentioned_items"` // @mentioned knowledge bases and files
DisableTitle bool `json:"disable_title"` // Whether to disable auto title generation
EnableMemory bool `json:"enable_memory"` // Whether memory feature is enabled for this request
}
// SearchKnowledgeRequest defines the request structure for searching knowledge without LLM summarization