AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import {
KnowledgeBaseEmbeddingSource,
KnowledgeBaseFile,
} from '@activepieces/shared';
import { api } from '@/lib/api';
import { authenticationSession } from '@/lib/authentication-session';
export const knowledgeBaseApi = {
list(): Promise<KnowledgeBaseFile[]> {
const projectId = authenticationSession.getProjectId()!;
return api.get<KnowledgeBaseFile[]>('/v1/knowledge-base/files', {
projectId,
});
},
embeddingSource(): Promise<KnowledgeBaseEmbeddingSource> {
const projectId = authenticationSession.getProjectId()!;
return api.get<KnowledgeBaseEmbeddingSource>(
'/v1/knowledge-base/files/embedding-source',
{ projectId },
);
},
upload(formData: FormData): Promise<KnowledgeBaseFile> {
const projectId = authenticationSession.getProjectId()!;
return api.any<KnowledgeBaseFile>(
`/v1/knowledge-base/files/upload?projectId=${encodeURIComponent(
projectId,
)}`,
{
method: 'POST',
data: formData,
},
);
},
delete(fileId: string): Promise<void> {
const projectId = authenticationSession.getProjectId()!;
return api.delete<void>(`/v1/knowledge-base/files/${fileId}`, {
projectId,
});
},
};