agentbay_knowledge_manage
Manage knowledge entries by archiving, deleting, confirming, or contradicting them within a project for persistent AI agent memory.
Instructions
Archive, delete, confirm, or contradict knowledge entries
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| knowledgeId | Yes | Knowledge entry ID | |
| action | Yes | ||
| projectId | Yes | Project ID |
Implementation Reference
- src/index.ts:364-384 (handler)The actual handler for the agentbay_knowledge_manage tool. It uses apiDelete for 'delete'/'deprecate' actions and apiPatch for 'confirm'/'contradict' actions against the project knowledge API endpoint.
// Tool 17: Knowledge Manage server.tool( 'agentbay_knowledge_manage', 'Archive, delete, confirm, or contradict knowledge entries', { knowledgeId: z.string().describe('Knowledge entry ID'), action: z.enum(['deprecate', 'delete', 'confirm', 'contradict']), projectId: z.string().describe('Project ID'), }, async ({ knowledgeId, action, projectId }) => { if (action === 'delete' || action === 'deprecate') { const data = await apiDelete(`/api/v1/projects/${projectId}/knowledge`, { knowledgeId, action }); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; return { content: [{ type: 'text' as const, text: action === 'delete' ? `Deleted ${data.deleted} entry.` : `Archived ${data.archived} entry.` }] }; } else { const data = await apiPatch(`/api/v1/projects/${projectId}/knowledge`, { knowledgeId, action }); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; return { content: [{ type: 'text' as const, text: `Knowledge ${action}ed: "${data.title}"\nConfidence: ${data.confidence}${data.isDeprecated ? ' (auto-deprecated)' : ''}` }] }; } } ); - src/index.ts:365-372 (schema)Input schema definition for agentbay_knowledge_manage: requires knowledgeId (string), action (enum: deprecate/delete/confirm/contradict), and projectId (string).
server.tool( 'agentbay_knowledge_manage', 'Archive, delete, confirm, or contradict knowledge entries', { knowledgeId: z.string().describe('Knowledge entry ID'), action: z.enum(['deprecate', 'delete', 'confirm', 'contradict']), projectId: z.string().describe('Project ID'), }, - src/index.ts:364-384 (registration)Tool registration via server.tool() call with the name 'agentbay_knowledge_manage' and description 'Archive, delete, confirm, or contradict knowledge entries'.
// Tool 17: Knowledge Manage server.tool( 'agentbay_knowledge_manage', 'Archive, delete, confirm, or contradict knowledge entries', { knowledgeId: z.string().describe('Knowledge entry ID'), action: z.enum(['deprecate', 'delete', 'confirm', 'contradict']), projectId: z.string().describe('Project ID'), }, async ({ knowledgeId, action, projectId }) => { if (action === 'delete' || action === 'deprecate') { const data = await apiDelete(`/api/v1/projects/${projectId}/knowledge`, { knowledgeId, action }); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; return { content: [{ type: 'text' as const, text: action === 'delete' ? `Deleted ${data.deleted} entry.` : `Archived ${data.archived} entry.` }] }; } else { const data = await apiPatch(`/api/v1/projects/${projectId}/knowledge`, { knowledgeId, action }); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; return { content: [{ type: 'text' as const, text: `Knowledge ${action}ed: "${data.title}"\nConfidence: ${data.confidence}${data.isDeprecated ? ' (auto-deprecated)' : ''}` }] }; } } );