> For the complete documentation index, see [llms.txt](https://api.docs.blockbrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.docs.blockbrain.ai/getting-started/knowledge-management/save-and-contribute-insights.md).

# Save & Contribute Insights

[Insight](/concepts/insight.md) are durable knowledge artifacts captured from conversations and related sources. Each insight (also referred to as a note) contains summarized understanding, provenance, and links to underlying messages and document references.&#x20;

## Create an Insight from a Message

Often, outputs of [Interact with Bot](/getting-started/getting-started/interact-with-bot.md) are highly valuable as input for further conversations. Saving these pieces of knowledge as insights in your system makes them easily reusable.&#x20;

Here we need to provide a specific messageId of the response of the LLM that we want so store. This messageId is being sent in the [Interact with Bot](/getting-started/getting-started/interact-with-bot.md) step.

## POST /cortex/notes/generate

> Generate Chat Note

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"InsightsGraphType":{"type":"string","enum":["STATUS_QUO","VISION","LEGACY"],"title":"InsightsGraphType"},"Insight":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"summary":{"type":"string","title":"Summary"},"userId":{"type":"string","title":"Userid"},"fromUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fromuserid"},"latestMessageCreated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Latestmessagecreated"},"isEdited":{"type":"boolean","title":"Isedited","default":false},"messages":{"items":{"$ref":"#/components/schemas/CortexMessage"},"type":"array","title":"Messages","default":[]},"title":{"type":"string","title":"Title","default":"New Note"},"tokenCount":{"type":"integer","title":"Tokencount","default":0},"insightsGraphType":{"anyOf":[{"$ref":"#/components/schemas/InsightsGraphType"},{"type":"null"}]},"model":{"anyOf":[{"$ref":"#/components/schemas/AIModel"},{"$ref":"#/components/schemas/ImageGenerationModel"},{"$ref":"#/components/schemas/VideoGenerationModel"},{"type":"null"}],"title":"Model"},"isContributed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Iscontributed","default":false},"vectorData":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Vectordata","default":[]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messageid","default":""},"doc_ref":{"anyOf":[{"items":{"$ref":"#/components/schemas/DocRef"},"type":"array"},{"type":"null"}],"title":"Doc Ref"},"web_ref":{"anyOf":[{"items":{"$ref":"#/components/schemas/WebSearchRef"},"type":"array"},{"type":"null"}],"title":"Web Ref"},"web_pro_ref":{"anyOf":[{"items":{"$ref":"#/components/schemas/WebSearchProRef"},"type":"array"},{"type":"null"}],"title":"Web Pro Ref"},"webSearchQuery":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Websearchquery"},"is_web_pro_r":{"type":"boolean","title":"Is Web Pro R","default":false},"webSearchConfig":{"anyOf":[{"$ref":"#/components/schemas/WebSearchConfig"},{"type":"null"}]},"updateType":{"anyOf":[{"$ref":"#/components/schemas/InsightUpdateType"},{"type":"null"}],"default":"manual"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"},"lastGeneratedContentAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lastgeneratedcontentat"},"isIncludeChatHistory":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isincludechathistory","default":true},"mediaUrls":{"anyOf":[{"items":{"$ref":"#/components/schemas/GeneratedMedia"},"type":"array"},{"type":"null"}],"title":"Mediaurls"}},"type":"object","required":["summary","userId"],"title":"Insight"},"CortexMessage":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"botId":{"type":"string","title":"Botid"},"userId":{"type":"string","title":"Userid"},"convoId":{"type":"string","title":"Convoid"},"content":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}],"title":"Content"},"role":{"type":"string","title":"Role"},"model":{"anyOf":[{"$ref":"#/components/schemas/AIModel"},{"$ref":"#/components/schemas/ImageGenerationModel"},{"$ref":"#/components/schemas/VideoGenerationModel"},{"type":"null"}],"title":"Model"},"messageType":{"$ref":"#/components/schemas/api__nexus__conversation__constants__MessageType","default":"assistant-greeting"},"status":{"$ref":"#/components/schemas/MessageStatus","default":"activate"},"langfuseUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Langfuseurl","default":""},"currentContent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currentcontent"},"uploadedFiles":{"items":{"$ref":"#/components/schemas/AttachedFiles"},"type":"array","title":"Uploadedfiles","default":[]},"isSaved":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Issaved","default":false},"noteId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Noteid"},"insightsGraphType":{"anyOf":[{"$ref":"#/components/schemas/InsightsGraphType"},{"type":"null"}]},"doc_ref":{"anyOf":[{"items":{"$ref":"#/components/schemas/DocRef"},"type":"array"},{"type":"null"}],"title":"Doc Ref"},"webSearchQuery":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Websearchquery"},"webRef":{"items":{"$ref":"#/components/schemas/WebSearchRef"},"type":"array","title":"Webref"},"webProRef":{"items":{"$ref":"#/components/schemas/WebSearchProRef"},"type":"array","title":"Webproref"},"isWebProR":{"type":"boolean","title":"Iswebpror","default":false},"webSearchConfig":{"anyOf":[{"$ref":"#/components/schemas/WebSearchConfig"},{"type":"null"}]},"standaloneQuestion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Standalonequestion"},"relatedChunkIds":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Relatedchunkids","default":[]},"targetText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Targettext"},"targetMessageId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Targetmessageid"},"targetFullContent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Targetfullcontent"},"messageReplies":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Messagereplies","default":[]},"isUnliked":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isunliked"},"feedbackAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Feedbackat"},"feedbackContent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedbackcontent"},"selectedWorkflowId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selectedworkflowid","default":""},"workflow":{"anyOf":[{"$ref":"#/components/schemas/SelectedWorkflow"},{"type":"null"}]},"selectedAgentTask":{"anyOf":[{"$ref":"#/components/schemas/AgentTaskDetailedDTO"},{"type":"null"}]},"selectedStrategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selectedstrategy","default":""},"selectedAction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selectedaction","default":""},"strategies":{"items":{"$ref":"#/components/schemas/CortexStrategyResponse"},"type":"array","title":"Strategies","default":[]},"targetSelectedStrategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Targetselectedstrategy","default":""},"targetSelectedAction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Targetselectedaction","default":""},"targetAgentTask":{"anyOf":[{"$ref":"#/components/schemas/AgentTaskDetailedDTO"},{"type":"null"}]},"promptMessageId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promptmessageid","default":""},"messageQueryId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messagequeryid"},"mediaUrls":{"anyOf":[{"items":{"$ref":"#/components/schemas/GeneratedMedia"},"type":"array"},{"type":"null"}],"title":"Mediaurls"}},"type":"object","required":["botId","userId","convoId","content","role"],"title":"CortexMessage"},"AIModel":{"type":"string","enum":["gpt-3.5-turbo","gpt-4","gpt-4-1106-preview","gpt-4-vision","gpt-4o","gpt-4o-mini","gpt-45","gpt-5","gpt-5-mini","gpt-5-nano","gpt-5-chat","openai-o1","openai-o1-mini","openai-o3-mini","openai-o3","openai-o4-mini","openai-o3-pro","openai-gpt-4o-realtime-audio","azure-gpt-35-turbo","azure-gpt-4","azure-gpt-4-turbo","azure-gpt-4-turbo-vision","azure-gpt-4o","azure-gpt-4o-mini","azure-gpt-41","azure-gpt-41-mini","azure-gpt-41-nano","azure-gpt-5","azure-gpt-5-mini","azure-gpt-5-nano","azure-gpt-5-chat","azure-model-router","azure-openai-o1","azure-openai-o1-mini","azure-openai-o3-mini","azure-openai-o3","azure-openai-o4-mini","azure-openai-o3-pro","azure-gpt-4o-realtime-audio","azure-ai-deepseek-r1-us","anthropic-claude-v3-opus","anthropic-claude-v3-sonnet","anthropic-claude-v3-haiku","anthropic-claude-v3.5-sonnet","anthropic-claude-v3.5-sonnet-v2","anthropic-claude-v3.7-sonnet","anthropic-claude-v3.7-sonnet-thinking-mode","anthropic-claude-opus-4","anthropic-claude-sonnet-4","anthropic-claude-opus-4.1","google-gemini","google-gemini-1.0-vision","google-gemini-1.5-pro","google-gemini-1.5-flash","google-gemini-2.0-flash","google-gemini-2.0-flash-thinking-mode","google-gemini-2.0-flash-lite","google-gemini-2.5-pro","google-gemini-2.5-flash","google-gemini-2.5-flash-lite","google-vertex-gemma-2","google-vertex-mistral-large","google-vertex-mistral-nemo","google-vertex-codestral","google-anthropic-claude-v3-opus","google-anthropic-claude-v3-sonnet","google-anthropic-claude-v3-haiku","google-anthropic-claude-v3.5-sonnet","google-anthropic-claude-v3.5-sonnet-v2","google-anthropic-claude-v3.5-haiku","google-anthropic-claude-v3.7-sonnet","google-anthropic-claude-v3.7-sonnet-thinking-mode","google-anthropic-claude-opus-4","google-anthropic-claude-sonnet-4","google-anthropic-claude-opus-4.1","google-llama-405b-maas","google-llama-70b-maas","google-llama-8b-maas","google-llama-32-90b-vision-maas","google-llama-4-scout-17b-16e-maas","google-llama-4-maverick-17b-128e-maas","google-vertex-ai21-jamba-large","google-vertex-ai21-jamba-mini","deepseek-chat-v3","deepseek-reasoner","nebius-deepseek-chat-v3","nebius-deepseek-r1","xai-grok-3","xai-grok-3-mini","xai-grok-3-mini-thinking-mode","xai-grok-2-vision","xai-grok-4","mistral-medium","mistral-small","mistral-large","magistral-medium"],"title":"AIModel"},"ImageGenerationModel":{"type":"string","enum":["openai-dall-e-3","azure-dall-e-3","google-vertex-imagen","azure-gpt-image-1"],"title":"ImageGenerationModel"},"VideoGenerationModel":{"type":"string","enum":["azure-sora","vertex-ai-veo-2","vertex-ai-veo-3","vertex-ai-veo-3-fast"],"title":"VideoGenerationModel"},"api__nexus__conversation__constants__MessageType":{"type":"string","enum":["assistant-greeting","assistant-response","user-idea","user-question","user-select-agent","greeting","conversation","user-direct-agent"],"title":"MessageType"},"MessageStatus":{"type":"string","enum":["activate","deactivate","deleted"],"title":"MessageStatus"},"AttachedFiles":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"name":{"type":"string","title":"Name"},"key":{"type":"string","title":"Key"},"tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens","default":0},"enabled":{"type":"boolean","title":"Enabled","default":true},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errormessage"},"status":{"$ref":"#/components/schemas/AttachmentStatus","default":"SUCCESS"},"calculatedStatus":{"$ref":"#/components/schemas/CalculatedStatus","default":"SUCCESS"},"convoId":{"type":"string","title":"Convoid","default":""},"fileType":{"anyOf":[{"$ref":"#/components/schemas/AttachmentFileType"},{"type":"null"}],"default":"TEXT"},"fileSize":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Filesize","default":0},"imageDescription":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imagedescription","default":""},"imageWidth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Imagewidth"},"imageHeight":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Imageheight"},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Userid"},"imageResizeKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imageresizekey"},"imageThumbKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imagethumbkey"},"zipAttachmentId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zipattachmentid"}},"type":"object","required":["name","key"],"title":"AttachedFiles"},"AttachmentStatus":{"type":"string","enum":["IN_PROGRESS","SUCCESS","SUCCESS_TRUNCATED","FAILED"],"title":"AttachmentStatus"},"CalculatedStatus":{"type":"string","enum":["IN_PROGRESS","SUCCESS","FAILED"],"title":"CalculatedStatus"},"AttachmentFileType":{"type":"string","enum":["TEXT","IMAGE","AUDIO","VIDEO","OTHER"],"title":"AttachmentFileType"},"DocRef":{"properties":{"doc_id":{"type":"string","title":"Doc Id"},"doc_name":{"type":"string","title":"Doc Name"},"text_id":{"items":{"anyOf":[{"$ref":"#/components/schemas/Chunk"},{"type":"string"}]},"type":"array","title":"Text Id","default":[]},"originalUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Originalurl"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","default":0},"doc_type":{"anyOf":[{"$ref":"#/components/schemas/RefDocType"},{"type":"null"}],"default":"vector-db"},"isTemplate":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Istemplate","default":false},"imageResizeKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imageresizekey"},"imageThumbKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imagethumbkey"}},"type":"object","required":["doc_id","doc_name"],"title":"DocRef"},"Chunk":{"properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"text_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Id"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","default":0},"isRelatedChunk":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isrelatedchunk","default":false},"doc_type":{"anyOf":[{"$ref":"#/components/schemas/RefDocType"},{"type":"null"}],"default":"vector-db"}},"type":"object","title":"Chunk"},"RefDocType":{"type":"string","enum":["vector-db","prompt-injection","full-text-db","hybrid-db"],"title":"RefDocType"},"WebSearchRef":{"properties":{"query":{"type":"string","title":"Query"},"answer":{"items":{"$ref":"#/components/schemas/WebRef"},"type":"array","title":"Answer","default":[]}},"type":"object","required":["query"],"title":"WebSearchRef"},"WebRef":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"content":{"type":"string","title":"Content"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"type":"object","required":["id","url","content"],"title":"WebRef"},"WebSearchProRef":{"properties":{"question":{"type":"string","title":"Question"},"search_queries":{"items":{"$ref":"#/components/schemas/WebSearchRef"},"type":"array","title":"Search Queries","default":[]}},"type":"object","required":["question"],"title":"WebSearchProRef"},"WebSearchConfig":{"properties":{"webSearchProvider":{"$ref":"#/components/schemas/WebSearchProvider","default":"linkup_normal_web_search"},"isLinkupDeepSearch":{"type":"boolean","title":"Islinkupdeepsearch","default":false}},"type":"object","title":"WebSearchConfig"},"WebSearchProvider":{"type":"string","enum":["linkup_normal_web_search","linkup_pro_web_search","linkup_pro_r_web_search","tavily_normal_web_search","tavily_pro_web_search","tavily_pro_r_web_search","perplexity_normal_web_search","perplexity_pro_web_search"],"title":"WebSearchProvider"},"SelectedWorkflow":{"properties":{"runTaskId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtaskid","default":""},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflowid","default":""},"workflowName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflowname","default":""},"stepId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stepid","default":""},"stepName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stepname","default":""}},"type":"object","title":"SelectedWorkflow"},"AgentTaskDetailedDTO":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"category_id":{"type":"string","title":"Category Id"},"name":{"type":"string","title":"Name"},"type":{"$ref":"#/components/schemas/AgentTaskType","default":"custom"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"$ref":"#/components/schemas/AgentCategoryDetailedDTO"},{"type":"null"}]},"isFavorite":{"type":"boolean","title":"Isfavorite","default":false},"isSelected":{"type":"boolean","title":"Isselected","default":false},"isActive":{"type":"boolean","title":"Isactive","default":false},"categoryName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Categoryname"}},"type":"object","required":["_id","createdAt","modifiedAt","category_id","name"],"title":"AgentTaskDetailedDTO"},"AgentTaskType":{"type":"string","enum":["custom","template","tenant"],"title":"AgentTaskType"},"AgentCategoryDetailedDTO":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"icon":{"type":"string","title":"Icon"},"name":{"type":"string","title":"Name"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"isPublic":{"type":"boolean","title":"Ispublic","default":false},"isTemplate":{"type":"boolean","title":"Istemplate","default":false}},"type":"object","required":["_id","createdAt","modifiedAt","icon","name"],"title":"AgentCategoryDetailedDTO"},"CortexStrategyResponse":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug","default":""},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"icon":{"type":"string","title":"Icon","description":"icon key from heroicons","default":""},"actions":{"items":{"$ref":"#/components/schemas/CortextActionResponse"},"type":"array","title":"Actions"},"scopes":{"items":{"$ref":"#/components/schemas/CortexStrategyScope"},"type":"array","title":"Scopes","default":["scope-bot","scope-user"]},"isDefault":{"type":"boolean","title":"Isdefault","default":true}},"type":"object","required":["name","actions"],"title":"CortexStrategyResponse"},"CortextActionResponse":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug","default":""},"prompt":{"type":"string","title":"Prompt","default":""},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon","description":"icon key from heroicons","default":""},"isDefault":{"type":"boolean","title":"Isdefault","default":true}},"type":"object","required":["name"],"title":"CortextActionResponse"},"CortexStrategyScope":{"type":"string","enum":["scope-user","scope-bot"],"title":"CortexStrategyScope"},"GeneratedMedia":{"properties":{"contentType":{"type":"string","title":"Contenttype"},"url":{"type":"string","title":"Url","description":"The URL of the generated media file."}},"type":"object","required":["contentType","url"],"title":"GeneratedMedia"},"InsightUpdateType":{"type":"string","enum":["manual","auto_update"],"title":"InsightUpdateType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/cortex/notes/generate":{"post":{"tags":["cortex","cortex notes"],"summary":"Generate Chat Note","operationId":"generate_chat_note_cortex_notes_generate_post","parameters":[{"name":"convo_id","in":"query","required":true,"schema":{"type":"string","title":"Convo Id"}},{"name":"latest_message_id","in":"query","required":true,"schema":{"type":"string","title":"Latest Message Id"}},{"name":"insightsGraphType","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/InsightsGraphType"},{"type":"null"}],"title":"Insightsgraphtype"}},{"name":"is_pin","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Pin"}},{"name":"parent_path","in":"query","required":false,"schema":{"type":"string","default":"root","title":"Parent Path"}},{"name":"is_include_chat_history","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"title":"Is Include Chat History"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Insight"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Create a new Insight

Creating fully new Insights from knowledge retrieved programmatically is another use case that can be handled by API. In this case, a new insight is added based on a title and summary in a given path, where **`root`**, again, is the base folder. &#x20;

## POST /cortex/notes/add-note

> Add Chat Note Manual

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"NoteCreateDTO":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"parent_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Path","default":"root"}},"type":"object","title":"NoteCreateDTO"},"NoteShortDTO":{"properties":{"_id":{"type":"string","title":"Id"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"modifiedAt":{"type":"string","format":"date-time","title":"Modifiedat"},"title":{"type":"string","title":"Title"},"isEdited":{"type":"boolean","title":"Isedited","default":false}},"type":"object","required":["_id","createdAt","modifiedAt","title"],"title":"NoteShortDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/cortex/notes/add-note":{"post":{"tags":["cortex","cortex notes"],"summary":"Add Chat Note Manual","operationId":"add_chat_note_manual_cortex_notes_add_note_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteCreateDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteShortDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Contribute Insights to a Knowledgebase&#x20;

Going one step further, insights can also be contributed and therefore stored in Knowledgebases. The large difference here is that, upon using as part of a [Create a Dataroom](/getting-started/getting-started/add-convo-to-bot.md), **Insights are pulled into the context in full, while Knowledgebases are used for RAG and only relevant chunks of data are being added to the context.**

## POST /cortex/notes/save-insights-to-knowledge-base

> Save Insights To Knowledge Base

```json
{"openapi":"3.1.0","info":{"title":"Blockbrain Knowledge Bots","version":"0.2.6"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"Body_save_insights_to_knowledge_base_cortex_notes_save_insights_to_knowledge_base_post":{"properties":{"knowledge_folders_destination":{"items":{"$ref":"#/components/schemas/SaveInsightToKnowledgeBaseRequest"},"type":"array","title":"Knowledge Folders Destination"},"time_zone":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Time Zone","default":2}},"type":"object","required":["knowledge_folders_destination"],"title":"Body_save_insights_to_knowledge_base_cortex_notes_save_insights_to_knowledge_base_post"},"SaveInsightToKnowledgeBaseRequest":{"properties":{"noteIds":{"items":{"type":"string"},"type":"array","title":"Noteids","default":[]},"folderNoteIds":{"items":{"type":"string"},"type":"array","title":"Foldernoteids","default":[]},"knowledgeBase":{"type":"string","title":"Knowledgebase"},"folderPath":{"type":"string","title":"Folderpath","default":"root"}},"type":"object","required":["knowledgeBase"],"title":"SaveInsightToKnowledgeBaseRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/cortex/notes/save-insights-to-knowledge-base":{"post":{"tags":["cortex","cortex notes"],"summary":"Save Insights To Knowledge Base","operationId":"save_insights_to_knowledge_base_cortex_notes_save_insights_to_knowledge_base_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_save_insights_to_knowledge_base_cortex_notes_save_insights_to_knowledge_base_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.docs.blockbrain.ai/getting-started/knowledge-management/save-and-contribute-insights.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
