Skip to content

[FEATURE]Allow specifying external directory for knowledge source files #3519

@sanochihi

Description

@sanochihi

Feature Area

Core functionality

Is your feature request related to a an existing bug? Please link it here.

NA

Describe the solution you'd like

Summary

Currently, Crewai requires that files for knowledge sources (e.g., [TextFile|PDF|CSV|Excel]KnowledgeSource) be placed inside a knowledge directory within the project folder. While the output location of the embedded knowledge can be specified, the source files themselves must reside within the project directory. This creates a significant limitation when:

  1. Users want to reference files from an external directory outside the project.
  2. Users want to try Crewai in ephemeral environments like Google Colab, where project directories disappear after each session.

Proposal

Introduce an environment variable (e.g., CREWAI_KNOWLEDGE_FILE_DIR) or a configuration option that allows users to specify an arbitrary directory from which knowledge source files are loaded. This would provide:

  • Greater flexibility for organizing knowledge files.
  • Better UX for cloud-based or ephemeral environments.
  • Alignment with the existing CREWAI_STORAGE_DIR approach for embedded knowledge output.

Benefits

  • Users can store knowledge sources outside the project folder.
  • Enables easier collaboration and sharing of large datasets.
  • Makes Crewai more friendly for temporary environments like Colab or Docker containers.

Describe alternatives you've considered

No response

Additional context

No response

Willingness to Contribute

I can test the feature once it's implemented

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions