This document describes the new directory structure created for the RAG System refactoring.
The new structure follows a clean layered architecture with four main layers:
rag_system/
├── src/ # Source code
│ ├── domain/ # Domain layer
│ │ ├── vector_search/ # Vector search domain
│ │ ├── document_parsing/ # Document parsing domain
│ │ ├── knowledge_base/ # Knowledge base domain
│ │ └── shared/ # Shared domain concepts
│ │
│ ├── application/ # Application layer
│ │ ├── vector_search/ # Vector search use cases
│ │ ├── document_parsing/ # Document parsing use cases
│ │ ├── knowledge_base/ # Knowledge base use cases
│ │ └── shared/ # Shared application concepts
│ │
│ ├── infrastructure/ # Infrastructure layer
│ │ ├── vector_db/ # Vector database implementations
│ │ ├── database/ # Database and ORM models
│ │ ├── external_services/ # External service integrations
│ │ ├── file_storage/ # File storage implementations
│ │ └── parsers/ # Document parser implementations
│ │
│ ├── presentation/ # Presentation layer
│ │ ├── api/ # API routers
│ │ │ └── v1/ # API version 1 endpoints
│ │ └── schemas/ # Request/response schemas
│ │
│ ├── config/ # Configuration management
│ └── shared/ # Shared utilities
│
├── tests/ # Test suite
│ ├── unit/ # Unit tests
│ │ ├── domain/ # Domain layer tests
│ │ ├── application/ # Application layer tests
│ │ └── infrastructure/ # Infrastructure layer tests
│ ├── integration/ # Integration tests
│ │ ├── api/ # API integration tests
│ │ └── database/ # Database integration tests
│ ├── e2e/ # End-to-end tests
│ └── fixtures/ # Test fixtures and data
│
├── docs/ # Documentation
├── scripts/ # Utility scripts
└── docker/ # Docker configuration
src/domain/)src/application/)src/infrastructure/)src/presentation/)src/config/)src/shared/)tests/)✅ Task 1.1 completed: All directories and __init__.py files have been created successfully.
The next tasks in Phase 1 are: