Skip to content

fix(config): make index_path absolute relative to project root - #22

Open
ravimahatonp wants to merge 1 commit into
ChainLearnOfficial:mainfrom
ravimahatonp:fix-cwd-independent-index-path
Open

ravimahatonp wants to merge 1 commit into
ChainLearnOfficial:mainfrom
ravimahatonp:fix-cwd-independent-index-path

Conversation

@ravimahatonp

Copy link
Copy Markdown

Summary

Previously, index_path in src/config.py was defined as a relative path string (src/knowledge/data/index.json), which caused it to resolve against the process's current working directory. Running the application or scripts from any directory other than the project root (such as in container runtimes or system services) failed to locate the vector store index.

Changes Made

  • src/config.py: Introduced PROJECT_ROOT = Path(__file__).resolve().parent.parent and configured index_path as an absolute path relative to PROJECT_ROOT (PROJECT_ROOT / "src" / "knowledge" / "data" / "index.json"), guaranteeing reliable resolution regardless of CWD.

Closes #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

index_path is CWD-dependent relative path

1 participant