Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot create 'Knowledge': Failed to create or get collection #2055

Open
AlemaoEc opened this issue Feb 7, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@AlemaoEc
Copy link

AlemaoEc commented Feb 7, 2025

Description

I am following the documentation here: https://docs.crewai.com/concepts/knowledge#what-is-knowledge

Steps to Reproduce

crew = Crew(
            tasks=[task],
            process=Process.sequential,
            verbose=True,
            knowledge_sources: [
              PDFKnowledgeSource(
                  file_paths=[local_path],
                  chunk_size=1000,  # Tamanho dos chunks para processamento
                  chunk_overlap=100,  # Sobreposição entre chunks para preservar contexto
                  metadata={
                    'source': 'Informações sobre a clínica',
                    'description': 'Documento com processos e procedimentos da clínica'
                  }
              )
            ],
            embedder={
              "provider": "openai",
              "config": {
                "model": "text-embedding-3-small",
                "dimensions": 256
              }
            }
        )

When I create a Crew or Agent that has a parameter for knowledge_sources and then run the agent I get the error.

  File "<path>/crewai_support_agent/.venv/lib/python3.12/site-packages/crewai/agent.py", line 140, in post_init_setup
    self._set_knowledge()
  File "<path>/crewai_support_agent/.venv/lib/python3.12/site-packages/crewai/agent.py", line 246, in _set_knowledge
    self._knowledge = Knowledge(
                      ^^^^^^^^^^
  File "<path>crewai_support_agent/.venv/lib/python3.12/site-packages/crewai/knowledge/knowledge.py", line 43, in __init__
    self.storage.initialize_knowledge_storage()
  File "<path>/crewai_support_agent/.venv/lib/python3.12/site-packages/crewai/knowledge/storage/knowledge_storage.py", line 107, in initialize_knowledge_storage
    raise Exception("Failed to create or get collection")
Exception: Failed to create or get collection

Expected behavior

That the knowledge_source was created and could be accessed by the agent or Crew.

Screenshots/Code snippets

See above.

Operating System

macOS Monterey

Python Version

3.11

crewAI Version

0.100.1

crewAI Tools Version

None

Virtual Environment

Venv

Evidence

File "/crewai_support_agent/.venv/lib/python3.12/site-packages/pydantic/main.py", line 214, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/crewai_support_agent/.venv/lib/python3.12/site-packages/crewai/agent.py", line 140, in post_init_setup
self._set_knowledge()
File "/crewai_support_agent/.venv/lib/python3.12/site-packages/crewai/agent.py", line 246, in _set_knowledge
self._knowledge = Knowledge(
^^^^^^^^^^
File "crewai_support_agent/.venv/lib/python3.12/site-packages/crewai/knowledge/knowledge.py", line 43, in init
self.storage.initialize_knowledge_storage()
File "/crewai_support_agent/.venv/lib/python3.12/site-packages/crewai/knowledge/storage/knowledge_storage.py", line 107, in initialize_knowledge_storage
raise Exception("Failed to create or get collection")
Exception: Failed to create or get collection

Possible Solution

I don't know.

Additional context

Same error: #1859 (comment)

@AlemaoEc AlemaoEc added the bug Something isn't working label Feb 7, 2025
@Vidit-Ostwal
Copy link
Contributor

Vidit-Ostwal commented Feb 7, 2025

I guess this has been fixed, can you try updating the crew version.
Check out this PR #2055

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants