核心概念
作为 Casibase 的用户,您应当熟悉至少 4 个核心概念:提供商、存储、聊天 和 向量。
提供商
提供商是 Casibase 的支柱,提供基本服务并与外部系统集成。 提供商类定义如下:
type Provider struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Category string `xorm:"varchar(100)" json:"category"`
Type string `xorm:"varchar(100)" json:"type"`
ClientId string `xorm:"varchar(100)" json:"clientId"`
ClientSecret string `xorm:"varchar(2000)" json:"clientSecret"`
ProviderUrl string `xorm:"varchar(200)" json:"providerUrl"`
}
Casibase 中主要有两种类型的提供商:
存储提供商。 存储提供商便于在 Casibase 中存储和检索数据。 它支持多种存储选项,包括:
- AWS
- Azure
- 本地文件系统
AI 提供商。 AI 提供商负责处理 Casibase 中与 AI 相关的任务和服务。 它支持多种 AI 模型和技术,包括:
- OpenAI
- ChatGLM
- InternLM
向量
Casibase 中的向量代表不同类型数据的数值表示。 这些向量使得信息处理和分析更加高效。 部分可用的向量类型包括:
- 文本向量
- 图像向量
- …… (其他向量类型)
向量类定义如下:
type Vector struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Store string `xorm:"varchar(100)" json:"store"`
File string `xorm:"varchar(100)" json:"file"`
Text string `xorm:"mediumtext" json:"text"`
Data []float64 `xorm:"mediumtext" json:"data"`
}
聊天
聊天是用户与 Casibase 中 AI 模型之间交互沟通的核心。 它们由三个基本组成部分构成:
- 问题:用户的输入或查询,用于寻求信息或帮助。
- 查询提示:经过格式化的用户问题版本,为 AI 模型的处理做准备。
- 答案:AI 生成的对用户问题的响应,提供相关信息或解决方案。
聊天类定义如下:
type Chat struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
UpdatedTime string `xorm:"varchar(100)" json:"updatedTime"`
DisplayName string `xorm:"varchar(100)" json:"displayName"`
Category string `xorm:"varchar(100)" json:"category"`
Type string `xorm:"varchar(100)" json:"type"`
User1 string `xorm:"varchar(100)" json:"user1"`
User2 string `xorm:"varchar(100)" json:"user2"`
Users []string `xorm:"varchar(100)" json:"users"`
MessageCount int `json:"messageCount"`
}
嵌入
嵌入是将各种类型的数据,如文本和图像,转换成密集向量表示的过程。 此步骤对于促进 Casibase 内高效的数据处理和分析至关重要。
通过嵌入,聊天中的问题和存储中的知识文件将转化为向量,并用于下一步的知识搜索。
Casibase 默认的嵌入方法由 OpenAI 提供,每分钟最多调用三次。 我们建议尽量减少知识文件之间的耦合,以便嵌入和后续处理。
Scans
Scans represent network and security scanning operations executed against infrastructure assets. The Scan object enables automated discovery, security auditing, and system assessment through integrated scan providers.
Each scan targets a specific asset (such as a virtual machine) or IP address, executes using a configured scan provider (like Nmap or OS Patch), and captures results in both raw and structured formats. Scans integrate with the asset inventory to automatically resolve target addresses and maintain historical scanning records for security analysis.