Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and refactorings across multiple files to improve configurability, error handling, and code organization. Key changes include the addition of configuration classes for loader scripts, updates to retry logic in embedding requests, and improvements to the agent's query handling. New tests have also been added to validate the configuration and logic changes.
Configuration Management Enhancements:
LoaderConfigandWebLoaderConfigdataclasses inscripts/loader_config.pyto centralize configuration for document and web loaders. IntroducedDOC_LOADER_CONFIGSandWEB_LOADER_CONFIGSto store predefined configurations.scripts/doc_loader.pyandscripts/url_loader.pyto use the new configuration classes, enabling dynamic loading paths and URI replacements. [1] [2]Embedding Retry Logic Improvements:
async def _make_embedding_requestwithinsrc/core/rag/embedder/__init__.pyto handle retries more robustly. Reduced initial wait time to 5 seconds and added a cumulative wait for 429 errors.tests/test_core_rag_embedder.pyto validate the new retry behavior, ensuring proper handling of multiple sleep intervals.Agent Behavior Refinements:
src/agent.pyto maintain a query history for better context management during interactions. Added logic to append user and assistant messages to the history and print it for debugging.Testing Additions:
tests/test_scripts_loader_config.pyto validate the structure and logic ofDOC_LOADER_CONFIGSandWEB_LOADER_CONFIGS, including URI replacement behavior and configuration integrity.File Renaming and Directory Adjustments:
doc-loader.py→doc_loader.py,url-loader.py→url_loader.py,docker/memgraph.sh→scripts/memgraph.sh) and updated paths accordingly. [1] [2] [3]