feat: made chat fast

- Introduced lazy knowledge base retrieval mode, allowing the main agent to fetch KB content on demand via the `search_knowledge_base` tool, improving performance by skipping expensive pre-injection processes.
- Added cross-thread caching capability, enabling reuse of compiled graphs across different user chats, reducing latency for returning users.
- Updated middleware to support new lazy loading and caching features, ensuring efficient resource utilization and improved response times.
- Enhanced logging for performance tracking during knowledge retrieval and agent interactions.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-06-09 04:45:17 -07:00
parent ce952d2ad1
commit 41ff57101c
32 changed files with 979 additions and 169 deletions

View file

@ -12,7 +12,7 @@ import { schema } from "@/zero/schema";
// container and would make every authenticated Zero query fail with a 503.
const backendURL = (
process.env.FASTAPI_BACKEND_INTERNAL_URL ||
BACKEND_URL ||
process.env.BACKEND_URL ||
"http://localhost:8000"
).replace(/\/$/, "");