{"record":{"id":"bc0946a59d5511b3","repo":"crewAIInc/crewAI","slug":"document-not-found-doc-path","errorCode":null,"errorMessage":"Document not found: {doc_path}","messagePattern":"Document not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/contextualai_create_agent_tool/contextual_create_agent_tool.py","lineNumber":63,"sourceCode":"        self,\n        agent_name: str,\n        agent_description: str,\n        datastore_name: str,\n        document_paths: list[str],\n    ) -> str:\n        \"\"\"Create a complete RAG pipeline with documents.\"\"\"\n        resolved_paths = [validate_file_path(doc_path) for doc_path in document_paths]\n        try:\n            import os\n\n            datastore = self.contextual_client.datastores.create(name=datastore_name)\n            datastore_id = datastore.id\n\n            # Upload documents\n            document_ids = []\n            for doc_path in resolved_paths:\n                if not os.path.exists(doc_path):\n                    raise FileNotFoundError(f\"Document not found: {doc_path}\")\n\n                with open(doc_path, \"rb\") as f:\n                    ingestion_result = (\n                        self.contextual_client.datastores.documents.ingest(\n                            datastore_id, file=f\n                        )\n                    )\n                    document_ids.append(ingestion_result.id)\n\n            agent = self.contextual_client.agents.create(\n                name=agent_name,\n                description=agent_description,\n                datastore_ids=[datastore_id],\n            )\n\n            return f\"Successfully created agent '{agent_name}' with ID: {agent.id} and datastore ID: {datastore_id}. Uploaded {len(document_ids)} documents.\"\n\n        except Exception as e:","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/contextualai_create_agent_tool/contextual_create_agent_tool.py#L45-L81","documentation":"Error \"Document not found: {doc_path}\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai-tools/src/crewai_tools/tools/contextualai_create_agent_tool/contextual_create_agent_tool.py:63 when the library encounters an invalid state.","commonSituations":"Occurs when the document path passed to the Contextual AI create-agent tool does not exist. Verify the path and that the file is accessible.","solutions":["Verify the document path exists and is readable.","Use an absolute path or a path relative to the current working directory."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}