async def pull(
            collection_id: UUID = Path(
                ..., description="The ID of the graph to initialize."
            ),
            force: Optional[bool] = Body(
                False,
                description="If true, forces a re-pull of all entities and relationships.",
            ),
            # document_ids: list[UUID] = Body(
            #     ..., description="List of document IDs to add to the graph."
            # ),
            auth_user=Depends(self.providers.auth.auth_wrapper()),
        ) -> WrappedBooleanResponse:
            """Adds documents to a graph by copying their entities and
            relationships.

            This endpoint:
            1. Copies document entities to the graphs_entities table
            2. Copies document relationships to the graphs_relationships table
            3. Associates the documents with the graph

            When a document is added:
            - Its entities and relationships are copied to graph-specific tables
            - Existing entities/relationships are updated by merging their properties
            - The document ID is recorded in the graph's document_ids array

            Documents added to a graph will contribute their knowledge to:
            - Graph analysis and querying
            - Community detection
            - Knowledge graph enrichment

            The user must have access to both the graph and the documents being added.
            """

            collections_overview_response = (
                await self.services.management.collections_overview(
                    user_ids=[auth_user.id],
                    collection_ids=[collection_id],
                    offset=0,
                    limit=1,
                )
            )["results"]
            if len(collections_overview_response) == 0:  # type: ignore
                raise R2RException("Collection not found.", 404)

            # Check user permissions for graph
            if (
                not auth_user.is_superuser
                and collections_overview_response[0].owner_id != auth_user.id  # type: ignore
            ):
                raise R2RException("Only superusers can `pull` a graph.", 403)

            if (
                # not auth_user.is_superuser
                collection_id not in auth_user.collection_ids
            ):
                raise R2RException(
                    "The currently authenticated user does not have access to the collection associated with the given graph.",
                    403,
                )

            list_graphs_response = await self.services.graph.list_graphs(
                # user_ids=None,
                graph_ids=[collection_id],
                offset=0,
                limit=1,
            )
            if len(list_graphs_response["results"]) == 0:  # type: ignore
                raise R2RException("Graph not found", 404)
            collection_id = list_graphs_response["results"][0].collection_id  # type: ignore
            documents: list[DocumentResponse] = []
            document_req = await self.providers.database.collections_handler.documents_in_collection(
                collection_id, offset=0, limit=100
            )
            results = cast(list[DocumentResponse], document_req["results"])
            documents.extend(results)

            while len(results) == 100:
                document_req = await self.providers.database.collections_handler.documents_in_collection(
                    collection_id, offset=len(documents), limit=100
                )
                results = cast(list[DocumentResponse], document_req["results"])
                documents.extend(results)

            success = False

            for document in documents:
                entities = (
                    await self.providers.database.graphs_handler.entities.get(
                        parent_id=document.id,
                        store_type=StoreType.DOCUMENTS,
                        offset=0,
                        limit=100,
                    )
                )
                has_document = (
                    await self.providers.database.graphs_handler.has_document(
                        collection_id, document.id
                    )
                )
                if has_document:
                    logger.info(
                        f"Document {document.id} is already in graph {collection_id}, skipping."
                    )
                    continue
                if len(entities[0]) == 0:
                    if not force:
                        logger.warning(
                            f"Document {document.id} has no entities, extraction may not have been called, skipping."
                        )
                        continue
                    else:
                        logger.warning(
                            f"Document {document.id} has no entities, but force=True, continuing."
                        )

                success = (
                    await self.providers.database.graphs_handler.add_documents(
                        id=collection_id,
                        document_ids=[document.id],
                    )
                )
            if not success:
                logger.warning(
                    f"No documents were added to graph {collection_id}, marking as failed."
                )

            if success:
                await self.providers.database.documents_handler.set_workflow_status(
                    id=collection_id,
                    status_type="graph_sync_status",
                    status=GraphConstructionStatus.SUCCESS,
                )

            return GenericBooleanResponse(success=success)  # type: ignore
Adds documents to a graph by copying their entities and
            relationships.

            This endpoint:
            1. Copies document entities to the graphs_entities table
            2. Copies document relationships to the graphs_relationships table
            3. Associates the documents with the graph

            When a document is added:
            - Its entities and relationships are copied to graph-specific tables
            - Existing entities/relationships are updated by merging their properties
            - The document ID is recorded in the graph's document_ids array

            Documents added to a graph will contribute their knowledge to:
            - Graph analysis and querying
            - Community detection
            - Knowledge graph enrichment

            The user must have access to both the graph and the documents being added.
            
py/core/main/api/v3/graph_router.py