feat: persistent AI memory — chat history + knowledge store

agent-chat/route.ts:
- Loads conversation history from chat_conversations before each turn
- Passes history + knowledge context to agent runner
- Saves returned history back to chat_conversations after each turn
- Saves AI-generated memory updates to fs_knowledge_items

knowledge/route.ts (new):
- GET  /api/projects/[id]/knowledge — list all knowledge items
- POST /api/projects/[id]/knowledge — add/update item by key
- DELETE /api/projects/[id]/knowledge?id=xxx — remove item

OrchestratorChat.tsx:
- Added "Saved to memory" label for save_memory tool calls

Made-with: Cursor
This commit is contained in:
2026-02-27 18:55:41 -08:00
parent a893d95387
commit 8c3486dd58
3 changed files with 221 additions and 19 deletions

View File

@@ -54,6 +54,7 @@ const TOOL_LABELS: Record<string, string> = {
gitea_list_issues: "Listed issues",
gitea_close_issue: "Closed issue",
gitea_comment_issue: "Added comment",
save_memory: "Saved to memory",
};
function friendlyToolName(raw: string): string {