{"record":{"id":"d9982a87ffe0b6ca","repo":"chroma-core/chroma","slug":"attached-functions-are-only-supported-when-connect-d9982a","errorCode":null,"errorMessage":"Attached functions are only supported when connecting to a Chroma server via HttpClient. The Segment API (embedded mode) does not support attached function operations.","messagePattern":"Attached functions are only supported when connecting to a Chroma server via HttpClient\\. The Segment API \\(embedded mode\\) does not support attached function operations\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"chromadb/api/segment.py","lineNumber":1073,"sourceCode":"        return self._settings\n\n    @override\n    def get_max_batch_size(self) -> int:\n        return self._producer.max_batch_size\n\n    @override\n    def attach_function(\n        self,\n        function_id: str,\n        name: str,\n        input_collection_id: UUID,\n        output_collection: str,\n        params: Optional[Dict[str, Any]] = None,\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n    ) -> Tuple[\"AttachedFunction\", bool]:\n        \"\"\"Attached functions are not supported in the Segment API (local embedded mode).\"\"\"\n        raise NotImplementedError(\n            \"Attached functions are only supported when connecting to a Chroma server via HttpClient. \"\n            \"The Segment API (embedded mode) does not support attached function operations.\"\n        )\n\n    @override\n    def get_attached_function(\n        self,\n        name: str,\n        input_collection_id: UUID,\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n    ) -> \"AttachedFunction\":\n        \"\"\"Attached functions are not supported in the Segment API (local embedded mode).\"\"\"\n        raise NotImplementedError(\n            \"Attached functions are only supported when connecting to a Chroma server via HttpClient. \"\n            \"The Segment API (embedded mode) does not support attached function operations.\"\n        )\n","sourceCodeStart":1055,"sourceCodeEnd":1091,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/segment.py#L1055-L1091","documentation":"Chroma's attached-functions feature (server-side functions that derive an output collection from an input collection) exists only on a Chroma server reached via HttpClient. The embedded SegmentAPI overrides attach_function to raise NotImplementedError with a message explicitly redirecting to HttpClient — there is no function engine in embedded mode.","triggerScenarios":"collection.attach_function(function_id=..., name=..., input_collection_id=..., output_collection=..., params=...) on an embedded client (chromadb.Client, EphemeralClient, PersistentClient).","commonSituations":"Prototyping the attached-functions feature locally in a notebook with PersistentClient; running server-oriented integration tests against an embedded client; SDK/wrapper code that manages attached functions regardless of backend.","solutions":["Run a Chroma server and connect with chromadb.HttpClient, then attach functions there","Feature-detect: wrap attach_function in try/except NotImplementedError and disable the functions path when embedded","Branch on settings.chroma_api_impl before touching the function APIs"],"exampleFix":"// before\ncoll.attach_function(function_id='builtin:chunking', name='chunks', ...)  # NotImplementedError\n\n// after\nclient = chromadb.HttpClient(host='localhost', port=8000)\ncoll = client.get_collection('docs')\ncoll.attach_function(function_id='builtin:chunking', name='chunks', ...)","handlingStrategy":"validation","validationCode":"import chromadb\n\ndef is_server_client(client: chromadb.ClientAPI) -> bool:\n    return 'http' in (client.get_settings().chroma_api_impl or '').lower()\n\ndef attach_function_safe(coll, **kwargs):\n    if not is_server_client(coll._client):\n        raise NotImplementedError('attached functions require a Chroma server')\n    return coll.attach_function(**kwargs)","typeGuard":null,"tryCatchPattern":"try:\n    attached = coll.attach_function(function_id=fn_id, name=name,\n                                    input_collection_id=coll.id,\n                                    output_collection=out_name)\nexcept NotImplementedError:\n    attached = None  # embedded mode: functions unsupported","preventionTips":["Gate all attached-function calls behind an is-server check","Start function development against a Docker Chroma server from the beginning","Keep a feature matrix of embedded vs server capabilities in your project docs"],"tags":["chroma","attached-functions","not-implemented","embedded","server-only"],"backgroundTag":"feature-requires-server-client","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}