Brains: group knowledge packs into one collection
A brain is a named collection of knowledge packs. Group packs once under a brain, then ground a chat request in the whole set with a single brain_id. This replaces listing every pack ID on each request.
Manage brains through a new REST surface. Create a brain, then add or remove packs.
# Create a brain
POST /brains
{ "name": "Company Handbook", "description": "HR policies and SOPs" }
# Add a pack to it (idempotent)
POST /brains/{brain_id}/knowledge-packs
{ "pack_id": "7f3c..." }Attach the brain at chat time with brain_id. TIE resolves it to the packs it holds, then runs the same retrieval as knowledge_pack_ids.
POST /v1/chat/completions
{
"model": "anthropic/claude-sonnet-4-5",
"messages": [{ "role": "user", "content": "What is our refund window?" }],
"brain_id": "b1a2c3..."
}A brain points at its packs rather than holding copies. Deleting a brain removes only the collection, never the packs. A pack deleted after you add it simply drops out of retrieval. An explicit knowledge_pack_ids on the request wins, and the brain is ignored.
Administrators manage brains across users through /admin/brains. Admin create accepts a user_id; leave it null to create an app-owned or global brain with no owner. Brains require the PostgreSQL memory backend.
See the Brains guide for the full contract.